Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Narayana Murty N <nnmlinux@linux.ibm.com>
To: Madhavan Srinivasan <maddy@linux.ibm.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Thomas Gleixner <tglx@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <chleroy@kernel.org>,
	Ritesh Harjani <ritesh.list@gmail.com>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	Radu Rendec <radu@rendec.net>,
	sbhat@linux.ibm.com, harshpb@linux.ibm.com, gautam@linux.ibm.com,
	Nam Cao <namcao@linutronix.de>,
	Nilay Shroff <nilay@linux.ibm.com>,
	Vivian Wang <wangruikang@iscas.ac.cn>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Farhan Ali <alifm@linux.ibm.com>,
	Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
	Yuanhe Shu <xiangzao@linux.alibaba.com>,
	Vidya Sagar <vidyas@nvidia.com>, Hans Zhang <18255117159@163.com>,
	Miles Krause <mileskrause5200@gmail.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/2] PCI/MSI: Allow opt-in domain teardown for pSeries RTAS
Date: Fri,  4 Dec 2026 22:11:42 +0530	[thread overview]
Message-ID: <20261204164141.20530-4-nnmlinux@linux.ibm.com> (raw)

PCI per-device MSI domains normally remain in place after their
MSI/MSI-X vectors are freed. This allows a later allocation to reuse
the domain, but can leave firmware-managed MSI state out of sync with
the device when the vectors are disabled and re-enabled across a reset
or reconfiguration.

Commit daaa574aba6f ("powerpc/pseries/msi: Switch to
msi_create_parent_irq_domain()") moved pSeries RTAS MSI release from
the legacy msi_post_free() callback to the per-device domain's
msi_ops->msi_teardown() callback. Freeing the vectors does not normally
destroy that domain. Consequently, neither the firmware teardown nor a
subsequent msi_ops->msi_prepare() is guaranteed to run across complete
vector disable/re-enable cycles while the device remains present.

This series adds a PCI-specific, opt-in domain teardown policy and
enables it for pSeries. For providers that request it, the domain is
removed after normal MSI/MSI-X disable and on terminal allocation
failure, so subsequent allocation creates a new domain and re-runs
firmware preparation. The domain is retained during internal retry with
fewer vectors attempts. Providers that do not opt in retain the
existing behavior.

The issue was investigated while debugging missing MSI-X delivery,
NVMe timeouts and subsequent EEH recovery in a pSeries guest with
a physical NVMe device assigned through VFIO. With the series applied,
testing on Linux 7.4.0-rc5+ in QEMU/KVM pSeries using direct KVM MSI-X
completed NVMe initialization and an XFS filesystem mount. The QEMU
MSI-X shadow changes used during these tests were held in the test
configuration; the result should not be interpreted as an isolated
kernel-only A/B comparison.

The first patch provides the opt-in PCI/MSI infrastructure. The second
selects it for pSeries to match the RTAS resource lifetime to the MSI
vector lifetime.


Narayana Murty N (2):
  PCI/MSI: Allow opt-in teardown of per-device MSI domains
  powerpc/pseries/msi: Release RTAS MSI state on vector disable

 arch/powerpc/platforms/pseries/msi.c |  3 +-
 drivers/pci/msi/api.c                |  2 ++
 drivers/pci/msi/irqdomain.c          |  7 +++++
 drivers/pci/msi/msi.c                | 36 ++++++++++++++++-------
 drivers/pci/msi/msi.h                |  1 +
 include/linux/msi.h                  |  4 +++
 kernel/irq/msi.c                     | 43 ++++++++++++++++++++++++++--
 7 files changed, 82 insertions(+), 14 deletions(-)

-- 
2.54.0


             reply	other threads:[~2026-12-04 16:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 16:41 Narayana Murty N [this message]
2026-12-04 16:41 ` [PATCH 1/2] PCI/MSI: Allow opt-in teardown of per-device MSI domains Narayana Murty N
2026-12-04 17:01   ` sashiko-bot
2026-12-04 16:41 ` [PATCH 2/2] powerpc/pseries/msi: Release RTAS MSI state on vector disable Narayana Murty N
2026-12-04 17:11 ` [PATCH 0/2] PCI/MSI: Allow opt-in domain teardown for pSeries RTAS sashiko-bot

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=20261204164141.20530-4-nnmlinux@linux.ibm.com \
    --to=nnmlinux@linux.ibm.com \
    --cc=18255117159@163.com \
    --cc=alifm@linux.ibm.com \
    --cc=bhelgaas@google.com \
    --cc=chleroy@kernel.org \
    --cc=gautam@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=jic23@kernel.org \
    --cc=lihaoxiang@isrc.iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lpieralisi@kernel.org \
    --cc=maddy@linux.ibm.com \
    --cc=mileskrause5200@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=namcao@linutronix.de \
    --cc=nilay@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=radu@rendec.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rdunlap@infradead.org \
    --cc=ritesh.list@gmail.com \
    --cc=sbhat@linux.ibm.com \
    --cc=shawn.lin@rock-chips.com \
    --cc=sshegde@linux.ibm.com \
    --cc=tglx@kernel.org \
    --cc=vidyas@nvidia.com \
    --cc=wangruikang@iscas.ac.cn \
    --cc=xiangzao@linux.alibaba.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