From: Gavin Shan <gwshan@linux.vnet.ibm.com>
To: Wei Yang <weiyang@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, gwshan@linux.vnet.ibm.com
Subject: Re: [PATCH] powerpc/eeh: Fix kernel crash when passing through VF
Date: Tue, 16 Sep 2014 17:14:26 +1000 [thread overview]
Message-ID: <20140916071426.GA28267@shangw> (raw)
In-Reply-To: <20140916060218.GA20909@richard>
On Tue, Sep 16, 2014 at 02:02:18PM +0800, Wei Yang wrote:
>On Tue, Sep 16, 2014 at 02:03:56PM +1000, Michael Ellerman wrote:
>>On Mon, 2014-09-15 at 16:08 +0800, Wei Yang wrote:
>>> This patch introduces a marco to convert eeh_dev to eeh_pe. By doing so, it
>>> will prevent converting with NULL pointer.
>>>
>>> Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>
>>> Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>>
>>> V2 -> V3:
>>> 1. rebased on 3.17-rc4
>>> 2. introduce a marco
>>> 3. use this marco in several other places
>>
>>Macro :)
>
>:-)
>
>>
>>> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
>>> index 59a64f8..0f1b637 100644
>>> --- a/arch/powerpc/kernel/eeh.c
>>> +++ b/arch/powerpc/kernel/eeh.c
>>> @@ -410,7 +410,7 @@ int eeh_dev_check_failure(struct eeh_dev *edev)
>>> }
>>> dn = eeh_dev_to_of_node(edev);
>>> dev = eeh_dev_to_pci_dev(edev);
>>> - pe = edev->pe;
>>> + pe = eeh_dev_to_pe(edev);
>>
>>This looks good, but ..
>>
>>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>>> index fd03e819..9656f92 100644
>>> --- a/include/linux/pci.h
>>> +++ b/include/linux/pci.h
>>> @@ -1824,6 +1824,11 @@ static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev)
>>> {
>>> return pdev->dev.archdata.edev;
>>> }
>>> +
>>> +static inline struct eeh_pe *eeh_dev_to_pe(struct eeh_dev* edev)
>>> +{
>>> + return edev ? edev->pe : NULL;
>>> +}
>>> #endif
>>
>>Why is it in linux/pci.h ? It's powerpc specific, it should be in arch/powerpc/include/asm/pci.h
>>
>
>Good question, let me move to powerpc directory and have a try.
>
It would be part of arch/powerpc/include/asm/eeh.h :-)
Thanks,
Gavin
>>cheers
>>
>
>--
>Richard Yang
>Help you, Help me
next prev parent reply other threads:[~2014-09-16 7:14 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
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 [this message]
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=20140916071426.GA28267@shangw \
--to=gwshan@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--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).