Skip to content

Commit 1dbe162

Browse files
liudongdong3bjorn-helgaas
authored andcommitted
PCI: hisi: Fix hisi_pcie_cfg_read() 32-bit reads
For 32-bit config reads (size == 4), hisi_pcie_cfg_read() returned success but never filled in the data we read. Return the register data for 32-bit config reads. Without this fix, PCI doesn't work at all because enumeration depends on 32-bit config reads. The driver was tested internally, but got broken in the process of upstreaming, so this fixes the breakage. Fixes: 500a1d9 ("PCI: hisi: Add HiSilicon SoC Hip05 PCIe driver") Signed-off-by: Dongdong Liu <liudongdong3@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
1 parent 99496bd commit 1dbe162

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/pci/host/pcie-hisi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ static int hisi_pcie_cfg_read(struct pcie_port *pp, int where, int size,
6161
*val = *(u8 __force *) walker;
6262
else if (size == 2)
6363
*val = *(u16 __force *) walker;
64-
else if (size != 4)
64+
else if (size == 4)
65+
*val = reg_val;
66+
else
6567
return PCIBIOS_BAD_REGISTER_NUMBER;
6668

6769
return PCIBIOS_SUCCESSFUL;

0 commit comments

Comments
 (0)