public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcie hotplug: Change link order of pciehp
@ 2009-01-27  0:37 Matthew Garrett
  2009-01-27  0:44 ` Randy Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Garrett @ 2009-01-27  0:37 UTC (permalink / raw)
  To: linux-pci; +Cc: jbarnes, kristen.c.accardi, linux-kernel

Some hardware exposes PCIE slots in such a way that they can be claimed by
either the acpiphp or pciehp driver. pciehp is the preferred driver if the
firmware allows the OS to claim control via the _OSC method so should be
loaded first - if it fails to bind (either due to a missing _OSC method or
the firmware refusing to hand off control) then we can fall back to acpiphp or
a vendor-specific driver.

This patch simply changes the link order to ensure that pciehp will be
initialised before acpiphp if both are statically built into the kernel.

Signed-off-by: Matthew Garrett <mjg@redhat.com>

--- 

diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
index e31fb91..a024b44 100644
--- a/drivers/pci/hotplug/Makefile
+++ b/drivers/pci/hotplug/Makefile
@@ -5,11 +5,11 @@
 obj-$(CONFIG_HOTPLUG_PCI)		+= pci_hotplug.o
 obj-$(CONFIG_HOTPLUG_PCI_COMPAQ)	+= cpqphp.o
 obj-$(CONFIG_HOTPLUG_PCI_IBM)		+= ibmphp.o
+obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
 obj-$(CONFIG_HOTPLUG_PCI_ACPI)		+= acpiphp.o
 obj-$(CONFIG_HOTPLUG_PCI_ACPI_IBM)	+= acpiphp_ibm.o
 obj-$(CONFIG_HOTPLUG_PCI_CPCI_ZT5550)	+= cpcihp_zt5550.o
 obj-$(CONFIG_HOTPLUG_PCI_CPCI_GENERIC)	+= cpcihp_generic.o
-obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
 obj-$(CONFIG_HOTPLUG_PCI_SHPC)		+= shpchp.o
 obj-$(CONFIG_HOTPLUG_PCI_RPA)		+= rpaphp.o
 obj-$(CONFIG_HOTPLUG_PCI_RPA_DLPAR)	+= rpadlpar_io.o

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pcie hotplug: Change link order of pciehp
  2009-01-27  0:37 [PATCH] pcie hotplug: Change link order of pciehp Matthew Garrett
@ 2009-01-27  0:44 ` Randy Dunlap
  2009-01-27  1:03   ` Matthew Garrett
  0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2009-01-27  0:44 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-pci, jbarnes, kristen.c.accardi, linux-kernel

Matthew Garrett wrote:
> Some hardware exposes PCIE slots in such a way that they can be claimed by
> either the acpiphp or pciehp driver. pciehp is the preferred driver if the
> firmware allows the OS to claim control via the _OSC method so should be
> loaded first - if it fails to bind (either due to a missing _OSC method or
> the firmware refusing to hand off control) then we can fall back to acpiphp or
> a vendor-specific driver.
> 
> This patch simply changes the link order to ensure that pciehp will be
> initialised before acpiphp if both are statically built into the kernel.
> 
> Signed-off-by: Matthew Garrett <mjg@redhat.com>

Hi,
I'd prefer to have a comment in the Makefile (not just in git)
that link order is important for those 2 drivers and why.

We do that in several other similar situations and I believe that
having it in the Makefile is preferable.

> --- 
> 
> diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
> index e31fb91..a024b44 100644
> --- a/drivers/pci/hotplug/Makefile
> +++ b/drivers/pci/hotplug/Makefile
> @@ -5,11 +5,11 @@
>  obj-$(CONFIG_HOTPLUG_PCI)		+= pci_hotplug.o
>  obj-$(CONFIG_HOTPLUG_PCI_COMPAQ)	+= cpqphp.o
>  obj-$(CONFIG_HOTPLUG_PCI_IBM)		+= ibmphp.o
> +obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
>  obj-$(CONFIG_HOTPLUG_PCI_ACPI)		+= acpiphp.o
>  obj-$(CONFIG_HOTPLUG_PCI_ACPI_IBM)	+= acpiphp_ibm.o
>  obj-$(CONFIG_HOTPLUG_PCI_CPCI_ZT5550)	+= cpcihp_zt5550.o
>  obj-$(CONFIG_HOTPLUG_PCI_CPCI_GENERIC)	+= cpcihp_generic.o
> -obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
>  obj-$(CONFIG_HOTPLUG_PCI_SHPC)		+= shpchp.o
>  obj-$(CONFIG_HOTPLUG_PCI_RPA)		+= rpaphp.o
>  obj-$(CONFIG_HOTPLUG_PCI_RPA_DLPAR)	+= rpadlpar_io.o
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pcie hotplug: Change link order of pciehp
  2009-01-27  0:44 ` Randy Dunlap
