diff mbox

[03/18] Delayed arm setup of PCI IRQs to bus scan time

Message ID 1412222866-21068-4-git-send-email-matt@masarand.com
State New, archived
Headers show

Commit Message

matt@masarand.com Oct. 2, 2014, 4:07 a.m. UTC
From: Matthew Minter <matt@masarand.com>

Currently PCI device IRQs under arm are initialised during the
pci_common_init_dev code path, this results in an extra sweep of the
PCI bus as well as causing PCI devices hot-plugged after boot to not
receive an IRQ.

This patch set defers this assignment untill the device enable phase
which prevents both these issues.

Signed-off-by: Matthew Minter <matt@masarand.com>

---
 arch/arm/kernel/bios32.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Comments

Bjorn Helgaas Oct. 14, 2014, 6:14 p.m. UTC | #1
On Thu, Oct 02, 2014 at 05:07:31AM +0100, matt@masarand.com wrote:
> From: Matthew Minter <matt@masarand.com>
> 
> Currently PCI device IRQs under arm are initialised during the
> pci_common_init_dev code path, this results in an extra sweep of the
> PCI bus as well as causing PCI devices hot-plugged after boot to not
> receive an IRQ.
> 
> This patch set defers this assignment untill the device enable phase
> which prevents both these issues.
> 
> Signed-off-by: Matthew Minter <matt@masarand.com>
> 
> ---
>  arch/arm/kernel/bios32.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
> index 17a26c1..4dcf3f7 100644
> --- a/arch/arm/kernel/bios32.c
> +++ b/arch/arm/kernel/bios32.c
> @@ -389,7 +389,7 @@ void pcibios_remove_bus(struct pci_bus *bus)
>   * PCI standard swizzle is implemented on plug-in cards and Cardbus based
>   * PCI extenders, so it can not be ignored.
>   */
> -static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)
> +u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)

I don't think there's anything in this patch that requires
pcibios_swizzle() or pcibios_map_irq() to be non-static.

>  {
>  	struct pci_sys_data *sys = dev->sysdata;
>  	int slot, oldpin = *pin;
> @@ -409,7 +409,7 @@ static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)
>  /*
>   * Map a slot/pin to an IRQ.
>   */
> -static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
> +int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
>  {
>  	struct pci_sys_data *sys = dev->sysdata;
>  	int irq = -1;
> @@ -424,6 +424,13 @@ static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
>  	return irq;
>  }
>  
> +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
> +{
> +	bridge->swizzle_irq = pcibios_swizzle;
> +	bridge->map_irq = pcibios_map_irq;
> +	return 0;
> +}
> +
>  static int pcibios_init_resources(int busnr, struct pci_sys_data *sys)
>  {
>  	int ret;
> @@ -523,8 +530,6 @@ void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
>  	if (hw->postinit)
>  		hw->postinit();
>  
> -	pci_fixup_irqs(pcibios_swizzle, pcibios_map_irq);
> -
>  	list_for_each_entry(sys, &head, node) {
>  		struct pci_bus *bus = sys->bus;
>  
> -- 
> 2.1.0
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 17a26c1..4dcf3f7 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -389,7 +389,7 @@  void pcibios_remove_bus(struct pci_bus *bus)
  * PCI standard swizzle is implemented on plug-in cards and Cardbus based
  * PCI extenders, so it can not be ignored.
  */
-static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)
+u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)
 {
 	struct pci_sys_data *sys = dev->sysdata;
 	int slot, oldpin = *pin;
@@ -409,7 +409,7 @@  static u8 pcibios_swizzle(struct pci_dev *dev, u8 *pin)
 /*
  * Map a slot/pin to an IRQ.
  */
-static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
+int pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
 {
 	struct pci_sys_data *sys = dev->sysdata;
 	int irq = -1;
@@ -424,6 +424,13 @@  static int pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 	return irq;
 }
 
+int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
+{
+	bridge->swizzle_irq = pcibios_swizzle;
+	bridge->map_irq = pcibios_map_irq;
+	return 0;
+}
+
 static int pcibios_init_resources(int busnr, struct pci_sys_data *sys)
 {
 	int ret;
@@ -523,8 +530,6 @@  void pci_common_init_dev(struct device *parent, struct hw_pci *hw)
 	if (hw->postinit)
 		hw->postinit();
 
-	pci_fixup_irqs(pcibios_swizzle, pcibios_map_irq);
-
 	list_for_each_entry(sys, &head, node) {
 		struct pci_bus *bus = sys->bus;