Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Bjorn Helgaas <helgaas@kernel.org>, Farhan Ali <alifm@linux.ibm.com>
Cc: 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 10:46:28 +0200	[thread overview]
Message-ID: <c89ca6f9d0a996ab75c47cb62c57c50635a700bc.camel@linux.ibm.com> (raw)
In-Reply-To: <20260813232546.GA1281281@bhelgaas>

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.
> 


Hi Bjorn,

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.

To give an example for a service scenario because it's pretty neat. We
have up to 4 drawers of CPUs acting as a single SMP system as well as
multiple I/O cages with the PCIe cards in them. Now each I/O cage is
connected to two different PCIe root complexes on two different drawers
with only one link active. So one thing we can do is to migrate all
workload off a drawer and then swap over to the alternate root complex
with a single error event and one such zpci_hot_reset_device(). Then
with a CPU drawer evacuated you can actually replace CPUs without any
downtime beyond that reset while staying within a single machine.

Thanks,
Niklas

  reply	other threads:[~2026-08-14  8:47 UTC|newest]

Thread overview: 23+ 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 17:07   ` sashiko-bot
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-05 17:12   ` sashiko-bot
2026-08-13 23:25   ` Bjorn Helgaas
2026-08-14  8:46     ` Niklas Schnelle [this message]
2026-08-14 13:26       ` Bjorn Helgaas
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 17:05   ` sashiko-bot
2026-08-05 16:55 ` [PATCH v23 4/5] PCI: Fail FLR when config space is inaccessible Farhan Ali
2026-08-05 17:07   ` sashiko-bot
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-05 17:07   ` sashiko-bot
2026-08-12 22:09     ` Bjorn Helgaas
2026-08-12 22:22       ` 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=c89ca6f9d0a996ab75c47cb62c57c50635a700bc.camel@linux.ibm.com \
    --to=schnelle@linux.ibm.com \
    --cc=alex@shazbot.org \
    --cc=alifm@linux.ibm.com \
    --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=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