lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 27 Oct 2014 15:48:39 +0800
From:	Yijing Wang <wangyijing@...wei.com>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
CC:	<linux-pci@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	Xinwei Hu <huxinwei@...wei.com>, Wuyun <wuyun.wu@...wei.com>,
	<linux-arm-kernel@...ts.infradead.org>,
	Russell King <linux@....linux.org.uk>,
	Thomas Gleixner <tglx@...utronix.de>,
	"Thierry Reding" <thierry.reding@...il.com>,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Yijing Wang <wangyijing@...wei.com>
Subject: [PATCH 02/10] PCI/MSI: Introduce weak pcibios_msi_controller()

Introduce a new weak pcibios_msi_controller() to
get the associate msi_chip for PCI bus. This is
preparation for save msi_chip in arch PCI sysdata.
This weak function will be removed after we save
msi_chip in generic pci_host_bridge.

Suggested-by: Bjorn Helgaas <bhelgaas@...gle.com>
Signed-off-by: Yijing Wang <wangyijing@...wei.com>
---
 drivers/pci/msi.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 1c7ca4a..f085f7f 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -30,9 +30,24 @@ int pci_msi_ignore_mask;
 
 /* Arch hooks */
 
+struct msi_controller * __weak pcibios_msi_controller(struct pci_bus *bus)
+{
+	return NULL;
+}
+
+struct msi_controller *pci_msi_controller(struct pci_bus *bus)
+{
+	struct msi_controller *ctrl = bus->msi;
+
+	if (ctrl)
+		return ctrl;
+
+	return pcibios_msi_controller(bus);
+}
+
 int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 {
-	struct msi_controller *ctrl = dev->bus->msi;
+	struct msi_controller *ctrl = pci_msi_controller(dev->bus);
 	int err;
 
 	if (!ctrl || !ctrl->setup_irq)
@@ -48,7 +63,7 @@ int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
 void __weak arch_teardown_msi_irq(unsigned int irq)
 {
 	struct msi_desc *entry = irq_get_msi_desc(irq);
-	struct msi_controller *ctrl = entry->dev->bus->msi;
+	struct msi_controller *ctrl = pci_msi_controller(entry->dev->bus);
 
 	if (!ctrl || !ctrl->teardown_irq)
 		return;
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