From: Greg Kroah-Hartman Date: Fri, 23 Sep 2016 15:12:07 +0000 (+0200) Subject: delete cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch X-Git-Tag: v4.4.22~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28e7fab059beb0f3fce0ba4cb7726060f7ec8375;p=thirdparty%2Fkernel%2Fstable-queue.git delete cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch It breaks the build --- diff --git a/queue-4.4/cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch b/queue-4.4/cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch deleted file mode 100644 index ca76e56c145..00000000000 --- a/queue-4.4/cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 6f38a8b9a45833495dc878c335c5431cd98a16ed Mon Sep 17 00:00:00 2001 -From: Andrew Donnellan -Date: Thu, 18 Aug 2016 17:35:14 +1000 -Subject: cxl: use pcibios_free_controller_deferred() when removing vPHBs - -From: Andrew Donnellan - -commit 6f38a8b9a45833495dc878c335c5431cd98a16ed upstream. - -When cxl removes a vPHB, it's possible that the pci_controller may be freed -before all references to the devices on the vPHB have been released. This -in turn causes an invalid memory access when the devices are eventually -released, as pcibios_release_device() attempts to call the phb's -release_device hook. - -In cxl_pci_vphb_remove(), remove the existing call to -pcibios_free_controller(). Instead, use -pcibios_free_controller_deferred() to free the pci_controller after all -devices have been released. Export pci_set_host_bridge_release() so we can -do this. - -Signed-off-by: Andrew Donnellan -Reviewed-by: Matthew R. Ochs -Acked-by: Ian Munsie -Signed-off-by: Benjamin Herrenschmidt -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/misc/cxl/vphb.c | 10 +++++++++- - drivers/pci/host-bridge.c | 1 + - 2 files changed, 10 insertions(+), 1 deletion(-) - ---- a/drivers/misc/cxl/vphb.c -+++ b/drivers/misc/cxl/vphb.c -@@ -258,6 +258,11 @@ int cxl_pci_vphb_add(struct cxl_afu *afu - if (phb->bus == NULL) - return -ENXIO; - -+ /* Set release hook on root bus */ -+ pci_set_host_bridge_release(to_pci_host_bridge(phb->bus->bridge), -+ pcibios_free_controller_deferred, -+ (void *) phb); -+ - /* Claim resources. This might need some rework as well depending - * whether we are doing probe-only or not, like assigning unassigned - * resources etc... -@@ -293,7 +298,10 @@ void cxl_pci_vphb_remove(struct cxl_afu - afu->phb = NULL; - - pci_remove_root_bus(phb->bus); -- pcibios_free_controller(phb); -+ /* -+ * We don't free phb here - that's handled by -+ * pcibios_free_controller_deferred() -+ */ - } - - struct cxl_afu *cxl_pci_to_afu(struct pci_dev *dev) ---- a/drivers/pci/host-bridge.c -+++ b/drivers/pci/host-bridge.c -@@ -44,6 +44,7 @@ void pci_set_host_bridge_release(struct - bridge->release_fn = release_fn; - bridge->release_data = release_data; - } -+EXPORT_SYMBOL_GPL(pci_set_host_bridge_release); - - void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, - struct resource *res) diff --git a/queue-4.4/series b/queue-4.4/series index 043dab06a67..578ad64a174 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -43,7 +43,6 @@ usb-renesas_usbhs-fix-clearing-the-brdy-bemp-sts-condition.patch usb-chipidea-udc-fix-null-ptr-dereference-in-isr_setup_status_phase.patch arm-dts-stih410-handle-interconnect-clock-required-by-ehci-ohci-usb.patch usb-change-binterval-default-to-10-ms.patch -cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch net-thunderx-fix-oops-with-ethtool-register-dump.patch cpuset-make-sure-new-tasks-conform-to-the-current-config-of-the-cpuset.patch arm-am43xx-hwmod-fix-rstst-register-offset-for-pruss.patch diff --git a/queue-4.7/cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch b/queue-4.7/cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch deleted file mode 100644 index 9c7cdc795c1..00000000000 --- a/queue-4.7/cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 6f38a8b9a45833495dc878c335c5431cd98a16ed Mon Sep 17 00:00:00 2001 -From: Andrew Donnellan -Date: Thu, 18 Aug 2016 17:35:14 +1000 -Subject: cxl: use pcibios_free_controller_deferred() when removing vPHBs - -From: Andrew Donnellan - -commit 6f38a8b9a45833495dc878c335c5431cd98a16ed upstream. - -When cxl removes a vPHB, it's possible that the pci_controller may be freed -before all references to the devices on the vPHB have been released. This -in turn causes an invalid memory access when the devices are eventually -released, as pcibios_release_device() attempts to call the phb's -release_device hook. - -In cxl_pci_vphb_remove(), remove the existing call to -pcibios_free_controller(). Instead, use -pcibios_free_controller_deferred() to free the pci_controller after all -devices have been released. Export pci_set_host_bridge_release() so we can -do this. - -Signed-off-by: Andrew Donnellan -Reviewed-by: Matthew R. Ochs -Acked-by: Ian Munsie -Signed-off-by: Benjamin Herrenschmidt -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/misc/cxl/vphb.c | 10 +++++++++- - drivers/pci/host-bridge.c | 1 + - 2 files changed, 10 insertions(+), 1 deletion(-) - ---- a/drivers/misc/cxl/vphb.c -+++ b/drivers/misc/cxl/vphb.c -@@ -243,6 +243,11 @@ int cxl_pci_vphb_add(struct cxl_afu *afu - if (phb->bus == NULL) - return -ENXIO; - -+ /* Set release hook on root bus */ -+ pci_set_host_bridge_release(to_pci_host_bridge(phb->bus->bridge), -+ pcibios_free_controller_deferred, -+ (void *) phb); -+ - /* Claim resources. This might need some rework as well depending - * whether we are doing probe-only or not, like assigning unassigned - * resources etc... -@@ -269,7 +274,10 @@ void cxl_pci_vphb_remove(struct cxl_afu - afu->phb = NULL; - - pci_remove_root_bus(phb->bus); -- pcibios_free_controller(phb); -+ /* -+ * We don't free phb here - that's handled by -+ * pcibios_free_controller_deferred() -+ */ - } - - bool cxl_pci_is_vphb_device(struct pci_dev *dev) ---- a/drivers/pci/host-bridge.c -+++ b/drivers/pci/host-bridge.c -@@ -44,6 +44,7 @@ void pci_set_host_bridge_release(struct - bridge->release_fn = release_fn; - bridge->release_data = release_data; - } -+EXPORT_SYMBOL_GPL(pci_set_host_bridge_release); - - void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region, - struct resource *res) diff --git a/queue-4.7/series b/queue-4.7/series index 375b884c9f6..df73f263602 100644 --- a/queue-4.7/series +++ b/queue-4.7/series @@ -88,7 +88,6 @@ usb-chipidea-udc-fix-null-ptr-dereference-in-isr_setup_status_phase.patch arm-dts-stih410-handle-interconnect-clock-required-by-ehci-ohci-usb.patch usb-change-binterval-default-to-10-ms.patch devpts-return-null-pts-priv-entry-for-non-devpts-nodes.patch -cxl-use-pcibios_free_controller_deferred-when-removing-vphbs.patch net-thunderx-fix-oops-with-ethtool-register-dump.patch net-macb-correct-caps-mask.patch cpuset-make-sure-new-tasks-conform-to-the-current-config-of-the-cpuset.patch