From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=148.163.158.5 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796402595; b=ypKcjhrc7su7Vh4QKY6IM792PodfGelRvCFMGKAAfG4Nj86UIshIVYlLghxepe13Z9lL T+LDl/c0egEvbES1/4UcTyH0JsUj8nMk7A0mNiMW2VPp0mZODqqQNnwHFl1seUaQ9IH9Y 8PKs9Bhla5A153u7OGCuY1FKQUP47S7fv5w40MUisiIZqNIdnCT8zyy+6L2IHtCwdy+1v II1AXsyyUcZRmjQxSrkU/6LgAcoK0m31oEX/8lz18qmdqog9+jrmvB4wnmbsgGC19sdvB 62jr8D8aN7m8c0vIsZIlTs2ZavPtzXK2KXhHo5N2QFxnoWPR5BuEBT/0Z1dB5UrAgUw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796402595; h=DMARC-Filter:Received:DKIM-Signature:Received:Received:Received: Received:Received:Received:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding: X-TM-AS-GCONF:X-Proofpoint-Reinject:X-Authority-Analysis: X-Proofpoint-Spam-Info:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; bh=xcDNYLRJCqxszHLTRd2xJuD2xBd2NL/T67+iqfjuxQw=; b=2JZSvQhg8zy4rIksJEewHINePjnzOsb3g0J1Pio6WXU+KKpC55o8pbV6lwErBUo7HzIf 6r46Ohoj7yQp+bfAGVjtuzu+zpo094qadAFQ/6pIRbaGHNCqWdlVq7kIZvOOn8+J4BuiQ 1wNrTidshbQrkubdjlvfUWz4Mr5plDEUw3dNEZQDoarJ5Dsb3p8A2D8OAceMGbhEnH/AP TAzbYC8ykZIxvCL9hBBhzrOx1N1D/0yQ3f3BBv6p7MPMPQ9bW19SqrYr1XNKkoQ6W6M+8 v7vKpYPuf+o/azcv6xFD/0NQKGvzaQQcF9bLcJ/sbzg2FkDBC+XAU+bQB6a9inb9snQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=NwF7snNF; arc=none smtp.remote-ip=148.163.158.5 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE0A3606A322; Fri, 4 Dec 2026 16:43:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AE0A3606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256 header.s=pp1 header.b=NwF7snNF Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4EYgbZ1102745; Fri, 4 Dec 2026 16:42:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=pp1; bh=xcDNYLRJCqxszHLTRd2xJuD2xBd2NL/T67+iqfjux Qw=; b=NwF7snNFEtOpYgN/r9+HDwhjOhkWRIeRzycz+1HzjaVKSjSGqUamalugv D9D18CB154nMung8Odqb1H/dAgqHaaWTrgDjWCKXiPCqpGzxWB3ddIlH+PNh5Lm9 Y1And9v9QjarLBkfzVVFjfqEIEc+53vQCCcI2JzM3q5K+T4+Xy6PfS/QbBrcMVzE xY7rZEbl9juzwfI+FioJZxTwSAkvH6zRzgiZmR2zrZm14FsKQh+mvSGQsS3Lnx0G ypvGBYbmtV/ORIEUiBkD3sUHboy+D0vN7gcjuj+Pm/PdY+RlDhmyiubmKTCTOzC+ NVJnduoepM5C2f5lnEQlz3nxJZdrg== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4jbqghtqcb-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 04 Dec 2026 16:42:24 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.11/8.18.1.11) with ESMTP id 6B4EYUYV3352587; Fri, 4 Dec 2026 16:42:24 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4jbnggjt1m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Dec 2026 16:42:24 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (smtpav04.dal12v.mail.ibm.com [10.241.53.103]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 6B4GgM9o30474814 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Dec 2026 16:42:23 GMT Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DB15658056; Fri, 4 Dec 2026 16:42:22 +0000 (GMT) Received: from smtpav04.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1713058069; Fri, 4 Dec 2026 16:42:12 +0000 (GMT) Received: from Narayanas-MacBook-Pro.ibm.com (unknown [9.124.213.150]) by smtpav04.dal12v.mail.ibm.com (Postfix) with ESMTP; Fri, 4 Dec 2026 16:42:11 +0000 (GMT) From: Narayana Murty N To: Madhavan Srinivasan , Bjorn Helgaas , Thomas Gleixner Cc: Michael Ellerman , Nicholas Piggin , Christophe Leroy , Ritesh Harjani , Shrikanth Hegde , Radu Rendec , sbhat@linux.ibm.com, harshpb@linux.ibm.com, gautam@linux.ibm.com, Nam Cao , Nilay Shroff , Vivian Wang , Shawn Lin , "Rafael J . Wysocki" , Jonathan Cameron , Lorenzo Pieralisi , Farhan Ali , Haoxiang Li , Yuanhe Shu , Vidya Sagar , Hans Zhang <18255117159@163.com>, Miles Krause , Randy Dunlap , 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 Message-ID: <20261204164141.20530-4-nnmlinux@linux.ibm.com> X-Mailer: git-send-email 2.54.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=eYyo7LEH c=1 sm=1 tr=0 ts=6b12ed71 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=pUM-KoujPXoA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22 a=V8glGbnc2Ofi9Qvn3v5h:22 a=Q2mGSSjlkzDRq4e419YA:9 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA0MDA2NiBTYWx0ZWRfX66pUkCp1Sd69 AQVPXGeaJypkQNfsuXbxjoOLdAJZmwN0JcTR+cfLcRljpF7ehF09T4uIzd861LFr6rtQfDZ0nXC 36Op/zoIe5WgRb6i8MSkI5VKb5/5SiA= X-Proofpoint-ORIG-GUID: o2IZ2Fm3Xy8pmFJw4CyHQ_VGZEo2HsZb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA0MDA2NiBTYWx0ZWRfX07ELP4MY2FEd L78qyUr6ZGv+V/UTKQr0b3vaRLc/GqqosVdiVsz5JaXL7/Fiyqh1dNaZg2SxgzLHB+6sjm8kFfP 5qLmJE7ZJ0aWtZksxqhUBJIzoDH/JLrUSl9bDC+w0NGi7TeQ+ggS0Caaa+jSAtoPRAOITeibwnQ Oo81GqxVGNvALJsgE1o2V03w2rQoCKk6sxPHyVxhPWCTjpiK+1u9XHN3Gh0bnvHJzz5ml/qYZP5 PlgjNN2YbOzZ14x9wERdu9zEp5XlENQcIwQDSJTIBHRsFeBT/nW6LREKSkiaMdfXl3Do3W6SntC HoLSGJVSOmFgvAC2UTg+wxSW8+VeUZ13GaaRX56me7gBfeH3XgWWrHjN/IvvlEccZh4Yv5r+GOY sklfjOkJl0iGl7nPtzuRemhQc811hnUvQad3kn8i3Ivcndtwg0hAidmHXObif96dMoU+bV/nsM0 T3PX9PMVxL1WvX0z4fg== X-Proofpoint-GUID: yiB1AR8XBK9mpl6TpbFnaAO84BI4HtM6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-04_03,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 spamscore=0 malwarescore=0 suspectscore=0 adultscore=0 impostorscore=0 priorityscore=1501 phishscore=0 clxscore=1011 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612040066 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