[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1407828373-24322-14-git-send-email-wangyijing@huawei.com>
Date: Tue, 12 Aug 2014 15:26:06 +0800
From: Yijing Wang <wangyijing@...wei.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>
CC: <linux-kernel@...r.kernel.org>, Xinwei Hu <huxinwei@...wei.com>,
Wuyun <wuyun.wu@...wei.com>, <linux-pci@...r.kernel.org>,
Marc Zyngier <marc.zyngier@....com>,
<linux-arm-kernel@...ts.infradead.org>,
Russell King <linux@....linux.org.uk>,
<arnab.basu@...escale.com>, <x86@...nel.org>,
"Arnd Bergmann" <arnd@...db.de>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
<xen-devel@...ts.xenproject.org>, Joerg Roedel <joro@...tes.org>,
<iommu@...ts.linux-foundation.org>, <linux-mips@...ux-mips.org>,
"Benjamin Herrenschmidt" <benh@...nel.crashing.org>,
<linuxppc-dev@...ts.ozlabs.org>, <linux-s390@...r.kernel.org>,
Sebastian Ott <sebott@...ux.vnet.ibm.com>,
"Tony Luck" <tony.luck@...el.com>, <linux-ia64@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
<sparclinux@...r.kernel.org>, Chris Metcalf <cmetcalf@...era.com>,
Yijing Wang <wangyijing@...wei.com>
Subject: [RFC PATCH 13/20] MIPS/xlr/MSI: Use msi_chip instead of arch func to configure MSI/MSI-X
Introduce a new struct msi_chip xlr_msi_chip instead of weak arch
functions to configure MSI/MSI-X.
Signed-off-by: Yijing Wang <wangyijing@...wei.com>
---
arch/mips/pci/pci-xlr.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/arch/mips/pci/pci-xlr.c b/arch/mips/pci/pci-xlr.c
index 0dde803..6eef164 100644
--- a/arch/mips/pci/pci-xlr.c
+++ b/arch/mips/pci/pci-xlr.c
@@ -214,11 +214,11 @@ static int get_irq_vector(const struct pci_dev *dev)
}
#ifdef CONFIG_PCI_MSI
-void arch_teardown_msi_irq(unsigned int irq)
+void xlr_teardown_msi_irq(unsigned int irq)
{
}
-int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
+int xlr_setup_msi_irq(struct device *dev, struct msi_desc *desc)
{
struct msi_msg msg;
struct pci_dev *lnk;
@@ -233,7 +233,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
* Enable MSI on the XLS PCIe controller bridge which was disabled
* at enumeration, the bridge MSI capability is at 0x50
*/
- lnk = xls_get_pcie_link(dev);
+ lnk = xls_get_pcie_link(to_pci_dev(dev));
if (lnk == NULL)
return 1;
@@ -243,7 +243,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
pci_write_config_word(lnk, 0x50 + PCI_MSI_FLAGS, val);
}
- irq = get_irq_vector(dev);
+ irq = get_irq_vector(to_pci_dev(dev));
if (irq <= 0)
return 1;
@@ -263,6 +263,17 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
write_msi_msg(irq, &msg);
return 0;
}
+
+struct msi_chip xlr_msi_chip = {
+ .setup_irq = xlr_setup_msi_irq,
+ .teardown_irq = xlr_teardown_msi_irq,
+};
+
+struct msi_chip *arch_get_match_msi_chip(struct device *dev)
+{
+ return &xlr_msi_chip;
+}
+
#endif
/* Extra ACK needed for XLR on chip PCI controller */
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists