From: Bjorn Helgaas <helgaas@kernel.org>
To: Niklas Schnelle <schnelle@linux.ibm.com>
Cc: Farhan Ali <alifm@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org, alex@shazbot.org,
mjrosato@linux.ibm.com, stable@vger.kernel.org
Subject: Re: [PATCH v23 2/5] PCI: Allow per function PCI slots to fix slot reset on s390
Date: Fri, 14 Aug 2026 08:26:07 -0500 [thread overview]
Message-ID: <20260814132607.GA1353174@bhelgaas> (raw)
In-Reply-To: <c89ca6f9d0a996ab75c47cb62c57c50635a700bc.camel@linux.ibm.com>
On Fri, Aug 14, 2026 at 10:46:28AM +0200, Niklas Schnelle wrote:
> On Thu, 2026-08-13 at 18:25 -0500, Bjorn Helgaas wrote:
> > On Wed, Aug 05, 2026 at 09:55:15AM -0700, Farhan Ali wrote:
> > > On s390 systems, which use a machine level hypervisor, PCI devices are
> > > always accessed through a form of PCI pass-through which fundamentally
> > > operates on a per PCI function granularity. This is also reflected in the
> > > s390 PCI hotplug driver which creates hotplug slots for individual PCI
> > > functions. Its reset_slot() function, which is a wrapper for
> > > zpci_hot_reset_device(), thus also resets individual functions.
> >
> > Sorry to come back to this yet again. I understand the issue with
> > the wrong pci_slot being assigned for these s390 functions.
> >
> > What I don't understand is why we would use slot_reset() in the first
> > place. I would expect FLR instead.
> >
> > The hotplug slot_reset() path is used by pci_reset_bus_function().
> > But given the order in pci_reset_fn_methods[], we would typically try
> > pcie_reset_flr() first, and we would only get to
> > pci_reset_bus_function() if FLR and the other resets are not
> > available.
> >
> > Since these are actually multi-function devices, I'm surprised that
> > they wouldn't advertise FLR support.
>
> Good question. The problem isn't that FLR isn't advertised or
> unsupported. Rather we end up needing to use the slot reset when the
> platform has put the PCI function in the architected error state which
> blocks both MMIO and DMA similar to DPC and which we can only get out
> of with the platform specific CLP Set PCI Function Disable/Enable
> hypercalls. FLR still works if you have a function that wasn't put in
> the error state but for most real world errors as well as some service
> scenarios we do end up in the error state where a FLR won't work.
I assume these are standard PCIe devices, but this architected error
state doesn't sound like something from the PCIe spec.
DPC works by disabling the link, but of course that blocks traffic to
all the functions of an MFD, so maybe this is some s390-specific thing
outside the endpoint, e.g., something in a Downstream Port that can
selectively block traffic to/from a specific function?
To get to pci_reset_bus_function() where we can use the slot reset, I
think all the previous methods, including pcie_reset_flr(), must have
failed with -ENOTTY. But I don't see a place that would do that.
Maybe you remove the other methods from dev->reset_methods[]?
In addition to whatever the CLP Set PCI Function Disable/Enable
hypercall does to unblock traffic to/from the endpoint, I suppose it
does an FLR internally? It must use some standard PCIe mechanism
because the endpoint doesn't know anything about s390 or the
hypervisor.
I wonder if we should make some kind of direct platform-specific reset
method, or maybe a pcibios_*()-style hook in the pcie_reset_flr() path
instead of this somewhat convoluted pci_slot stuff. But
s390_pci_hpc.c is pretty simple and maybe it's used for things other
than reset.
Bjorn
next prev parent reply other threads:[~2026-08-14 13:26 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 16:55 [PATCH v23 0/5] [PCI] Error recovery for vfio-pci devices on s390x Farhan Ali
2026-08-05 16:55 ` [PATCH v23 1/5] PCI: Introduce PCI_SLOT_PLACEHOLDER constant for slot_nr placeholder value Farhan Ali
2026-08-05 16:55 ` [PATCH v23 2/5] PCI: Allow per function PCI slots to fix slot reset on s390 Farhan Ali
2026-08-13 23:25 ` Bjorn Helgaas
2026-08-14 8:46 ` Niklas Schnelle
2026-08-14 13:26 ` Bjorn Helgaas [this message]
2026-08-14 15:15 ` Niklas Schnelle
2026-08-05 16:55 ` [PATCH v23 3/5] PCI: Avoid saving config space state if inaccessible Farhan Ali
2026-08-05 16:55 ` [PATCH v23 4/5] PCI: Fail FLR when config space is inaccessible Farhan Ali
2026-08-12 22:34 ` Bjorn Helgaas
2026-08-12 22:45 ` Farhan Ali
2026-08-05 16:55 ` [PATCH v23 5/5] PCI/MSI: Enable memory decoding before restoring MSI-X messages Farhan Ali
2026-08-12 22:07 ` Bjorn Helgaas
2026-08-12 22:35 ` Farhan Ali
2026-08-12 18:53 ` [PATCH v23 0/5] [PCI] Error recovery for vfio-pci devices on s390x Farhan Ali
2026-08-12 22:37 ` Bjorn Helgaas
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=20260814132607.GA1353174@bhelgaas \
--to=helgaas@kernel.org \
--cc=alex@shazbot.org \
--cc=alifm@linux.ibm.com \
--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 \
--cc=stable@vger.kernel.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
all inboxes | Powered by JetHome®