Skip to content

Commit

Permalink
PCI: hisi: Fix hisi_pcie_cfg_read() 32-bit reads
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dongdong Liu authored and Bjorn Helgaas committed Dec 4, 2015
1 parent 99496bd commit 1dbe162
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/pci/host/pcie-hisi.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ static int hisi_pcie_cfg_read(struct pcie_port *pp, int where, int size,
*val = *(u8 __force *) walker;
else if (size == 2)
*val = *(u16 __force *) walker;
else if (size != 4)
else if (size == 4)
*val = reg_val;
else
return PCIBIOS_BAD_REGISTER_NUMBER;

return PCIBIOS_SUCCESSFUL;
Expand Down

0 comments on commit 1dbe162

Please sign in to comment.