Skip to content

Commit

Permalink
PCI: Add msi_controller setup_irqs() method for special multivector s…
Browse files Browse the repository at this point in the history
…etup

Add a msi_controller setup_irqs() method so MSI chip providers can
implement their own multivector MSI setup.

[bhelgaas: changelog]
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Pratyush Anand <pratyush.anand@gmail.com>
  • Loading branch information
Lucas Stach authored and Bjorn Helgaas committed Sep 18, 2015
1 parent ed8b472 commit 339e5b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,12 @@ void __weak arch_teardown_msi_irq(unsigned int irq)

int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{
struct msi_controller *chip = dev->bus->msi;
struct msi_desc *entry;
int ret;

if (chip && chip->setup_irqs)
return chip->setup_irqs(chip, dev, nvec, type);
/*
* If an architecture wants to support multiple MSI, it needs to
* override arch_setup_msi_irqs()
Expand Down
2 changes: 2 additions & 0 deletions include/linux/msi.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ struct msi_controller {

int (*setup_irq)(struct msi_controller *chip, struct pci_dev *dev,
struct msi_desc *desc);
int (*setup_irqs)(struct msi_controller *chip, struct pci_dev *dev,
int nvec, int type);
void (*teardown_irq)(struct msi_controller *chip, unsigned int irq);
};

Expand Down

0 comments on commit 339e5b4

Please sign in to comment.