{"id":2226524,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2226524/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/c6bf51eafa3af2392f4f1462c7c2791ca19d13e6.1776868550.git.bblock@linux.ibm.com/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.1/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},"msgid":"<c6bf51eafa3af2392f4f1462c7c2791ca19d13e6.1776868550.git.bblock@linux.ibm.com>","date":"2026-04-22T14:37:42","name":"[v4,1/3] PCI: Move declaration of pci_rescan_remove_lock into public pci.h","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"ab79cfd6b8b601fad1ef9c9386237dac6d5d5ce5","submitter":{"id":91674,"url":"http://patchwork.ozlabs.org/api/1.1/people/91674/?format=json","name":"Benjamin Block","email":"bblock@linux.ibm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/c6bf51eafa3af2392f4f1462c7c2791ca19d13e6.1776868550.git.bblock@linux.ibm.com/mbox/","series":[{"id":501022,"url":"http://patchwork.ozlabs.org/api/1.1/series/501022/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=501022","date":"2026-04-22T14:37:42","name":"PCI: s390/pci: Fix deadlocks on s390 when releasing zPCI-bus or -device objects","version":4,"mbox":"http://patchwork.ozlabs.org/series/501022/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226524/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226524/checks/","tags":{},"headers":{"Return-Path":"\n <linux-pci+bounces-52979-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=gT8ajzhc;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c15:e001:75::12fc:5321; helo=sin.lore.kernel.org;\n envelope-from=linux-pci+bounces-52979-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=\"gT8ajzhc\"","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 sin.lore.kernel.org (sin.lore.kernel.org\n [IPv6:2600:3c15:e001:75::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g12105wZgz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 00:39:16 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sin.lore.kernel.org (Postfix) with ESMTP id 62A5C30200E1\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 14:37:53 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 450B53ED5DD;\n\tWed, 22 Apr 2026 14:37:52 +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 E68DA3ED5CD;\n\tWed, 22 Apr 2026 14:37:50 +0000 (UTC)","from pps.filterd (m0360083.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63MARLE5876696;\n\tWed, 22 Apr 2026 14:37:50 GMT","from ppma11.dal12v.mail.ibm.com\n (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219])\n\tby mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4dpeu2409v-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 22 Apr 2026 14:37:49 +0000 (GMT)","from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1])\n\tby ppma11.dal12v.mail.ibm.com (8.18.1.7/8.18.1.7) with ESMTP id\n 63MEZPBQ004822;\n\tWed, 22 Apr 2026 14:37:48 GMT","from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224])\n\tby ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4dpjkxtm0x-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n\tWed, 22 Apr 2026 14:37:48 +0000 (GMT)","from smtpav02.fra02v.mail.ibm.com (smtpav02.fra02v.mail.ibm.com\n [10.20.54.101])\n\tby smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 63MEbjmv36110838\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n\tWed, 22 Apr 2026 14:37:45 GMT","from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 0B2DA20043;\n\tWed, 22 Apr 2026 14:37:45 +0000 (GMT)","from smtpav02.fra02v.mail.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id EB7A720040;\n\tWed, 22 Apr 2026 14:37:44 +0000 (GMT)","from p1gen4-pw042f0m (unknown [9.52.223.163])\n\tby smtpav02.fra02v.mail.ibm.com (Postfix) with ESMTPS;\n\tWed, 22 Apr 2026 14:37:44 +0000 (GMT)","from bblock by p1gen4-pw042f0m with local (Exim 4.99.1)\n\t(envelope-from <bblock@linux.ibm.com>)\n\tid 1wFYi0-0000000G4RW-2ukc;\n\tWed, 22 Apr 2026 16:37:44 +0200"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776868672; cv=none;\n b=tYqyC7nUO65eLYEy3dfWG/ndYs9ZoteX1/v0+5heO8roAyGKx38W3kBUJFfYSIoE+DfDQRs/WZwmT1rsM2laXb/dW2tyZZAd4eLT9WDnDR6su/7YOCudXSHbkuL0IW2clcGBk721xUtAzHj+oZNjqdq7HkAfQaWDA9wQvZfbAjE=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776868672; c=relaxed/simple;\n\tbh=AOgrJvt8eAQd3uhRUBWWqieBYQQirzu5sfsd07wnJ0s=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=KXBHhwe/5rCvlKdDSrvRdu0LvROz8q059j65a5wMCDc35YPB/ZFKgZx/mESyZs+izbnIByUDa+T9m0RbEPzRvH1iEc+rBmqqL/QCXlOjD+rq0TeLbNS5Q+qpxf+JyGRjDUz1S/xwvZiTsy7e2a5dom0SL1VTvnhA91kOeYtBnTw=","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=gT8ajzhc; 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:date:from:in-reply-to:message-id\n\t:mime-version:references:sender:subject:to; s=pp1; bh=/B8iiDzQPv\n\tdivl/buJcKUq4lAcbq+Yp2V/5n/G8nloU=; b=gT8ajzhcIXV63I6QId/GAUG7td\n\thcN6veZQJ2w8v+dJGkL8t7REsYA/G20xMbikpX0KtmDNMIkRpiVz44D1nAyC+kcY\n\tfjhEhoc8yaJZWRWjtR3jlOLvVQ4c4ZzHwSg/iMVMNvKhUFc80FYPEZvAWXLW4dlf\n\tEvgbdC0DmbFtITGQ2+hc5oDljNT3vWXiCE8Sx4qWC8wbtFe/u0MJJ8brGsr1j2oN\n\tnCF+WJdegY2IMnZEvVcYlaXs0+KmhS9u23/D1mSxza4ApILsoVN+jbRDmO3t8F54\n\tYUgp0xEQs5PnbKwhHNTDPj2t+Z8/H3TBCbdKMI+w8kN+DLFh2tHY8W+vsaJA==","From":"Benjamin Block <bblock@linux.ibm.com>","To":"Bjorn Helgaas <bhelgaas@google.com>","Cc":"Niklas Schnelle <schnelle@linux.ibm.com>,\n        Tobias Schumacher <ts@linux.ibm.com>,\n        linux-s390 <linux-s390@vger.kernel.org>,\n        Heiko Carstens <hca@linux.ibm.com>,\n        Ionut Nechita <ionut_n2001@yahoo.com>,\n        Sven Schnelle <svens@linux.ibm.com>,\n        Ionut Nechita <ionut.nechita@windriver.com>,\n        Farhan Ali <alifm@linux.ibm.com>,\n        Alexander Gordeev <agordeev@linux.ibm.com>,\n        Julian Ruess <julianr@linux.ibm.com>,\n        Andreas Krebbel <krebbel@linux.ibm.com>,\n        Gerd Bayer <gbayer@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>,\n        linux-pci <linux-pci@vger.kernel.org>,\n        linux-kernel <linux-kernel@vger.kernel.org>,\n        Christian Borntraeger <borntraeger@linux.ibm.com>,\n        Matthew Rosato <mjrosato@linux.ibm.com>,\n        Benjamin Block <bblock@linux.ibm.com>","Subject":"[PATCH v4 1/3] PCI: Move declaration of pci_rescan_remove_lock into\n public pci.h","Date":"Wed, 22 Apr 2026 16:37:42 +0200","Message-ID":"\n <c6bf51eafa3af2392f4f1462c7c2791ca19d13e6.1776868550.git.bblock@linux.ibm.com>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<cover.1776868550.git.bblock@linux.ibm.com>","References":"<cover.1776868550.git.bblock@linux.ibm.com>","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":"=?unknown-8bit?q?IBM_Deutschland_Research_=26_Development_GmbH?=\n\t=?unknown-8bit?q?=2C_https=3A//www=2Eibm=2Ecom/privacy=2C_Vors=2E_Aufs=2E-R?=\n\t=?unknown-8bit?q?=2E=3A_Wolfgang_Wendt=2C_Gesch=C3=A4ftsf=C3=BChrung=3A_Dav?=\n\t=?unknown-8bit?q?id_Faller=2E_Sitz_der_Ges=2E=3A_Ehningen=2C_Registergerich?=\n\t=?unknown-8bit?q?t=3A_AmtsG_Stuttgart=2C_HRB_243294?=","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-Spam-Details-Enc":"AW1haW4tMjYwNDIyMDEzOCBTYWx0ZWRfX5qAqdt7TsJbt\n SnthpVsCTErylbLQ3cvko54l0CPQcYrmAj1zagJYQj7m7oChuQQ9WmPZPDaqXTSx7b/zEGYWBOG\n YAwU9vSqGJ7cPhG+Q+0miZOkMOvzXZUStixxjxIN95eXfvET2Nps+3R+rVoRjc+Zm+dWgAQv0/L\n sjrmqsPIkBJmU4nL/krc86vUEmm0kzFIuOjwSDufF1u8329DPpWyFlpQIOeJmrPyREwSdCBejar\n /rxv81sApB6/W2Rv7ByzpT3a1k1LjRzPjezTK3uyeMH473qoV1gxmgpljjQvdOH4coC5yO9jn2X\n 9+NzfCKmGPgE2oD9q0xKfoQ1jl3sURjcghncFMxLonEefWaXrsQXhuUdlhjxCLKEnFtaZXmz/R8\n QPoqyAX2GHYfc1su/OquEZDACbe7mA5xO2yyb5w+XipjJ/EkHCxb4J+WGVsMZRH7EQ5fEd3JSTZ\n /0Ea+Rt1nPUjtVpYc4A==","X-Proofpoint-ORIG-GUID":"i-apgRMqPvEPmC_aFkQ9NZi3pKgMWL2S","X-Proofpoint-GUID":"n2fVAIjDJtn3MAwfgLwj3_nZYVdYXHv7","X-Authority-Analysis":"v=2.4 cv=XMUAjwhE c=1 sm=1 tr=0 ts=69e8dd3e cx=c_pps\n a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17\n a=A5OVakUREuEA:10 a=VkNPw1HP01LnGYTKEx00:22 a=RnoormkPH1_aCDwRdu11:22\n a=iQ6ETzBq9ecOQQE5vZCe:22 a=VnNF1IyMAAAA:8 a=vf2HUNMP9xvVswJDcwYA:9","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 malwarescore=0 clxscore=1015 priorityscore=1501 impostorscore=0 bulkscore=0\n spamscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 suspectscore=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":"So far it is possible to use and call the functions\npci_lock_rescan_remove() and pci_unlock_rescan_remove() from any PCI\ncode, including modules and architecture code; but the lock variable\n`pci_rescan_remove_lock` itself is private to objects residing in\n`drivers/pci/` via the header `drivers/pci/pci.h`.\n\nThis makes it possible to use the lock - lock it, unlock it - from\nanywhere, but it is not possible to use lockdep annotations such as\nlockdep_assert_held(), or sparse annotations such as __must_hold() in\nmodules or architecture code for PCI to make the usage more safe.\n\nSince it is useful for `pci_rescan_remove_lock` to have such\nannotations, move the variable declaration into `include/linux/pci.h`.\n\nReviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>\nSigned-off-by: Benjamin Block <bblock@linux.ibm.com>\n---\n drivers/pci/pci.h   | 2 --\n drivers/pci/probe.c | 1 +\n include/linux/pci.h | 2 ++\n 3 files changed, 3 insertions(+), 2 deletions(-)","diff":"diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h\nindex 13d998fbacce..6d611523420f 100644\n--- a/drivers/pci/pci.h\n+++ b/drivers/pci/pci.h\n@@ -110,8 +110,6 @@ struct pcie_tlp_log;\n extern const unsigned char pcie_link_speed[];\n extern bool pci_early_dump;\n \n-extern struct mutex pci_rescan_remove_lock;\n-\n bool pcie_cap_has_lnkctl(const struct pci_dev *dev);\n bool pcie_cap_has_lnkctl2(const struct pci_dev *dev);\n bool pcie_cap_has_rtctl(const struct pci_dev *dev);\ndiff --git a/drivers/pci/probe.c b/drivers/pci/probe.c\nindex 850a63c175f0..81a7db71ebc3 100644\n--- a/drivers/pci/probe.c\n+++ b/drivers/pci/probe.c\n@@ -3509,6 +3509,7 @@ EXPORT_SYMBOL_GPL(pci_rescan_bus);\n  * routines should always be executed under this mutex.\n  */\n DEFINE_MUTEX(pci_rescan_remove_lock);\n+EXPORT_SYMBOL_GPL(pci_rescan_remove_lock);\n static const struct task_struct *pci_rescan_remove_owner;\n static unsigned int pci_rescan_remove_depth;\n \ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex 1c270f1d5123..fd7a962a64ef 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -39,6 +39,7 @@\n #include <linux/io.h>\n #include <linux/resource_ext.h>\n #include <linux/msi_api.h>\n+#include <linux/mutex.h>\n #include <uapi/linux/pci.h>\n \n #include <linux/pci_ids.h>\n@@ -1533,6 +1534,7 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev);\n \n /* Functions for PCI Hotplug drivers to use */\n unsigned int pci_rescan_bus(struct pci_bus *bus);\n+extern struct mutex pci_rescan_remove_lock;\n void pci_lock_rescan_remove(void);\n void pci_unlock_rescan_remove(void);\n \n","prefixes":["v4","1/3"]}