Skip to content

Commit

Permalink
PCI: Initialize endpoint library before controllers
Browse files Browse the repository at this point in the history
The endpoint library must be initialized before its users, which are in
drivers/pci/controllers.  The endpoint initialization currently depends on
link order.

This 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.

Fixes: 6e0832f ("PCI: Collect all native drivers under drivers/pci/controller/")
Signed-off-by: Alan Douglas <adouglas@cadence.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Alan Douglas authored and Bjorn Helgaas committed Jun 26, 2018
1 parent 6f6f424 commit 68bb22e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 68bb22e

Please sign in to comment.