diff mbox

[06/18] Delayed alpha setup of PCI IRQs to bus scan time

Message ID 1412222866-21068-7-git-send-email-matt@masarand.com
State Changes Requested
Headers show

Commit Message

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

PCI IRQ initialisation is currently run during the boot code on alpha,
this has the issue that firstly an extra pass over the PCI bus is
required and second hot-plugged devices which are added after boot have
no way to be assigned an IRQ. This patch set fixes this by defering the
assignment of PCI IRQs untill device enable time which should solve
both of these issues.

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

---
 arch/alpha/kernel/pci.c          | 16 ++++++++++------
 arch/alpha/kernel/sys_nautilus.c |  1 -
 2 files changed, 10 insertions(+), 7 deletions(-)

Comments

Bjorn Helgaas Oct. 14, 2014, 6:27 p.m. UTC | #1
On Thu, Oct 02, 2014 at 05:07:34AM +0100, matt@masarand.com wrote:
> From: Matthew Minter <matt@masarand.com>
> 
> PCI IRQ initialisation is currently run during the boot code on alpha,
> this has the issue that firstly an extra pass over the PCI bus is
> required and second hot-plugged devices which are added after boot have
> no way to be assigned an IRQ. This patch set fixes this by defering the
> assignment of PCI IRQs untill device enable time which should solve
> both of these issues.
> 
> Signed-off-by: Matthew Minter <matt@masarand.com>
> 
> ---
>  arch/alpha/kernel/pci.c          | 16 ++++++++++------
>  arch/alpha/kernel/sys_nautilus.c |  1 -
>  2 files changed, 10 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
> index 076c35c..338537c 100644
> --- a/arch/alpha/kernel/pci.c
> +++ b/arch/alpha/kernel/pci.c
> @@ -28,7 +28,7 @@
>  
>  
>  /*
> - * Some string constants used by the various core logics. 
> + * Some string constants used by the various core logics.
>   */
>  
>  const char *const pci_io_names[] = {
> @@ -247,7 +247,7 @@ void pcibios_fixup_bus(struct pci_bus *bus)
>  	if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
>   		   (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
>   		pci_read_bridge_bases(bus);
> -	} 
> +	}
>  
>  	list_for_each_entry(dev, &bus->devices, bus_list) {
>  		pdev_save_srm_config(dev);
> @@ -338,7 +338,7 @@ common_init_pci(void)
>  		hose->need_domain_info = need_domain_info;
>  		next_busno = bus->busn_res.end + 1;
>  		/* Don't allow 8-bit bus number overflow inside the hose -
> -		   reserve some space for bridges. */ 
> +		   reserve some space for bridges. */

Extraneous whitespace changes above.

>  		if (next_busno > 224) {
>  			next_busno = 0;
>  			need_domain_info = 1;
> @@ -346,11 +346,15 @@ common_init_pci(void)
>  	}
>  
>  	pcibios_claim_console_setup();
> -
>  	pci_assign_unassigned_resources();
> -	pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
>  }
>  
> +int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
> +{
> +	bridge->swizzle_irq = alpha_mv.pci_swizzle;
> +	bridge->map_irq = alpha_mv.pci_map_irq;
> +	return 0;
> +}
>  
>  struct pci_controller * __init
>  alloc_pci_controller(void)
> @@ -387,7 +391,7 @@ sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
>  
>  	/* from hose or from bus.devfn */
>  	if (which & IOBASE_FROM_HOSE) {
> -		for(hose = hose_head; hose; hose = hose->next) 
> +		for(hose = hose_head; hose; hose = hose->next)

Extraneous whitespace change.  If you fix this in a separate patch, also
add a space after "for".

>  			if (hose->index == bus) break;
>  		if (!hose) return -ENODEV;
>  	} else {
> diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
> index 837c0fa..7fb4d51 100644
> --- a/arch/alpha/kernel/sys_nautilus.c
> +++ b/arch/alpha/kernel/sys_nautilus.c
> @@ -252,7 +252,6 @@ nautilus_init_pci(void)
>  	/* pci_common_swizzle() relies on bus->self being NULL
>  	   for the root bus, so just clear it. */
>  	bus->self = NULL;
> -	pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
>  }
>  
>  /*
> -- 
> 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/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 076c35c..338537c 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -28,7 +28,7 @@ 
 
 
 /*
- * Some string constants used by the various core logics. 
+ * Some string constants used by the various core logics.
  */
 
 const char *const pci_io_names[] = {
@@ -247,7 +247,7 @@  void pcibios_fixup_bus(struct pci_bus *bus)
 	if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
  		   (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
  		pci_read_bridge_bases(bus);
-	} 
+	}
 
 	list_for_each_entry(dev, &bus->devices, bus_list) {
 		pdev_save_srm_config(dev);
@@ -338,7 +338,7 @@  common_init_pci(void)
 		hose->need_domain_info = need_domain_info;
 		next_busno = bus->busn_res.end + 1;
 		/* Don't allow 8-bit bus number overflow inside the hose -
-		   reserve some space for bridges. */ 
+		   reserve some space for bridges. */
 		if (next_busno > 224) {
 			next_busno = 0;
 			need_domain_info = 1;
@@ -346,11 +346,15 @@  common_init_pci(void)
 	}
 
 	pcibios_claim_console_setup();
-
 	pci_assign_unassigned_resources();
-	pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
 }
 
+int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
+{
+	bridge->swizzle_irq = alpha_mv.pci_swizzle;
+	bridge->map_irq = alpha_mv.pci_map_irq;
+	return 0;
+}
 
 struct pci_controller * __init
 alloc_pci_controller(void)
@@ -387,7 +391,7 @@  sys_pciconfig_iobase(long which, unsigned long bus, unsigned long dfn)
 
 	/* from hose or from bus.devfn */
 	if (which & IOBASE_FROM_HOSE) {
-		for(hose = hose_head; hose; hose = hose->next) 
+		for(hose = hose_head; hose; hose = hose->next)
 			if (hose->index == bus) break;
 		if (!hose) return -ENODEV;
 	} else {
diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
index 837c0fa..7fb4d51 100644
--- a/arch/alpha/kernel/sys_nautilus.c
+++ b/arch/alpha/kernel/sys_nautilus.c
@@ -252,7 +252,6 @@  nautilus_init_pci(void)
 	/* pci_common_swizzle() relies on bus->self being NULL
 	   for the root bus, so just clear it. */
 	bus->self = NULL;
-	pci_fixup_irqs(alpha_mv.pci_swizzle, alpha_mv.pci_map_irq);
 }
 
 /*