linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
To: Gavin Shan <gwshan@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au
Subject: Re: [PATCH v2 2/4] powerpc/powernv: Fix stale PE primary bus
Date: Fri, 12 Feb 2016 17:02:46 +1100	[thread overview]
Message-ID: <56BD7586.7060803@au1.ibm.com> (raw)
In-Reply-To: <1454993431-17068-2-git-send-email-gwshan@linux.vnet.ibm.com>

On 09/02/16 15:50, Gavin Shan wrote:
> 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 <andrew.donnellan@au1.ibm.com>
> Reported-by: Pradipta Ghosh <pradghos@in.ibm.com>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
> Tested-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

I realise this has already been merged, but the following was found by 
Coverity:

> +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 "&".

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan@au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited

  reply	other threads:[~2016-02-12  6:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09  4:50 [PATCH v2 1/4] powerpc/eeh: Fix stale cached primary bus Gavin Shan
2016-02-09  4:50 ` [PATCH v2 2/4] powerpc/powernv: Fix stale PE " Gavin Shan
2016-02-12  6:02   ` Andrew Donnellan [this message]
2016-02-12  6:09     ` Gavin Shan
2016-02-15 10:38       ` Michael Ellerman
2016-02-15 22:43         ` Gavin Shan
2016-02-09  4:50 ` [PATCH v2 3/4] powerpc/eeh: Reworked eeh_pe_bus_get() Gavin Shan
2016-03-09 12:51   ` [v2,3/4] " Michael Ellerman
2016-02-09  4:50 ` [PATCH v2 4/4] powerpc/powernv: Simplify definitions of EEH debugfs handlers Gavin Shan
2016-02-17 12:41   ` [v2, " Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56BD7586.7060803@au1.ibm.com \
    --to=andrew.donnellan@au1.ibm.com \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).