diff mbox series

PCI: Update Makefile to move Endpoint library before controllers

Message ID 1529684237-10424-1-git-send-email-adouglas@cadence.com
State Accepted
Delegated to: Bjorn Helgaas
Headers show
Series PCI: Update Makefile to move Endpoint library before controllers | expand

Commit Message

Alan Douglas June 22, 2018, 4:17 p.m. UTC
The Endpoint library must be initialized before its users, which
are in drivers/pci/controllers

This change corrects a kernel crash when loading the Cadence EP
driver, since it calls devm_pci_epc_create() and this is only
valid once the Endpoint library has been initialized.

Signed-off-by: Alan Douglas <adouglas@cadence.com>
---
 drivers/pci/Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Bjorn Helgaas June 22, 2018, 5:18 p.m. UTC | #1
On Fri, Jun 22, 2018 at 05:17:17PM +0100, Alan Douglas wrote:
> The Endpoint library must be initialized before its users, which
> are in drivers/pci/controllers
> 
> This change corrects a kernel crash when loading the Cadence EP
> driver, since it calls devm_pci_epc_create() and this is only
> valid once the Endpoint library has been initialized.
> 
> Signed-off-by: Alan Douglas <adouglas@cadence.com>

Applied to for-linus for v4.18, thanks!

I think this got broken by the move to drivers/pci/controllers, so I added
this:

  Fixes: 6e0832fa432e ("PCI: Collect all native drivers under drivers/pci/controller/")

> ---
>  drivers/pci/Makefile |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
> index 5352019..1b2cfe5 100644
> --- a/drivers/pci/Makefile
> +++ b/drivers/pci/Makefile
> @@ -28,10 +28,10 @@ obj-$(CONFIG_PCI_PF_STUB)	+= pci-pf-stub.o
>  obj-$(CONFIG_PCI_ECAM)		+= ecam.o
>  obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o
>  
> -obj-y				+= controller/
> -obj-y				+= switch/
> -
>  # Endpoint library must be initialized before its users
>  obj-$(CONFIG_PCI_ENDPOINT)	+= endpoint/
>  
> +obj-y				+= controller/
> +obj-y				+= switch/
> +
>  ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
> -- 
> 1.7.1
>
diff mbox series

Patch

diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 5352019..1b2cfe5 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -28,10 +28,10 @@  obj-$(CONFIG_PCI_PF_STUB)	+= pci-pf-stub.o
 obj-$(CONFIG_PCI_ECAM)		+= ecam.o
 obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o
 
-obj-y				+= controller/
-obj-y				+= switch/
-
 # Endpoint library must be initialized before its users
 obj-$(CONFIG_PCI_ENDPOINT)	+= endpoint/
 
+obj-y				+= controller/
+obj-y				+= switch/
+
 ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG