{"id":2226504,"url":"http://patchwork.ozlabs.org/api/1.2/covers/2226504/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/cover/cover.1776866921.git.bblock@linux.ibm.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.2/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<cover.1776866921.git.bblock@linux.ibm.com>","list_archive_url":null,"date":"2026-04-22T14:22:10","name":"[v3,0/3] PCI: s390/pci: Fix deadlocks on s390 when releasing zPCI-bus or -device objects","submitter":{"id":91674,"url":"http://patchwork.ozlabs.org/api/1.2/people/91674/?format=json","name":"Benjamin Block","email":"bblock@linux.ibm.com"},"mbox":"http://patchwork.ozlabs.org/project/linux-pci/cover/cover.1776866921.git.bblock@linux.ibm.com/mbox/","series":[{"id":501019,"url":"http://patchwork.ozlabs.org/api/1.2/series/501019/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=501019","date":"2026-04-22T14:22:11","name":"PCI: s390/pci: Fix deadlocks on s390 when releasing zPCI-bus or -device objects","version":3,"mbox":"http://patchwork.ozlabs.org/series/501019/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/covers/2226504/comments/","headers":{"Return-Path":"\n <linux-pci+bounces-52975-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=l68bLJEe;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-pci+bounces-52975-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com\n header.b=\"l68bLJEe\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=148.163.156.1","smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=linux.ibm.com"],"Received":["from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g11dp4fddz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 00:22:38 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 31A773038D2E\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 14:22:31 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 37AE93ED11D;\n\tWed, 22 Apr 2026 14:22:24 +0000 (UTC)","from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n [148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id C76433ED5B5;\n\tWed, 22 Apr 2026 14:22:20 +0000 (UTC)","from pps.filterd (m0353729.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63MDha9R1020894;\n\tWed, 22 Apr 2026 14:22:19 GMT","from ppma21.wdc07v.mail.ibm.com\n (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dphfrbac6-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 22 Apr 2026 14:22:18 +0000 (GMT)","from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1])\n\tby ppma21.wdc07v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 63ME5J2W028014;\n\tWed, 22 Apr 2026 14:22:17 GMT","from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229])\n\tby ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4dpjkyaj32-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 22 Apr 2026 14:22:17 +0000 (GMT)","from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com\n [10.20.54.100])\n\tby smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 63MEMEiR35586386\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tWed, 22 Apr 2026 14:22:14 GMT","from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 07AFE2004B;\n\tWed, 22 Apr 2026 14:22:14 +0000 (GMT)","from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id E811E20043;\n\tWed, 22 Apr 2026 14:22:13 +0000 (GMT)","from p1gen4-pw042f0m (unknown [9.52.223.163])\n\tby smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTPS;\n\tWed, 22 Apr 2026 14:22:13 +0000 (GMT)","from bblock by p1gen4-pw042f0m with local (Exim 4.99.1)\n\t(envelope-from <bblock@linux.ibm.com>)\n\tid 1wFYSz-0000000FrWj-2ldh;\n\tWed, 22 Apr 2026 16:22:13 +0200"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776867743; cv=none;\n b=iOJ9FXMW8ksazCk5YTj/ogcm+7k5nPYXrydjuRC8kr6EsbqIo33XBXYz6ccVs2vB5+kKUKPDXoY04HmjzpW9f7CbHeZI03TTmuPdkFiqLVxyuGWMrsDl181/EygCsTR+O8Sh5akQw6lvHS/j6pYjPTnsAIJLIDjPpm8s06l4IUQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776867743; c=relaxed/simple;\n\tbh=3VMSyGTt5XCHxmwrz/FhdjLosMOx8ZpcBL2BtbgrnZY=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=Cn8CxBWANHZqy+60ZnGYgVrHNA5qd/+C541ZsAbbvvLoh1L0t5mCpqZljLdTqpjmcoZi81Cj/qvhHItQtH/pAmQ6DQpUJPa8ARFvU6lF89fik3PULvxbhfyI3e0wxC7rScxM6ESCuNNgxZNQ1vZvyz7nIEVWbrH0w7xGt/OTHtI=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=linux.ibm.com;\n spf=pass smtp.mailfrom=linux.ibm.com;\n dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com\n header.b=l68bLJEe; arc=none smtp.client-ip=148.163.156.1","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc\n\t:content-transfer-encoding:content-type:date:from:message-id\n\t:mime-version:sender:subject:to; s=pp1; bh=knfTnT4Sekc/DVGGOOX1j\n\t87CJkebV6cpruMJ9ZdrdFw=; b=l68bLJEejNBacdfXrPUudNPgaek9VRZRTSvVy\n\tBM2g4cYH0QTbcHL17BokKyE715gUqSNNtDbcnYXtkYb21PN7VFNDpT6L3vVqdfWf\n\tC/irjrpT87G1XKmSHvbWKgy0CuUrhspv9A53ZNUT33szJZO5WxYMG/s70UAAaOQf\n\trdnwB4KYJYJU5rQh8W4KVl4X3j3RgjHNbFLVljmNeay2/hYZ9kBw5mGi7hPBZvjH\n\t6m2dBXXcDbySqMzb6k1L7XzGsKrp0BpB2ya1zc8trOJ3HZER+seml1tYqHLAqk25\n\trSD+t8OKEXmpqU7CLE6HlioShvKic+OOj+1+7taYkawR+3b8w==","From":"Benjamin Block <bblock@linux.ibm.com>","To":"Bjorn Helgaas <bhelgaas@google.com>","Cc":"Ionut Nechita <ionut.nechita@windriver.com>,\n        Tobias Schumacher <ts@linux.ibm.com>,\n        linux-pci <linux-pci@vger.kernel.org>,\n        Gerd Bayer <gbayer@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>,\n        Christian Borntraeger <borntraeger@linux.ibm.com>,\n        Niklas Schnelle <schnelle@linux.ibm.com>,\n        Sven Schnelle <svens@linux.ibm.com>,\n        linux-kernel <linux-kernel@vger.kernel.org>,\n        Ionut Nechita <ionut_n2001@yahoo.com>,\n        Heiko Carstens <hca@linux.ibm.com>, Farhan Ali <alifm@linux.ibm.com>,\n        linux-s390 <linux-s390@vger.kernel.org>,\n        Alexander Gordeev <agordeev@linux.ibm.com>,\n        Andreas Krebbel <krebbel@linux.ibm.com>,\n        Matthew Rosato <mjrosato@linux.ibm.com>,\n        Julian Ruess <julianr@linux.ibm.com>,\n        Benjamin Block <bblock@linux.ibm.com>","Subject":"[PATCH v3 0/3] PCI: s390/pci: Fix deadlocks on s390 when releasing\n zPCI-bus or -device objects","Date":"Wed, 22 Apr 2026 16:22:10 +0200","Message-ID":"<cover.1776866921.git.bblock@linux.ibm.com>","X-Mailer":"git-send-email 2.54.0","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Organization":"IBM Deutschland Research & Development GmbH,\n    https://www.ibm.com/privacy, Vors. Aufs.-R.: Wolfgang Wendt,    \n\t=?unknown-8bit?b?R2VzY2jDpGZ0c2bDvGhydW5nOg==?= David Faller. Sitz der Ges.:\n Ehningen,    Registergericht: AmtsG Stuttgart, HRB 243294","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"8bit","Sender":"Benjamin Block <bblock@linux.ibm.com>","X-TM-AS-GCONF":"00","X-Proofpoint-Reinject":"loops=2 maxloops=12","X-Proofpoint-GUID":"Lr812lb-u45ejc_q4r_kX8093OpzvZvP","X-Proofpoint-ORIG-GUID":"SFI8Pbo-_rClvBeRDyQ72k-szT95Nzeg","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDIyMDEzOCBTYWx0ZWRfX9sKas7Rm9OeD\n aWApXPWrJFmJFW9VTRSRPf1aQo6ow6S2L1GDwNM2CX2MSAH+KabgbUzj8CJitpvuIR+DdGXzTdY\n NkSmURzP1DXSMEHdQdmwcCvAIyzWFKpm4Oddrdjlj1eRlb0OqP2V2ODkLdQONxNUIUg6uCaHYwd\n 15+s8E5sGbRSKHY4eoDT1BL0uLQoCg9LyanbfGDqtyzbbdDghjGOPtiXorRW+S5GdoqwI2BnGIF\n iSXx2gJ7+LHFkFtEcxPvyYiu6JIb8958BlL7IRO/xqNy7/6EM0FloBmx+yIB3vVfjZtl+xVMG8r\n yj337rsVxnxWAUIoysNUKiRPwd+DaJB3Jt3ga+5vN6xxuu5CkN0+VZi/Obb5lGV8Z5QC5KeA9PH\n j6MfeXJw6tRyoC6FXtag4AZ/24aZqT7dLz898m74cG4Mq17j8sPuBvzbUKKpyJEDQObCo3I2cx2\n riYM0FXYMy1jA/zaeBg==","X-Authority-Analysis":"v=2.4 cv=SJxykuvH c=1 sm=1 tr=0 ts=69e8d99b cx=c_pps\n a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17\n a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=RnoormkPH1_aCDwRdu11:22 a=uAbxVGIbfxUO_5tXvNgY:22 a=VwQbUJbxAAAA:8\n a=t7CeM3EgAAAA:8 a=VnNF1IyMAAAA:8 a=JMDAtZ06FB4a80dcI5YA:9 a=QEXdDO2ut3YA:10\n a=FdTzh2GWekK77mhwV6Dw:22","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-22_01,2026-04-21_02,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n priorityscore=1501 suspectscore=0 malwarescore=0 impostorscore=0 bulkscore=0\n lowpriorityscore=0 phishscore=0 clxscore=1015 adultscore=0 spamscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604220138"},"content":"v2 -> v3:\n    * added Reviewed-by and Tested-by from Niklas\n    * base series on current version of Ionut's patch series\n      \"PCI/IOV: Fix SR-IOV locking races and AB-BA deadlock\"\n      https://lore.kernel.org/linux-pci/cover.1776839248.git.ionut.nechita%40windriver.com/T/#\n      to prevent small merge-conflict in patch 01\n    * adapted description of patch 03 so it reflects the point that the series\n      is now based on Ionut's patch series, and certain deadlocks can't happen\n      anymore (recursive), but others still can (the AB-BA cyclic variants)\nv1 -> v2:\n    * combine patch 02 and 04 - fix and use of guards [Ilpo, Niklas]\n    * rephrase description of patch 01 to point out that it is already possible\n      today to lock/unlock `pci_rescan_remove_lock` anywhere\n    * added Fixes: tags to patch 03 - the fix\n\nNiklas already mentioned it in his recent comments on discussions about\n`pci_rescan_remove_lock` here\nhttps://lore.kernel.org/linux-pci/286d0488aa72b1741f93f900fd5db5c4334a6f50.camel@linux.ibm.com/\nand here\nhttps://lore.kernel.org/linux-pci/2b6a844619892ecaa11031705808667e0886d8b2.camel@linux.ibm.com/\n; we recently found a couple of deadlocks in the s390 architecture PCI\nimplementation with hotplug events on our platform.\n\nSo far these have not been observed because on s390 it was not usual to have\nboth PF and attached VFs in the same Linux instance. So far PCI devices have\nlargely been either available as PF without SR-IOV, or as VF without the PF\nbeing visible in the same instance. This left us with some blind spots w.r.t.\nthe locking issues here.\n    This is now changing, and with that we started running into these\ndeadlocks.\n\nPlease Note:\n    This patchset strictly depends on Ionut Nechita's patch that makes\n    `pci_lock_rescan_remove()` reentrant:\n    https://lore.kernel.org/linux-pci/cover.1776839248.git.ionut.nechita%40windriver.com/T/#\n\n    Since the discussion so far sounded positive towards the change I decided\n    to base some of the changes in this patchset on the assumption that his\n    patch gets merged before mine. Otherwise there will be recursive deadlocks.\n\nPatch 01 helps us insofar it enables us to use lockdep annotations in the\n         architecture code.\nPatch 02 makes it possible to use lock guards for `pci_rescan_remove_lock`.\nPatch 03 goes into detail what deadlocks exactly exist today, and fixes them.\n\nI've run a /lot/ of tests with affected PCI adapters:\n    * enable/disable SR-IOV on the PF;\n    * run FLR reset on PF and VF;\n    * run Bus reset on PF and VF;\n    * run s390's recover SysFS attribute on PF and VF;\n    * remove/re-add PCI devices via the `remove` SysFS attribute;\n    * unbind/re-bind PCI devices to the vfio-pci device driver;\n    * disable/enable power with the hotplug SysFS attribute on PF and VF;\n    * run `zpcictl` with `--reset`/`--reset-fw` on PF and VF;\n    * remove/re-add vfio modules with bound PCI devices;\n    * run Configure Off and Configure On on both the PF and VF from a Service\n      Element.\n\nThere is no more deadlocks and no other lockdep warnings I've witnessed.\n\nBenjamin Block (3):\n  PCI: Move declaration of pci_rescan_remove_lock into public pci.h\n  PCI: Provide lock guard for pci_rescan_remove_lock\n  s390/pci: Fix circular/recursive deadlocks in PCI-bus and -device\n    release\n\n arch/s390/pci/pci.c       | 11 ++++++++---\n arch/s390/pci/pci_bus.c   | 15 ++++++++-------\n arch/s390/pci/pci_event.c | 28 +++++++++++++++++++---------\n arch/s390/pci/pci_iov.c   |  3 +--\n arch/s390/pci/pci_sysfs.c |  9 +++------\n drivers/pci/pci.h         |  2 --\n drivers/pci/probe.c       |  1 +\n include/linux/pci.h       |  5 +++++\n 8 files changed, 45 insertions(+), 29 deletions(-)\n\n\nbase-commit: 028ef9c96e96197026887c0f092424679298aae8\nprerequisite-patch-id: 04db39c9d883c6d06c9b2400fc445c62177f1c5b\nprerequisite-patch-id: 68e07de292969a95b72a26153893281558c3eb0d"}