From: Farhan Ali <alifm@linux.ibm.com>
To: Niklas Schnelle <schnelle@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Cc: helgaas@kernel.org, alex@shazbot.org, mjrosato@linux.ibm.com
Subject: Re: [PATCH v16 4/7] s390/pci: Store PCI error information for passthrough devices
Date: Mon, 18 May 2026 09:56:29 -0700 [thread overview]
Message-ID: <57cb4b55-1305-4936-bf17-1c57532bea0a@linux.ibm.com> (raw)
In-Reply-To: <388849fec888031cfbbe227c587a92521243e83e.camel@linux.ibm.com>
On 5/18/2026 3:07 AM, Niklas Schnelle wrote:
> On Thu, 2026-05-14 at 11:00 -0700, Farhan Ali wrote:
>> For a passthrough device we need co-operation from user space to recover
>> the device. This would require to bubble up any error information to user
>> space. Let's store this error information for passthrough devices, so it
>> can be retrieved later.
>>
>> We can now have userspace drivers (vfio-pci based) on s390x. The userspace
>> drivers will not have any KVM fd and so no kzdev associated with them. So
>> we need to update the logic for detecting passthrough devices to not depend
>> on struct kvm_zdev.
>>
>> Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
>> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
>> ---
>> arch/s390/include/asm/pci.h | 30 ++++++++
>> arch/s390/pci/pci.c | 1 +
>> arch/s390/pci/pci_event.c | 114 +++++++++++++++++--------------
>> drivers/vfio/pci/vfio_pci_zdev.c | 18 ++++-
>> 4 files changed, 109 insertions(+), 54 deletions(-)
>>
> --- snip ---
>> @@ -216,12 +223,23 @@ static pci_ers_result_t zpci_event_attempt_error_recovery(struct pci_dev *pdev)
>> goto out_unlock;
>> }
>>
>> + mediated_recovery = zpci_store_pci_error(pdev, ccdf) == 0 ? true : false;
>> +
> This incorrectly treats it as not-mediated recovery when the queue runs
> full and zpci_store_pci_error() returns -ENOMEM (Sashiko also noticed
> this though the explanation is a bit hard to read).
Yes, will fix in next revision.
>
>> ers_res = zpci_event_notify_error_detected(pdev, driver);
>> if (ers_result_indicates_abort(ers_res)) {
>> status_str = "failed (abort on detection)";
>> goto out_unlock;
>> }
>>
>> + if (mediated_recovery) {
>> + pr_info("%s: Leaving recovery of pass-through device to user-space\n",
>> + pci_name(pdev));
>> + ers_res = PCI_ERS_RESULT_RECOVERED;
>> + status_str = "in progress";
>> + mutex_unlock(&zdev->pending_errs_lock);
> The unlock here seems like a bad leftover from the previous code.
> You're not holding that lock here. (Also found by Sashiko).
Ugh yes, left this from last version. Will fix.
Thanks
Farhan
>
>> + goto out_unlock;
>> + }
>> +
> --- snip ---
next prev parent reply other threads:[~2026-05-18 16:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 18:00 [PATCH v16 0/7] Error recovery for vfio-pci devices on s390x Farhan Ali
2026-05-14 18:00 ` [PATCH v16 1/7] PCI: Allow per function PCI slots to fix slot reset on s390 Farhan Ali
2026-05-14 21:36 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 2/7] PCI: Avoid saving config space state if inaccessible Farhan Ali
2026-05-14 22:08 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 3/7] PCI: Fail FLR when config space is inaccessible Farhan Ali
2026-05-14 22:41 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 4/7] s390/pci: Store PCI error information for passthrough devices Farhan Ali
2026-05-14 22:53 ` sashiko-bot
2026-05-18 10:07 ` Niklas Schnelle
2026-05-18 16:56 ` Farhan Ali [this message]
2026-05-14 18:00 ` [PATCH v16 5/7] vfio-pci/zdev: Add a device feature for error information Farhan Ali
2026-05-14 23:27 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 6/7] vfio/pci: Add a reset_done callback for vfio-pci driver Farhan Ali
2026-05-14 23:54 ` sashiko-bot
2026-05-14 18:00 ` [PATCH v16 7/7] vfio/pci: Remove the pcie check for VFIO_PCI_ERR_IRQ_INDEX Farhan Ali
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=57cb4b55-1305-4936-bf17-1c57532bea0a@linux.ibm.com \
--to=alifm@linux.ibm.com \
--cc=alex@shazbot.org \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=schnelle@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 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 read-only IMAP folder(s) and NNTP newsgroup(s).