aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYijing Wang <wangyijing@huawei.com>2014-10-27 03:48:40 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-11-21 11:32:29 -0500
commit49dcc01a9ff2df5fafe50777bec0591c0a588d27 (patch)
treee5db4bf85123ef21c56cc0adc44ba7c3617c7971
parent262a2baf9e4a2fcedb6645ca98d77a1c12303a1d (diff)
ARM/PCI: Save MSI controller in pci_sys_data
Currently ARM associates an MSI controller with a PCI bus by defining pcibios_add_bus() and using it to call a struct hw_pci.add_bus() method. That method sets the struct pci_bus "msi" member. That's unwieldy and unnecessarily couples MSI with the PCI enumeration code. On ARM, all devices under the same PCI host bridge share an MSI controller, so add an msi_controller pointer to the struct pci_sys_data and implement pcibios_msi_controller() to retrieve it. This is a step toward moving the msi_controller pointer into the generic struct pci_host_bridge. [bhelgaas: changelog, take pci_dev instead of pci_bus] Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--arch/arm/include/asm/mach/pci.h6
-rw-r--r--arch/arm/kernel/bios32.c12
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index 7fc42784becb..8144d61e5693 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -22,6 +22,9 @@ struct hw_pci {
22#ifdef CONFIG_PCI_DOMAINS 22#ifdef CONFIG_PCI_DOMAINS
23 int domain; 23 int domain;
24#endif 24#endif
25#ifdef CONFIG_PCI_MSI
26 struct msi_controller *msi_ctrl;
27#endif
25 struct pci_ops *ops; 28 struct pci_ops *ops;
26 int nr_controllers; 29 int nr_controllers;
27 void **private_data; 30 void **private_data;
@@ -47,6 +50,9 @@ struct pci_sys_data {
47#ifdef CONFIG_PCI_DOMAINS 50#ifdef CONFIG_PCI_DOMAINS
48 int domain; 51 int domain;
49#endif 52#endif
53#ifdef CONFIG_PCI_MSI
54 struct msi_controller *msi_ctrl;
55#endif
50 struct list_head node; 56 struct list_head node;
51 int busnr; /* primary bus number */ 57 int busnr; /* primary bus number */
52 u64 mem_offset; /* bus->cpu memory mapping offset */ 58 u64 mem_offset; /* bus->cpu memory mapping offset */
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 17a26c17f7f5..ff2be3a22e1d 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -18,6 +18,15 @@
18 18
19static int debug_pci; 19static int debug_pci;
20 20
21#ifdef CONFIG_PCI_MSI
22struct msi_controller *pcibios_msi_controller(struct pci_dev *dev)
23{
24 struct pci_sys_data *sysdata = dev->bus->sysdata;
25
26 return sysdata->msi_ctrl;
27}
28#endif
29
21/* 30/*
22 * We can't use pci_get_device() here since we are 31 * We can't use pci_get_device() here since we are
23 * called from interrupt context. 32 * called from interrupt context.
@@ -471,6 +480,9 @@ static void pcibios_init_hw(struct device *parent, struct hw_pci *hw,
471#ifdef CONFIG_PCI_DOMAINS 480#ifdef CONFIG_PCI_DOMAINS
472 sys->domain = hw->domain; 481 sys->domain = hw->domain;
473#endif 482#endif
483#ifdef CONFIG_PCI_MSI
484 sys->msi_ctrl = hw->msi_ctrl;
485#endif
474 sys->busnr = busnr; 486 sys->busnr = busnr;
475 sys->swizzle = hw->swizzle; 487 sys->swizzle = hw->swizzle;
476 sys->map_irq = hw->map_irq; 488 sys->map_irq = hw->map_irq;