[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 5/8] Fix incorrect initialization of PCI BARs.
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 5/8] Fix incorrect initialization of PCI BARs. |
Date: |
Thu, 3 Jun 2021 11:24:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
Hi Jason,
On 6/3/21 5:53 AM, Jason Thorpe wrote:
> Only program a BAR as a 64-bit MEM BAR if it really is a 64-bit MEM BAR.
> Fixes an issue with the CMD646 IDE controller under NetBSD.
OK for this fix,
>
> Improve some debug/info messages.
but I'm not sure why you changed the format.
Better split in 2 patches.
>
> Signed-off-by: Jason Thorpe <thorpej@me.com>
> ---
> pci.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/pci.c b/pci.c
> index ba05adb..5e9c906 100644
> --- a/pci.c
> +++ b/pci.c
> @@ -84,7 +84,7 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t
> *p_mem_base)
> device_id = pci_config_readw(bdf, PCI_DEVICE_ID);
> class_id = pci_config_readw(bdf, PCI_CLASS_DEVICE);
>
> - printf("PCI: %02x:%02x:%x class %04x id %04x:%04x\r\n",
> + printf("PCI: %d:%d:%d class %04x id %04x:%04x\r\n",
> PCI_BUS(bdf), PCI_SLOT(bdf), PCI_FUNC(bdf),
> class_id, vendor_id, device_id);
>
> @@ -118,9 +118,10 @@ pci_setup_device(int bdf, uint32_t *p_io_base, uint32_t
> *p_mem_base)
> *p_base = addr + size;
> pci_config_writel(bdf, ofs, addr);
>
> - printf("PCI: region %d: %08x\r\n", region, addr);
> + printf("PCI: region %d (BAR %02x): %08x\r\n", region, ofs, addr);
>
> - if ((val & PCI_BASE_ADDRESS_MEM_TYPE_MASK)
> + if ((old & PCI_BASE_ADDRESS_SPACE_IO) == 0 &&
> + (old & PCI_BASE_ADDRESS_MEM_TYPE_MASK)
> == PCI_BASE_ADDRESS_MEM_TYPE_64)
> {
> pci_config_writel(bdf, ofs + 4, 0);
>
- [PATCH 0/8] PALcode fixes required to run NetBSD/alpha., Jason Thorpe, 2021/06/02
- [PATCH 3/8] Fix initialization of the hwrpb.hwrpb.cpuid field., Jason Thorpe, 2021/06/02
- [PATCH 1/8] Make qemu-palcode build environment standalone. NFC., Jason Thorpe, 2021/06/02
- [PATCH 2/8] Fix delivery of unaligned access exceptions., Jason Thorpe, 2021/06/02
- [PATCH 4/8] Make some PCI macros available to other files. NFC., Jason Thorpe, 2021/06/02
- [PATCH 5/8] Fix incorrect initialization of PCI BARs., Jason Thorpe, 2021/06/02
- [PATCH 6/8] Provide interrupt mapping information in PCI config registers., Jason Thorpe, 2021/06/02
- [PATCH 7/8] Provide a Console Terminal Block in the HWRPB., Jason Thorpe, 2021/06/02
- [PATCH 8/8] Fixes for seconday CPU start-up., Jason Thorpe, 2021/06/02
- Re: [PATCH 0/8] PALcode fixes required to run NetBSD/alpha., Philippe Mathieu-Daudé, 2021/06/03