Skip to contentSkip to conversation

pci: Add PCI_BUS() and PCI_DEVID() interfaces to return bus number and device id

PATCH Superseded Shuah Khan 2 participants 2 messages Feb 11, 2013 – Feb 13, 2013 PCI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Shuah Khan

author
#0 lore raw

cover pci: Add PCI_BUS() and PCI_DEVID() interfaces to return bus number and device id

pci defines PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() interfaces, however, it doesn't have interfaces to return PCI bus and PCI device id. Drivers (AMD IOMMU, and AER) have module specific definitions for PCI_BUS() and AMD_IOMMU driver also has a module specific interface to calculate PCI device id from bus number and devfn.

This patch set adds PCI_BUS(), and PCI_DEVID() to pci.h, changes are to use PCI_BUS() from pci. Changes AMD_IOMMU driver to use PCI_BUS() and PCI_DEVID() from pci.

Files changed:

 include/uapi/linux/pci.h |    4 ++++
 1 file changed, 4 insertions(+)
 drivers/pci/pcie/aer/aerdrv_core.c |    2 --
 1 file changed, 2 deletions(-)
 drivers/iommu/amd_iommu_types.h |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
 drivers/iommu/amd_iommu.c       |    2 +-
 drivers/iommu/amd_iommu_init.c  |    6 +++---
 drivers/iommu/amd_iommu_types.h |    7 -------
 3 files changed, 4 insertions(+), 11 deletions(-)
Reviewed-by Tested-by Acked-by on the v1 series
#1 lore raw

Hi Bjorn,

Quoted 9 lines · Shuah Khan

pci defines PCI_DEVFN(), PCI_SLOT(), and PCI_FUNC() interfaces, however, it doesn't have interfaces to return PCI bus and PCI device id. Drivers (AMD IOMMU, and AER) have module specific definitions for PCI_BUS() and AMD_IOMMU driver also has a module specific interface to calculate PCI device id from bus number and devfn.

This patch set adds PCI_BUS(), and PCI_DEVID() to pci.h, changes are to use PCI_BUS() from pci. Changes AMD_IOMMU driver to use PCI_BUS() and PCI_DEVID() from pci.

Not sure who is going to merge this, it touches PCI and IOMMU code. Personally I don't care :-) If you want to take it via your tree feel free to add my

Otherwise please Ack the PCI parts and I will add it to my tree then.

Thanks,

Joerg