From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>,
Narayana Murty N <nnmlinux@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au,
linux-kernel@vger.kernel.org, mahesh@linux.ibm.com,
oohall@gmail.com, npiggin@gmail.com, christophe.leroy@csgroup.eu,
naveen@kernel.org, vaibhav@linux.ibm.com, ganeshgr@linux.ibm.com,
sbhat@linux.ibm.com
Subject: Re: [PATCH v3] powerpc/pseries/eeh: Fix pseries_eeh_err_inject
Date: Tue, 24 Sep 2024 08:23:18 +0530 [thread overview]
Message-ID: <87a5fxbw4h.fsf@gmail.com> (raw)
In-Reply-To: <c474f56f-af74-479d-9db6-fbbfdb287604@roeck-us.net>
Guenter Roeck <linux@roeck-us.net> writes:
> Hi,
>
> On Mon, Sep 09, 2024 at 09:02:20AM -0500, Narayana Murty N wrote:
>> VFIO_EEH_PE_INJECT_ERR ioctl is currently failing on pseries
>> due to missing implementation of err_inject eeh_ops for pseries.
>> This patch implements pseries_eeh_err_inject in eeh_ops/pseries
>> eeh_ops. Implements support for injecting MMIO load/store error
>> for testing from user space.
>>
>> The check on PCI error type (bus type) code is moved to platform
>> code, since the eeh_pe_inject_err can be allowed to more error
>> types depending on platform requirement. Removal of the check for
>> 'type' in eeh_pe_inject_err() doesn't impact PowerNV as
>> pnv_eeh_err_inject() already has an equivalent check in place.
>>
>> Signed-off-by: Narayana Murty N <nnmlinux@linux.ibm.com>
>> Reviewed-by: Vaibhav Jain <vaibhav@linux.ibm.com>
>>
>> ---
>> arch/powerpc/include/asm/eeh.h | 2 +-
>> arch/powerpc/kernel/eeh.c | 9 +++--
>> arch/powerpc/platforms/pseries/eeh_pseries.c | 39 +++++++++++++++++++-
>> 3 files changed, 44 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h
>> index 91a9fd53254f..317b12fc1fe4 100644
>> --- a/arch/powerpc/include/asm/eeh.h
>> +++ b/arch/powerpc/include/asm/eeh.h
>> @@ -308,7 +308,7 @@ int eeh_pe_reset(struct eeh_pe *pe, int option, bool include_passed);
>> int eeh_pe_configure(struct eeh_pe *pe);
>> int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
>> unsigned long addr, unsigned long mask);
>> -
>> +int eeh_pe_inject_mmio_error(struct pci_dev *pdev);
>> /**
>> * EEH_POSSIBLE_ERROR() -- test for possible MMIO failure.
>> *
>> diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c
>> index d03f17987fca..49ab11a287a3 100644
>> --- a/arch/powerpc/kernel/eeh.c
>> +++ b/arch/powerpc/kernel/eeh.c
>> @@ -1537,10 +1537,6 @@ int eeh_pe_inject_err(struct eeh_pe *pe, int type, int func,
>> if (!eeh_ops || !eeh_ops->err_inject)
>> return -ENOENT;
>>
>> - /* Check on PCI error type */
>> - if (type != EEH_ERR_TYPE_32 && type != EEH_ERR_TYPE_64)
>> - return -EINVAL;
>> -
>> /* Check on PCI error function */
>> if (func < EEH_ERR_FUNC_MIN || func > EEH_ERR_FUNC_MAX)
>> return -EINVAL;
>> @@ -1851,6 +1847,11 @@ static const struct file_operations eeh_dev_break_fops = {
>> .read = eeh_debugfs_dev_usage,
>> };
>>
>> +int eeh_pe_inject_mmio_error(struct pci_dev *pdev)
>> +{
>> + return eeh_debugfs_break_device(pdev);
>> +}
>> +
>
> The new function, as the context suggests, is only compiled if CONFIG_DEBUG_FS=y.
> However, it is called unconditionally. With CONFIG_DEBUG_FS=n, this results in
>
> powerpc64-linux-ld: arch/powerpc/platforms/pseries/eeh_pseries.o: in function `pseries_eeh_err_inject':
> /opt/buildbot/slave/qemu-ppc64/build/arch/powerpc/platforms/pseries/eeh_pseries.c:814:(.text+0x554): undefined reference to `eeh_pe_inject_mmio_error'
> make[3]: *** [/opt/buildbot/slave/qemu-ppc64/build/scripts/Makefile.vmlinux:34: vmlinux] Error 1
> make[2]: *** [/opt/buildbot/slave/qemu-ppc64/build/Makefile:1157: vmlinux] Error 2
>
> I'll enable CONFIG_DEBUG_FS in my tests and won't report this further,
> but you might want to consider fixing the problem at some point.
>
Yes, this is fixed and picked up in powerpc tree.
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?h=merge&id=3af2e2f68cc6baf0a11f662d30b0bf981f77bfea
-ritesh
prev parent reply other threads:[~2024-09-24 2:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 14:02 [PATCH v3] powerpc/pseries/eeh: Fix pseries_eeh_err_inject Narayana Murty N
2024-09-12 12:00 ` Michael Ellerman
2024-09-23 12:57 ` Guenter Roeck
2024-09-24 2:53 ` Ritesh Harjani [this message]
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=87a5fxbw4h.fsf@gmail.com \
--to=ritesh.list@gmail.com \
--cc=christophe.leroy@csgroup.eu \
--cc=ganeshgr@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=nnmlinux@linux.ibm.com \
--cc=npiggin@gmail.com \
--cc=oohall@gmail.com \
--cc=sbhat@linux.ibm.com \
--cc=vaibhav@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.