@ 2009-01-27  1:03   ` Matthew Garrett
  2009-01-27  2:18     ` Randy Dunlap
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Garrett @ 2009-01-27  1:03 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-pci, jbarnes, kristen.c.accardi, linux-kernel

commit bf53d46d80486fa613dc345aba5d42a29368056d
Author: Matthew Garrett <mjg@redhat.com>
Date:   Tue Jan 27 11:29:02 2009 +1100

pcie hotplug: Change link order of pciehp

Some hardware exposes PCIE slots in such a way that they can be claimed by
either the acpiphp or pciehp driver. pciehp is the preferred driver if the
firmware allows the OS to claim control via the _OSC method so should be
loaded first - if it fails to bind (either due to a missing _OSC method or
the firmware refusing to hand off control) then we can fall back to acpiphp or
a vendor-specific driver.

This patch simply changes the link order to ensure that pciehp will be
initialised before acpiphp if both are statically built into the kernel.

Signed-off-by: Matthew Garrett <mjg@redhat.com>

--- 

diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
index e31fb91..2aa117c 100644
--- a/drivers/pci/hotplug/Makefile
+++ b/drivers/pci/hotplug/Makefile
@@ -5,11 +5,15 @@
 obj-$(CONFIG_HOTPLUG_PCI)		+= pci_hotplug.o
 obj-$(CONFIG_HOTPLUG_PCI_COMPAQ)	+= cpqphp.o
 obj-$(CONFIG_HOTPLUG_PCI_IBM)		+= ibmphp.o
+
+# pciehp should be linked before acpiphp in order to allow the native driver
+# to attempt to bind first. We can then fall back to generic support.
+
+obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
 obj-$(CONFIG_HOTPLUG_PCI_ACPI)		+= acpiphp.o
 obj-$(CONFIG_HOTPLUG_PCI_ACPI_IBM)	+= acpiphp_ibm.o
 obj-$(CONFIG_HOTPLUG_PCI_CPCI_ZT5550)	+= cpcihp_zt5550.o
 obj-$(CONFIG_HOTPLUG_PCI_CPCI_GENERIC)	+= cpcihp_generic.o
-obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
 obj-$(CONFIG_HOTPLUG_PCI_SHPC)		+= shpchp.o
 obj-$(CONFIG_HOTPLUG_PCI_RPA)		+= rpaphp.o
 obj-$(CONFIG_HOTPLUG_PCI_RPA_DLPAR)	+= rpadlpar_io.o

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pcie hotplug: Change link order of pciehp
  2009-01-27  1:03   ` Matthew Garrett
@ 2009-01-27  2:18     ` Randy Dunlap
  2009-01-27 23:37       ` Jesse Barnes
  0 siblings, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2009-01-27  2:18 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-pci, jbarnes, kristen.c.accardi, linux-kernel

Matthew Garrett wrote:
> commit bf53d46d80486fa613dc345aba5d42a29368056d
> Author: Matthew Garrett <mjg@redhat.com>
> Date:   Tue Jan 27 11:29:02 2009 +1100
> 
> pcie hotplug: Change link order of pciehp
> 
> Some hardware exposes PCIE slots in such a way that they can be claimed by
> either the acpiphp or pciehp driver. pciehp is the preferred driver if the
> firmware allows the OS to claim control via the _OSC method so should be
> loaded first - if it fails to bind (either due to a missing _OSC method or
> the firmware refusing to hand off control) then we can fall back to acpiphp or
> a vendor-specific driver.
> 
> This patch simply changes the link order to ensure that pciehp will be
> initialised before acpiphp if both are statically built into the kernel.
> 
> Signed-off-by: Matthew Garrett <mjg@redhat.com>

Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

Thanks.

> --- 
> 
> diff --git a/drivers/pci/hotplug/Makefile b/drivers/pci/hotplug/Makefile
> index e31fb91..2aa117c 100644
> --- a/drivers/pci/hotplug/Makefile
> +++ b/drivers/pci/hotplug/Makefile
> @@ -5,11 +5,15 @@
>  obj-$(CONFIG_HOTPLUG_PCI)		+= pci_hotplug.o
>  obj-$(CONFIG_HOTPLUG_PCI_COMPAQ)	+= cpqphp.o
>  obj-$(CONFIG_HOTPLUG_PCI_IBM)		+= ibmphp.o
> +
> +# pciehp should be linked before acpiphp in order to allow the native driver
> +# to attempt to bind first. We can then fall back to generic support.
> +
> +obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
>  obj-$(CONFIG_HOTPLUG_PCI_ACPI)		+= acpiphp.o
>  obj-$(CONFIG_HOTPLUG_PCI_ACPI_IBM)	+= acpiphp_ibm.o
>  obj-$(CONFIG_HOTPLUG_PCI_CPCI_ZT5550)	+= cpcihp_zt5550.o
>  obj-$(CONFIG_HOTPLUG_PCI_CPCI_GENERIC)	+= cpcihp_generic.o
> -obj-$(CONFIG_HOTPLUG_PCI_PCIE)		+= pciehp.o
>  obj-$(CONFIG_HOTPLUG_PCI_SHPC)		+= shpchp.o
>  obj-$(CONFIG_HOTPLUG_PCI_RPA)		+= rpaphp.o
>  obj-$(CONFIG_HOTPLUG_PCI_RPA_DLPAR)	+= rpadlpar_io.o
> 


-- 
~Randy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pcie hotplug: Change link order of pciehp
  2009-01-27  2:18     ` Randy Dunlap
@ 2009-01-27 23:37       ` Jesse Barnes
  0 siblings, 0 replies; 5+ messages in thread
From: Jesse Barnes @ 2009-01-27 23:37 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: Matthew Garrett, linux-pci, kristen.c.accardi, linux-kernel

On Monday, January 26, 2009 6:18 pm Randy Dunlap wrote:
> Matthew Garrett wrote:
> > commit bf53d46d80486fa613dc345aba5d42a29368056d
> > Author: Matthew Garrett <mjg@redhat.com>
> > Date:   Tue Jan 27 11:29:02 2009 +1100
> >
> > pcie hotplug: Change link order of pciehp
> >
> > Some hardware exposes PCIE slots in such a way that they can be claimed
> > by either the acpiphp or pciehp driver. pciehp is the preferred driver if
> > the firmware allows the OS to claim control via the _OSC method so should
> > be loaded first - if it fails to bind (either due to a missing _OSC
> > method or the firmware refusing to hand off control) then we can fall
> > back to acpiphp or a vendor-specific driver.
> >
> > This patch simply changes the link order to ensure that pciehp will be
> > initialised before acpiphp if both are statically built into the kernel.
> >
> > Signed-off-by: Matthew Garrett <mjg@redhat.com>
>
> Acked-by: Randy Dunlap <randy.dunlap@oracle.com>

Ok, applied to my for-linus branch, since this is actually affecting users 
now.

-- 
Jesse Barnes, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-27 23:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-27  0:37 [PATCH] pcie hotplug: Change link order of pciehp Matthew Garrett
2009-01-27  0:44 ` Randy Dunlap
2009-01-27  1:03   ` Matthew Garrett
2009-01-27  2:18     ` Randy Dunlap
2009-01-27 23:37       ` Jesse Barnes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox