From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>,
mpe@ellerman.id.au, gwshan@linux.vnet.ibm.com,
linuxppc-dev@lists.ozlabs.org
Cc: paulus@samba.org
Subject: Re: [PATCH] powerpc/eeh: Validate arch in eeh_add_device_early()
Date: Wed, 13 Jan 2016 17:04:40 +1100 [thread overview]
Message-ID: <1452665080.2403.21.camel@kernel.crashing.org> (raw)
In-Reply-To: <1452395295-1759-1-git-send-email-gpiccoli@linux.vnet.ibm.com>
On Sun, 2016-01-10 at 01:08 -0200, Guilherme G. Piccoli wrote:weust changes the way the arch checking is done in function
>
> This patch jeeh_add_device_early(): we use no more eeh_enabled(), but instead we check therunning architecture by using the macro machine_is(). If we are running on
> pSeries or PowerNV, the EEH mechanism can be enabled; otherwise, we bail out
> the function. This way, we don't enable EEH on Cell and we don't hit the oops
> on DLPAR either.
Can't we just check for eeh_ops being NULL ?
Cheers,
Ben.
> Fixes: 89a51df5ab1d ("powerpc/eeh: Fix crash in eeh_add_device_early() on Cell")
> Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
> ---
> arch/powerpc/kernel/eeh.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
> index 40e4d4a..81e2d3e 100644
> --- a/arch/powerpc/kernel/eeh.c
> +++ b/arch/powerpc/kernel/eeh.c
> @@ -1072,7 +1072,13 @@ void eeh_add_device_early(struct pci_dn *pdn)
> struct pci_controller *phb;
> struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
>
> - if (!edev || !eeh_enabled())
> + if (!edev)
> + return;
> +
> + /* Some platforms (like Cell) don't have EEH capabilities, so we
> + * need to abort here. In case of pseries or powernv, we have EEH
> + * so we can continue. */
> + if (!machine_is(pseries) && !machine_is(powernv))
> return;
>
> if (!eeh_has_flag(EEH_PROBE_MODE_DEVTREE))
next prev parent reply other threads:[~2016-01-13 6:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-10 3:08 [PATCH] powerpc/eeh: Validate arch in eeh_add_device_early() Guilherme G. Piccoli
2016-01-13 6:04 ` Benjamin Herrenschmidt [this message]
2016-01-13 11:56 ` Guilherme G. Piccoli
2016-01-13 10:38 ` Michael Ellerman
2016-01-13 12:08 ` Guilherme G. Piccoli
2016-01-13 21:25 ` Michael Ellerman
2016-01-14 19:59 ` Guilherme G. Piccoli
2016-01-14 23:37 ` Michael Ellerman
2016-01-19 20:11 ` Guilherme G. Piccoli
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=1452665080.2403.21.camel@kernel.crashing.org \
--to=benh@kernel.crashing.org \
--cc=gpiccoli@linux.vnet.ibm.com \
--cc=gwshan@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/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).