linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Wei Yang <weiyang@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, gwshan@linux.vnet.ibm.com
Subject: Re: [PATCH V2] powerpc/eeh: Fix kernel crash when passing through VF
Date: Fri, 12 Sep 2014 15:05:18 +1000	[thread overview]
Message-ID: <20140912050518.GA17933@shangw> (raw)
In-Reply-To: <1410494123.17540.2.camel@concordia>

On Fri, Sep 12, 2014 at 01:55:23PM +1000, Michael Ellerman wrote:
>On Thu, 2014-09-11 at 11:42 +0800, Wei Yang wrote:
>> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
>> index 4a45ba8..403445e 100644
>> --- a/arch/powerpc/kernel/eeh.c
>> +++ b/arch/powerpc/kernel/eeh.c
>> @@ -625,7 +625,7 @@ int eeh_pci_enable(struct eeh_pe *pe, int function)
>>  int pcibios_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state)
>>  {
>>  	struct eeh_dev *edev = pci_dev_to_eeh_dev(dev);
>> -	struct eeh_pe *pe = edev->pe;
>> +	struct eeh_pe *pe = edev ? edev->pe : NULL;
>>  
>>  	if (!pe) {
>>  		pr_err("%s: No PE found on PCI device %s\n",
>
>
>We seem to do this or something similar in a few places. Is it worth having a
>pci_dev_to_eeh_pe() inline?
>

Yes, maybe we just need a eeh_dev_to_pe() because converting
pci_dev to eeh_dev is already coverred by pci_dev_to_eeh_dev().

With eeh_dev_to_pe(), it looks like this:

struct pci_dev *pdev;
struct eeh_dev *edev = pci_dev_to_eeh_dev(pdev);
struct eeh_pe *pe = eeh_dev_to_pe(edev);

Or another case:

struct device_node *dn;
struct eeh_dev *edev = of_node_to_eeh_dev(dn);
struct eeh_pe *pe = eeh_dev_to_pe(edev);

Thanks,
Gavin

>cheers
>
>

  reply	other threads:[~2014-09-12  5:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-11  3:42 [PATCH V2] powerpc/eeh: Fix kernel crash when passing through VF Wei Yang
2014-09-12  3:55 ` Michael Ellerman
2014-09-12  5:05   ` Gavin Shan [this message]
2014-09-12  9:35     ` Wei Yang
2014-09-14  1:19       ` Gavin Shan
2014-09-15  2:49     ` Michael Ellerman
2014-09-15  8:08 ` [PATCH] " Wei Yang
2014-09-16  4:03   ` Michael Ellerman
2014-09-16  6:02     ` Wei Yang
2014-09-16  7:14       ` Gavin Shan
2014-09-17  2:48   ` [PATCH V4] " Wei Yang

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=20140912050518.GA17933@shangw \
    --to=gwshan@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=weiyang@linux.vnet.ibm.com \
    /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).