Skip to content

Commit

Permalink
PCI: hookup irq_get_affinity callback
Browse files Browse the repository at this point in the history
struct bus_type has a new callback for retrieving the IRQ affinity for a
device. Hook this callback up for PCI based devices.

Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Daniel Wagner <wagi@kernel.org>
Link: https://lore.kernel.org/r/20241202-refactor-blk-affinity-helpers-v6-2-27211e9c2cd5@kernel.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Daniel Wagner authored and Jens Axboe committed Dec 23, 2024
1 parent fea4952 commit 22d813b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/pci/pci-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,13 +1670,27 @@ static void pci_dma_cleanup(struct device *dev)
iommu_device_unuse_default_domain(dev);
}

/*
* pci_device_irq_get_affinity - get IRQ affinity mask for device
* @dev: ptr to dev structure
* @irq_vec: interrupt vector number
*
* Return the CPU affinity mask for @dev and @irq_vec.
*/
static const struct cpumask *pci_device_irq_get_affinity(struct device *dev,
unsigned int irq_vec)
{
return pci_irq_get_affinity(to_pci_dev(dev), irq_vec);
}

const struct bus_type pci_bus_type = {
.name = "pci",
.match = pci_bus_match,
.uevent = pci_uevent,
.probe = pci_device_probe,
.remove = pci_device_remove,
.shutdown = pci_device_shutdown,
.irq_get_affinity = pci_device_irq_get_affinity,
.dev_groups = pci_dev_groups,
.bus_groups = pci_bus_groups,
.drv_groups = pci_drv_groups,
Expand Down

0 comments on commit 22d813b

Please sign in to comment.