Re: [PATCH v2 2/4] powerpc/powernv: Fix stale PE primary bus
From: Gavin Shan <hidden>
Date: 2016-02-15 22:45:01
On Mon, Feb 15, 2016 at 09:38:35PM +1100, Michael Ellerman wrote:
On Fri, 2016-02-12 at 17:09 +1100, Gavin Shan wrote:quoted
On Fri, Feb 12, 2016 at 05:02:46PM +1100, Andrew Donnellan wrote:quoted
quoted
On 09/02/16 15:50, Gavin Shan wrote:quoted
quoted
quoted
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(). Reported-by: Andrew Donnellan <redacted> Reported-by: Pradipta Ghosh <redacted> Signed-off-by: Gavin Shan <redacted> Tested-by: Andrew Donnellan <redacted>I realise this has already been merged, but the following was found by Coverity:quoted
quoted
quoted
+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;This condition is always false. I think the first "|" is supposed to be "&".Yeah, that should be "&". I think the problem isn't found when doing testing in non-SRIOV environment. Thanks for pointing it out. Michael, please let me know if I need send a follow-up revision to correct this one? I found the first two patches have been put into linux-next branch. I think we probably just need repost the correct version for this one only.As it happens I needed to rebase my fixes branch anyway, so I've updated it and rebased. No further action required :)
Thanks Michael. Sorry for the rebase :-) Thanks, Gavin