Guest User

Untitled

a guest
Feb 25th, 2018
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.66 KB | None | 0 0
  1. From: Victor Gu <xigu@marvell.com>
  2.  
  3. The PCI configuration space read/write functions were special casing
  4. the situation where PCI_SLOT(devfn) != 0, and returned
  5. PCIBIOS_DEVICE_NOT_FOUND in this case.
  6.  
  7. However, will this is what is intended for the root bus, it is not
  8. intended for the child busses, as it prevents discovering devices with
  9. PCI_SLOT(x) != 0. Therefore, we return PCIBIOS_DEVICE_NOT_FOUND only
  10. if we're on the root bus.
  11.  
  12. Fixes: 8c39d710363c1 ("PCI: aardvark: Add Aardvark PCI host controller driver")
  13. Cc: <stable@vger.kernel.org>
  14. Signed-off-by: Victor Gu <xigu@marvell.com>
  15. Reviewed-by: Wilson Ding <dingwei@marvell.com>
  16. Reviewed-by: Nadav Haklai <nadavh@marvell.com>
  17. [Thomas: tweak commit log.]
  18. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  19. ---
  20. drivers/pci/host/pci-aardvark.c | 4 ++--
  21. 1 file changed, 2 insertions(+), 2 deletions(-)
  22.  
  23. diff --git a/drivers/pci/host/pci-aardvark.c b/drivers/pci/host/pci-aardvark.c
  24. index 89f4e3d072d7..da2881ba7737 100644
  25. --- a/drivers/pci/host/pci-aardvark.c
  26. +++ b/drivers/pci/host/pci-aardvark.c
  27. @@ -440,7 +440,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn,
  28. u32 reg;
  29. int ret;
  30.  
  31. - if (PCI_SLOT(devfn) != 0) {
  32. + if ((bus->number == pcie->root_bus_nr) && (PCI_SLOT(devfn) != 0)) {
  33. *val = 0xffffffff;
  34. return PCIBIOS_DEVICE_NOT_FOUND;
  35. }
  36. @@ -494,7 +494,7 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn,
  37. int offset;
  38. int ret;
  39.  
  40. - if (PCI_SLOT(devfn) != 0)
  41. + if ((bus->number == pcie->root_bus_nr) && (PCI_SLOT(devfn) != 0))
  42. return PCIBIOS_DEVICE_NOT_FOUND;
  43.  
  44. if (where % size)
Add Comment
Please, Sign In to add comment