diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2013-08-13 04:11:42 -0400 |
---|---|---|
committer | Jason Cooper <jason@lakedaemon.net> | 2013-08-13 11:16:30 -0400 |
commit | 6a4324ebf5cf412d55fd1ea259d4dd29fb8f90e8 (patch) | |
tree | 58930245de1df78313b6e6e61fb8308f815b94a9 | |
parent | 9d981ea5d43af79e1d7942d3d28e0f609db8b5d4 (diff) |
PCI: msi: add default MSI operations for !HAVE_GENERIC_HARDIRQS platforms
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>
-rw-r--r-- | drivers/pci/msi.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 2837285c4e83..b35f93c232cf 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -30,6 +30,7 @@ static int pci_msi_enable = 1; | |||
30 | 30 | ||
31 | /* Arch hooks */ | 31 | /* Arch hooks */ |
32 | 32 | ||
33 | #if defined(CONFIG_GENERIC_HARDIRQS) | ||
33 | int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) | 34 | int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) |
34 | { | 35 | { |
35 | struct msi_chip *chip = dev->bus->msi; | 36 | struct msi_chip *chip = dev->bus->msi; |
@@ -66,6 +67,21 @@ int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type) | |||
66 | 67 | ||
67 | return chip->check_device(chip, dev, nvec, type); | 68 | return chip->check_device(chip, dev, nvec, type); |
68 | } | 69 | } |
70 | #else | ||
71 | int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) | ||
72 | { | ||
73 | return -ENOSYS; | ||
74 | } | ||
75 | |||
76 | void __weak arch_teardown_msi_irq(unsigned int irq) | ||
77 | { | ||
78 | } | ||
79 | |||
80 | int __weak arch_msi_check_device(struct pci_dev *dev, int nvec, int type) | ||
81 | { | ||
82 | return 0; | ||
83 | } | ||
84 | #endif /* CONFIG_GENERIC_HARDIRQS */ | ||
69 | 85 | ||
70 | int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | 86 | int __weak arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) |
71 | { | 87 | { |