Skip to content

Commit

Permalink
PCI: msi: add default MSI operations for !HAVE_GENERIC_HARDIRQS platf…
Browse files Browse the repository at this point in the history
…orms

Some platforms (e.g S390) don't use the generic hardirqs code and
therefore do not defined HAVE_GENERIC_HARDIRQS. This prevents using
the irq_set_chip_data() and irq_get_chip_data() functions that are
used for the default implementations of the MSI operations.

So, when CONFIG_GENERIC_HARDIRQS is not enabled, provide another
default implementation of the MSI operations, that simply errors
out. The architecture is responsible for implementing those operations
(which is the case on S390), and cannot use the msi_chip infrastructure.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
  • Loading branch information
Thomas Petazzoni authored and Jason Cooper committed Aug 13, 2013
1 parent 9d981ea commit 6a4324e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static int pci_msi_enable = 1;

/* Arch hooks */

#if defined(CONFIG_GENERIC_HARDIRQS)
int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
{
struct msi_chip *chip = dev->bus->msi;
Expand Down Expand Up @@ -66,6 +67,21 @@ int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)

return chip->check_device(chip, dev, nvec, type);
}
#else
int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
{
return -ENOSYS;
}

void __weak arch_teardown_msi_irq(unsigned int irq)
{
}

int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type)
{
return 0;
}
#endif /* CONFIG_GENERIC_HARDIRQS */

int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{
Expand Down

0 comments on commit 6a4324e

Please sign in to comment.