[PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
- Subject: [PATCH v1 05/21] PCI/MSI: Introduce weak arch_find_msi_chip() to find MSI chip
- From: Yijing Wang <wangyijing@xxxxxxxxxx>
- Date: Fri, 5 Sep 2014 18:09:50 +0800
- Cc: Xinwei Hu <huxinwei@xxxxxxxxxx>, Wuyun <wuyun.wu@xxxxxxxxxx>, <linux-pci@xxxxxxxxxxxxxxx>, <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "Russell King" <linux@xxxxxxxxxxxxxxxx>, <linux-arch@xxxxxxxxxxxxxxx>, <arnab.basu@xxxxxxxxxxxxx>, <Bharat.Bhushan@xxxxxxxxxxxxx>, <x86@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, "Konrad Rzeszutek Wilk" <konrad.wilk@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Joerg Roedel <joro@xxxxxxxxxx>, <iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx>, <linux-mips@xxxxxxxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, <linuxppc-dev@xxxxxxxxxxxxxxxx>, <linux-s390@xxxxxxxxxxxxxxx>, Sebastian Ott <sebott@xxxxxxxxxxxxxxxxxx>, "Tony Luck" <tony.luck@xxxxxxxxx>, <linux-ia64@xxxxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, <sparclinux@xxxxxxxxxxxxxxx>, Chris Metcalf <cmetcalf@xxxxxxxxxx>, Ralf Baechle <ralf@xxxxxxxxxxxxxx>, Yijing Wang <wangyijing@xxxxxxxxxx>
- In-reply-to: <1409911806-10519-1-git-send-email-wangyijing@huawei.com>
- List-id: <linux-ia64.vger.kernel.org>
- References: <1409911806-10519-1-git-send-email-wangyijing@huawei.com>
Introduce weak arch_find_msi_chip() to find the match msi_chip.
Currently, MSI chip associates pci bus to msi_chip. Because in
ARM platform, there may be more than one MSI controller in system.
Associate pci bus to msi_chip help pci device to find the match
msi_chip and setup MSI/MSI-X irq correctly. But in other platform,
like in x86. we only need one MSI chip, because all device use
the same MSI address/data and irq etc. So it's no need to associate
pci bus to MSI chip, just use a arch function, arch_find_msi_chip()
to return the MSI chip for simplicity. The default weak
arch_find_msi_chip() used in ARM platform, find the MSI chip
by pci bus.
Signed-off-by: Yijing Wang <wangyijing@xxxxxxxxxx>
---
drivers/pci/msi.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index a77e7f7..539c11d 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -29,9 +29,14 @@ static int pci_msi_enable = 1;
/* Arch hooks */
+struct msi_chip * __weak arch_find_msi_chip(struct pci_dev *dev)
+{
+ return dev->bus->msi;
+}
+
int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
{
- struct msi_chip *chip = dev->bus->msi;
+ struct msi_chip *chip = arch_find_msi_chip(dev);
int err;
if (!chip || !chip->setup_irq)
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]