Patch "powerpc/powernv: Fix stale PE primary bus" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
powerpc/powernv: Fix stale PE primary bus
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
powerpc-powernv-fix-stale-pe-primary-bus.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
1bc74f1ccd457832dc515fc1febe6655985fdcd2Mon Sep 17 00:00:00 2001
From: Gavin Shan <[email protected]>
Date: Tue, 9 Feb 2016 15:50:22 +1100
Subject: powerpc/powernv: Fix stale PE primary bus
From: Gavin Shan <[email protected]>
commit 1bc74f1ccd457832dc515fc1febe6655985fdcd2 upstream.
When PCI bus is unplugged during full hotplug for EEH recovery, the platform PE instance (struct pnv_ioda_pe) isn't released and it dereferences the stale PCI bus that has been released. It leads to kernel crash when referring to the stale PCI bus.
This fixes the issue by correcting the PE's primary bus when it's oneline at plugging time, in pnv_pci_dma_bus_setup() which is to be called by pcibios_fixup_bus().
--- arch/powerpc/platforms/powernv/pci-ioda.c | 1 + arch/powerpc/platforms/powernv/pci.c | 20 ++++++++++++++++++++ arch/powerpc/platforms/powernv/pci.h | 1 + 3 files changed, 22 insertions(+)
arch/powerpc/platforms/powernv/pci-ioda.c +1 -0
@@ -3034,6 +3034,7 @@ static void pnv_pci_ioda_shutdown(structstatic const struct pci_controller_ops pnv_pci_ioda_controller_ops = { .dma_dev_setup = pnv_pci_dma_dev_setup, + .dma_bus_setup = pnv_pci_dma_bus_setup, #ifdef CONFIG_PCI_MSI .setup_msi_irqs = pnv_setup_msi_irqs, .teardown_msi_irqs = pnv_teardown_msi_irqs,
arch/powerpc/platforms/powernv/pci.c +20 -0
@@ -762,6 +762,26 @@ void pnv_pci_dma_dev_setup(struct pci_de phb->dma_dev_setup (phb, pdev); } +void pnv_pci_dma_bus_setup (struct pci_bus *bus) +{ +struct pci_controller *hose = bus->sysdata; +struct pnv_phb *phb = hose->private_data; +struct pnv_ioda_pe *pe; + +list_for_each_entry (pe, &phb->ioda.pe_list, list) { +if (!(pe->flags & (PNV_IODA_PE_BUS |PNV_IODA_PE_BUS_ALL ))) +continue ; + +if (!pe->pbus) +continue ; + +if (bus->number == ((pe->rid >>8 ) &0xFF )) { + pe->pbus = bus; +break ; + } + } +} +void pnv_pci_shutdown (void ) {struct pci_controller *hose;
arch/powerpc/platforms/powernv/pci.h +1 -0
@@ -235,6 +235,7 @@ extern void pnv_pci_reset_secondary_bus(extern int pnv_eeh_phb_reset (struct pci_controller *hose,int option);extern void pnv_pci_dma_dev_setup (struct pci_dev *pdev); +extern void pnv_pci_dma_bus_setup (struct pci_bus *bus);extern int pnv_setup_msi_irqs (struct pci_dev *pdev,int nvec,int type);extern void pnv_teardown_msi_irqs (struct pci_dev *pdev);
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/powerpc-eeh-fix-pe-location-code.patch queue-4.4/powerpc-eeh-fix-stale-cached-primary-bus.patch queue-4.4/powerpc-powernv-fix-stale-pe-primary-bus.patch