From nobody Thu Oct 2 02:12:31 2025 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8615931A549; Wed, 24 Sep 2025 17:16:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758734207; cv=none; b=ViDxDzU/V3K7zcH7I0Ds01xa0LA/X0Z8QEbyYP/o5f93nX3eq3tWS0Urmobl0M3i45mGqIZGHaKHoJSBsfwSnErxxevz66Lwxn/apX0djvmTu6uIQuk5OT8oVzlSrDMxexwwPjdOOP2enZNaZ6S2qZDF1XjFi2MfEAyEBpT+gGo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758734207; c=relaxed/simple; bh=1RXASWL+I3J3u2dKE3vN+USAb0FAaslxVixQNgxLNAY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iTC/lbR9LAKcSX9V9YLg7FRSF4BrP17fzp75EY+yU9Uws8Bpz+SMtknq7fBf6iWLu23BEd8z8+SDARM2BXAWo0iQdwJM/AYxgU7si/xQvE01EIZVnujI8u4NOL3c1D+DTHUcvBEbM/Vp/S1I2UEsXvinQWuUgBSsCiRKz/aEEIo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=mE2cliMf; arc=none smtp.client-ip=148.163.156.1 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.b="mE2cliMf" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 58OBExXn027471; Wed, 24 Sep 2025 17:16:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=j8MbEgg7bHm6AdxqF MAtAs4Vl5MT9RULDEAjlayd9KM=; b=mE2cliMf3svjhuLnELwCZq2bLk0qwJ3fk sVYHxhTwYytbr/er5gZyhrR5EtBvQyFdQYBy7ka4+Tf9eta6Q01qYnx2eVsTAWNX 0o2Jp5wwUxAO4YK/icnGp8geZlpxtXVo/mPq1cQzoKIlLk+VrdRhd8QZ5wwqXM79 A8oabkHYCw21rfzld3klemFmjfg9DJjaj2VJCtWIfdPSoR1ot2NyVXidA39Z7Ji+ KZ6i+0jKVM1YLUJzBv4qwmpTBK5BcDyAudO3m9EZEAII2lR7BilPn7oaEGGB88/b T05x3Smhr3CQZuTvdowYskKUeS+1QMW1Kqvurp6HpJqGTZtFC0Y6A== 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 499n0jru5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Sep 2025 17:16:41 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 58OE4Z6d019671; Wed, 24 Sep 2025 17:16:38 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([172.16.1.70]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 49a83k9mk8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Sep 2025 17:16:38 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 58OHGQkJ3080786 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Sep 2025 17:16:27 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5460F5803F; Wed, 24 Sep 2025 17:16:37 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C68E58064; Wed, 24 Sep 2025 17:16:36 +0000 (GMT) Received: from IBM-D32RQW3.ibm.com (unknown [9.61.252.148]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 24 Sep 2025 17:16:36 +0000 (GMT) From: Farhan Ali To: linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Cc: alex.williamson@redhat.com, helgaas@kernel.org, clg@redhat.com, alifm@linux.ibm.com, schnelle@linux.ibm.com, mjrosato@linux.ibm.com Subject: [PATCH v4 05/10] s390/pci: Restore IRQ unconditionally for the zPCI device Date: Wed, 24 Sep 2025 10:16:23 -0700 Message-ID: <20250924171628.826-6-alifm@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250924171628.826-1-alifm@linux.ibm.com> References: <20250924171628.826-1-alifm@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwOTIwMDAzMyBTYWx0ZWRfX5WyEbxE/Wp6k 6Nnp87qg51apiXHQRL7P9wzwcpjdv+GfrYldmQuugams+LkDcCUbAP2W2dngs0HkazRbuMe0gMW lGoHwD8Dl2BAMyVXLuo5NTAW/DXb+oDWYxD7ENzld+b2wxgJSfGcVkMPQLjsRzzhbxKstdSzgJN Ear775yoLZFtIVnMAbIzNYZB/DzJFnhsloPGiMTr10O0GMC6QH7mHeSxadNO3yhB3hJ5fKFipkE aGNrXJLYK3VyJUmFOBFNhlx8L63xg4xNUqbm+Dj3n0OiDxqEmGJjEmBQu8U3eQbwCxECdseQILP pw6Q7ud9WARQIQ+39jB3k4Ij/IpalpaPFhDmqrg2WmhKrjxaWzESjY85GIZcXFmVibcw33tFBzg NyICYRAS X-Authority-Analysis: v=2.4 cv=TOlFS0la c=1 sm=1 tr=0 ts=68d42779 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=yJojWOMRYYMA:10 a=VnNF1IyMAAAA:8 a=ove13Onh8FEOJJhcmoIA:9 X-Proofpoint-ORIG-GUID: 2Kd3CNY_2zXrPRlixjk8Fr9ItOmlQFpK X-Proofpoint-GUID: 2Kd3CNY_2zXrPRlixjk8Fr9ItOmlQFpK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1117,Hydra:6.1.9,FMLib:17.12.80.40 definitions=2025-09-24_04,2025-09-24_01,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 phishscore=0 impostorscore=0 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2507300000 definitions=main-2509200033 Content-Type: text/plain; charset="utf-8" Commit c1e18c17bda6 ("s390/pci: add zpci_set_irq()/zpci_clear_irq()"), introduced the zpci_set_irq() and zpci_clear_irq(), to be used while resetting a zPCI device. Commit da995d538d3a ("s390/pci: implement reset_slot for hotplug slot"), mentions zpci_clear_irq() being called in the path for zpci_hot_reset_devic= e(). But that is not the case anymore and these functions are not called outside of this file. Instead zpci_hot_reset_device() relies on zpci_disable_device() also clearing the IRQs, but misses to reset the zdev->irqs_registered flag. However after a CLP disable/enable reset, the device's IRQ are unregistered, but the flag zdev->irq_registered does not get cleared. It creates an inconsistent state and so arch_restore_msi_irqs() doesn't correctly restore the device's IRQ. This becomes a problem when a PCI driver tries to restore the state of the device through pci_restore_state(). Restore IRQ unconditionally for the device and remove the irq_registered flag as its redundant. Signed-off-by: Farhan Ali Reviewed-by: Niklas Schnelle --- arch/s390/include/asm/pci.h | 1 - arch/s390/pci/pci_irq.c | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/s390/include/asm/pci.h b/arch/s390/include/asm/pci.h index 41f900f693d9..aed19a1aa9d7 100644 --- a/arch/s390/include/asm/pci.h +++ b/arch/s390/include/asm/pci.h @@ -145,7 +145,6 @@ struct zpci_dev { u8 has_resources : 1; u8 is_physfn : 1; u8 util_str_avail : 1; - u8 irqs_registered : 1; u8 tid_avail : 1; u8 rtr_avail : 1; /* Relaxed translation allowed */ unsigned int devfn; /* DEVFN part of the RID*/ diff --git a/arch/s390/pci/pci_irq.c b/arch/s390/pci/pci_irq.c index 84482a921332..e73be96ce5fe 100644 --- a/arch/s390/pci/pci_irq.c +++ b/arch/s390/pci/pci_irq.c @@ -107,9 +107,6 @@ static int zpci_set_irq(struct zpci_dev *zdev) else rc =3D zpci_set_airq(zdev); =20 - if (!rc) - zdev->irqs_registered =3D 1; - return rc; } =20 @@ -123,9 +120,6 @@ static int zpci_clear_irq(struct zpci_dev *zdev) else rc =3D zpci_clear_airq(zdev); =20 - if (!rc) - zdev->irqs_registered =3D 0; - return rc; } =20 @@ -427,8 +421,7 @@ bool arch_restore_msi_irqs(struct pci_dev *pdev) { struct zpci_dev *zdev =3D to_zpci(pdev); =20 - if (!zdev->irqs_registered) - zpci_set_irq(zdev); + zpci_set_irq(zdev); return true; } =20 --=20 2.43.0