0053-PCI-designware-Make-config-accessor-override-checkin.patch 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. From 6882f9eef932e6f5cc3c57115e3d7d4b5bc19662 Mon Sep 17 00:00:00 2001
  2. From: Bjorn Helgaas <bhelgaas@google.com>
  3. Date: Tue, 5 Jan 2016 15:56:30 -0600
  4. Subject: [PATCH 53/70] PCI: designware: Make config accessor override
  5. checking symmetric
  6. Drivers based on the DesignWare core can override the config read accessors
  7. by supplying rd_own_conf() and rd_other_conf() function pointers.
  8. dw_pcie_rd_conf() calls dw_pcie_rd_own_conf() (for accesses to the root
  9. bus) or dw_pcie_rd_other_conf():
  10. dw_pcie_rd_conf
  11. dw_pcie_rd_own_conf # if on root bus
  12. dw_pcie_rd_other_conf # if not on root bus
  13. Previously we checked for rd_other_conf() directly in dw_pcie_rd_conf(),
  14. but we checked for rd_own_conf() in dw_pcie_rd_own_conf().
  15. Check for rd_other_conf() in dw_pcie_rd_other_conf() to make this symmetric
  16. with the rd_own_conf() checking, and similarly for the write path.
  17. No functional change intended.
  18. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  19. Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
  20. ---
  21. drivers/pci/host/pcie-designware.c | 12 ++++++------
  22. 1 file changed, 6 insertions(+), 6 deletions(-)
  23. --- a/drivers/pci/host/pcie-designware.c
  24. +++ b/drivers/pci/host/pcie-designware.c
  25. @@ -571,6 +571,9 @@ static int dw_pcie_rd_other_conf(struct
  26. u64 cpu_addr;
  27. void __iomem *va_cfg_base;
  28. + if (pp->ops->rd_other_conf)
  29. + return pp->ops->rd_other_conf(pp, bus, devfn, where, size, val);
  30. +
  31. busdev = PCIE_ATU_BUS(bus->number) | PCIE_ATU_DEV(PCI_SLOT(devfn)) |
  32. PCIE_ATU_FUNC(PCI_FUNC(devfn));
  33. @@ -605,6 +608,9 @@ static int dw_pcie_wr_other_conf(struct
  34. u64 cpu_addr;
  35. void __iomem *va_cfg_base;
  36. + if (pp->ops->wr_other_conf)
  37. + return pp->ops->wr_other_conf(pp, bus, devfn, where, size, val);
  38. +
  39. busdev = PCIE_ATU_BUS(bus->number) | PCIE_ATU_DEV(PCI_SLOT(devfn)) |
  40. PCIE_ATU_FUNC(PCI_FUNC(devfn));
  41. @@ -667,9 +673,6 @@ static int dw_pcie_rd_conf(struct pci_bu
  42. if (bus->number == pp->root_bus_nr)
  43. return dw_pcie_rd_own_conf(pp, where, size, val);
  44. - if (pp->ops->rd_other_conf)
  45. - return pp->ops->rd_other_conf(pp, bus, devfn, where, size, val);
  46. -
  47. return dw_pcie_rd_other_conf(pp, bus, devfn, where, size, val);
  48. }
  49. @@ -684,9 +687,6 @@ static int dw_pcie_wr_conf(struct pci_bu
  50. if (bus->number == pp->root_bus_nr)
  51. return dw_pcie_wr_own_conf(pp, where, size, val);
  52. - if (pp->ops->wr_other_conf)
  53. - return pp->ops->wr_other_conf(pp, bus, devfn, where, size, val);
  54. -
  55. return dw_pcie_wr_other_conf(pp, bus, devfn, where, size, val);
  56. }