Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196140/?format=api
{ "id": 2196140, "url": "http://patchwork.ozlabs.org/api/patches/2196140/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260212224112.1913980-4-kbusch@meta.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/projects/28/?format=api", "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": "<20260212224112.1913980-4-kbusch@meta.com>", "list_archive_url": null, "date": "2026-02-12T22:41:12", "name": "[PATCHv4,3/3] pci: make reset_subordinate hotplug safe", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "09e6f9fe8a85eb9f2af42d1249d0865afdfd1c2b", "submitter": { "id": 84963, "url": "http://patchwork.ozlabs.org/api/people/84963/?format=api", "name": "Keith Busch", "email": "kbusch@meta.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260212224112.1913980-4-kbusch@meta.com/mbox/", "series": [ { "id": 492034, "url": "http://patchwork.ozlabs.org/api/series/492034/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=492034", "date": "2026-02-12T22:41:10", "name": "pci slot reset handling fixes", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/492034/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196140/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196140/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-47235-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=meta.com header.i=@meta.com header.a=rsa-sha256\n header.s=s2048-2025-q2 header.b=jUWf5z0W;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-47235-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com\n header.b=\"jUWf5z0W\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=67.231.153.30", "smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=meta.com", "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=meta.com" ], "Received": [ "from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4fBqzS48l1z1xr1\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 09:41:40 +1100 (AEDT)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id C689430A7051\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 22:41:31 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 5885F335541;\n\tThu, 12 Feb 2026 22:41:31 +0000 (UTC)", "from mx0a-00082601.pphosted.com (mx0b-00082601.pphosted.com\n [67.231.153.30])\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 EF0F6335067\n\tfor <linux-pci@vger.kernel.org>; Thu, 12 Feb 2026 22:41:29 +0000 (UTC)", "from pps.filterd (m0001303.ppops.net [127.0.0.1])\n\tby m0001303.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 61CL6H0p3534862\n\tfor <linux-pci@vger.kernel.org>; Thu, 12 Feb 2026 14:41:29 -0800", "from maileast.thefacebook.com ([163.114.135.16])\n\tby m0001303.ppops.net (PPS) with ESMTPS id 4c9pg1h0uk-2\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT)\n\tfor <linux-pci@vger.kernel.org>; Thu, 12 Feb 2026 14:41:28 -0800 (PST)", "from twshared26871.17.frc2.facebook.com (2620:10d:c0a8:1b::8e35) by\n mail.thefacebook.com (2620:10d:c0a9:6f::237c) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.2.2562.35; Thu, 12 Feb 2026 22:41:27 +0000", "by devbig197.nha3.facebook.com (Postfix, from userid 544533)\n\tid AF5AF7AD50DD; Thu, 12 Feb 2026 14:41:13 -0800 (PST)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1770936091; cv=none;\n b=I9lbFizxv0dw6NYn914R3io1bnlf7G6K9Bhr6R74hQZzLsgR5AEgtTl2zXCmWqy5MZy4AQm4cFq1Q5zXigzSFnMWFcdENPin9pn3eY823NLQf1kKnQdO5dxIRrLe/Tu4qgInnfLJ69fDdymTN1FQEkcThU8JjX6eXvRTEH2uJUM=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1770936091; c=relaxed/simple;\n\tbh=bOGaX/SlZW8OlwVJe5GdR4EJl6eywMScyiHZN8i4QVs=;\n\th=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=EGsOWx0eXzqEZn4Jz0YwjHhZzQ+48ZC66c6PpaAy6oHUeFb3VS8Il4l6gbcW1/ggA5d37UzMBwF047PyMq/wxi+7yZ9yEgOl3VREB0AdEGzgUiosg06iDE17AWyKxwcWonH/MASSw0EBrzaJwc9AN+xoxZhGA/O1+lsQzxa6oX0=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=reject dis=none) header.from=meta.com;\n spf=pass smtp.mailfrom=meta.com;\n dkim=pass (2048-bit key) header.d=meta.com header.i=@meta.com\n header.b=jUWf5z0W; arc=none smtp.client-ip=67.231.153.30", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=meta.com; h=cc\n\t:content-transfer-encoding:content-type:date:from:in-reply-to\n\t:message-id:mime-version:references:subject:to; s=s2048-2025-q2;\n\t bh=as7XcEeIvEV80qYgsRrOpQZV1N+wMsCokCLkgzf3DCc=; b=jUWf5z0WSnWo\n\twKiQkUZzgpWWQDJSDh9r8ULC7U0PR6Wi1b4KtNDdzfwtQypB437TvDKJlmrn9gEn\n\tkoXAyCUeLgXMfhfZ2mHu3hZg3ouQ2YfYxyFfNpcuNSBZEg6RWUOu0SVuc9fw8Gez\n\tTytJtI4tnh9DIc/sO0v0848L7BJte6u26cP+D1LNGStyU8Opf+hrX8udBb0B7BBQ\n\t+SCqEGOYNpZZaZRYX3xv4SioQNgr02Efty7a2mq1IL5+vwb32MrIEnStRYywUiwD\n\tAvKk3pFtEeBnf4zaN5QGcAcdgXF2Rfr/SKNwkmhy7fCINXvMcWx7Bgiyzx9PXm4Q\n\ttvqNS6XVHg==", "From": "Keith Busch <kbusch@meta.com>", "To": "<linux-pci@vger.kernel.org>, <helgaas@kernel.org>, <alex@shazbot.org>,\n <dan.j.williams@intel.com>", "CC": "<lukas@wunner.de>, Keith Busch <kbusch@kernel.org>", "Subject": "[PATCHv4 3/3] pci: make reset_subordinate hotplug safe", "Date": "Thu, 12 Feb 2026 14:41:12 -0800", "Message-ID": "<20260212224112.1913980-4-kbusch@meta.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260212224112.1913980-1-kbusch@meta.com>", "References": "<20260212224112.1913980-1-kbusch@meta.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", "Content-Transfer-Encoding": "quoted-printable", "X-FB-Internal": "Safe", "Content-Type": "text/plain", "X-Proofpoint-ORIG-GUID": "f9EPigOqQUJy2q2M-S8BCaiCLwRYtKhM", "X-Authority-Analysis": "v=2.4 cv=XK49iAhE c=1 sm=1 tr=0 ts=698e5718 cx=c_pps\n a=MfjaFnPeirRr97d5FC5oHw==:117 a=MfjaFnPeirRr97d5FC5oHw==:17\n a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22\n a=GgsMoib0sEa3-_RKJdDe:22 a=VwQbUJbxAAAA:8 a=ejDskD-KKpTUFPmLGuEA:9", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjEyMDE3NSBTYWx0ZWRfXxLkEJhYjSygZ\n aVt9tjHOkKlJi+39N7Ul5u6koEKkvjRMMBfv5nu/6v6EMiM1ELmOpLWrkooc7tRFoqySgHb9O7H\n AS75njeSHEo8FKFYBY5rAYBI6d0Bkd2xg7mLpQM6R8BD1M3tb4E8ZD4mbMGrWctUZT2Qk+0FmT3\n jGenvXNbT26fF2/fZXWdkbPoCP9aBJJp/e3gXarsI0dESpVlbIamTXrMOtmZFYj7kv3k6G0j5B4\n 4g5EHDSG3XnQ53ifrBwi5ew8X9aW8k2B1IbJkISN15hKenqBW6m/itgGf+ozyzxTibdevjrono4\n QaYVWGknGfxUCZSxv0HVlSf0EIp0zLmnwypWyCKX+mn8tVnFA6qcAx6uhVORsRnEg89CkagHoNp\n BUL+ht3Jn82njdjzX010vmlhAIB7UKmHq2SGGs0FXE6FMAwX/tZOets1AiaqqQqmOY0kaWZyNMX\n 78xoP/1y7atp4WhYJow==", "X-Proofpoint-GUID": "f9EPigOqQUJy2q2M-S8BCaiCLwRYtKhM", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-02-12_05,2026-02-12_03,2025-10-01_01" }, "content": "From: Keith Busch <kbusch@kernel.org>\n\nUse the slot reset method when resetting the bridge if the bus contains\nhot plug slots. This fixes spurious hot plug events that are triggered\nby the secondary bus reset that bypasses the slot's detection disabling.\n\nResetting a bridge's subordinate bus can be done like this:\n\n # echo 1 > /sys/bus/pci/devices/0000:50:01.0/reset_subordinate\n\nPrior to this patch, an example kernel message may show something like:\n\n pcieport 0000:50:01.0: pciehp: Slot(40): Link Down\n\nWith this change, the pciehp driver ignores the link event during the\nreset, so may show this message instead:\n\n pcieport 0000:50:01.0: pciehp: Slot(40): Link Down/Up ignored\n\nSigned-off-by: Keith Busch <kbusch@kernel.org>\n---\n drivers/pci/pci-sysfs.c | 3 +-\n drivers/pci/pci.c | 86 +++++++++++++++++++++++++++--------------\n drivers/pci/pci.h | 2 +-\n 3 files changed, 60 insertions(+), 31 deletions(-)", "diff": "diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c\nindex b44e884fd5372..6187b0f3e2833 100644\n--- a/drivers/pci/pci-sysfs.c\n+++ b/drivers/pci/pci-sysfs.c\n@@ -553,7 +553,6 @@ static ssize_t reset_subordinate_store(struct device *dev,\n \t\t\t\tconst char *buf, size_t count)\n {\n \tstruct pci_dev *pdev = to_pci_dev(dev);\n-\tstruct pci_bus *bus = pdev->subordinate;\n \tunsigned long val;\n \n \tif (!capable(CAP_SYS_ADMIN))\n@@ -563,7 +562,7 @@ static ssize_t reset_subordinate_store(struct device *dev,\n \t\treturn -EINVAL;\n \n \tif (val) {\n-\t\tint ret = pci_try_reset_bus(bus);\n+\t\tint ret = pci_try_reset_bridge(pdev);\n \n \t\tif (ret)\n \t\t\treturn ret;\ndiff --git a/drivers/pci/pci.c b/drivers/pci/pci.c\nindex 5ab0b22dc7274..c535cd7f45013 100644\n--- a/drivers/pci/pci.c\n+++ b/drivers/pci/pci.c\n@@ -54,6 +54,10 @@ unsigned int pci_pm_d3hot_delay;\n \n static void pci_pme_list_scan(struct work_struct *work);\n \n+#define PCI_RESET_RESTORE true\n+#define PCI_RESET_NO_RESTORE false\n+static int pci_reset_bridge(struct pci_dev *bridge, bool restore);\n+\n static LIST_HEAD(pci_pme_list);\n static DEFINE_MUTEX(pci_pme_list_mutex);\n static DECLARE_DELAYED_WORK(pci_pme_work, pci_pme_list_scan);\n@@ -5600,36 +5604,10 @@ static int pci_bus_reset(struct pci_bus *bus, bool probe)\n /**\n * pci_bus_error_reset - reset the bridge's subordinate bus\n * @bridge: The parent device that connects to the bus to reset\n- *\n- * This function will first try to reset the slots on this bus if the method is\n- * available. If slot reset fails or is not available, this will fall back to a\n- * secondary bus reset.\n */\n int pci_bus_error_reset(struct pci_dev *bridge)\n {\n-\tstruct pci_bus *bus = bridge->subordinate;\n-\tstruct pci_slot *slot;\n-\n-\tif (!bus)\n-\t\treturn -ENOTTY;\n-\n-\tmutex_lock(&pci_slot_mutex);\n-\tif (list_empty(&bus->slots))\n-\t\tgoto bus_reset;\n-\n-\tlist_for_each_entry(slot, &bus->slots, list)\n-\t\tif (pci_probe_reset_slot(slot))\n-\t\t\tgoto bus_reset;\n-\n-\tlist_for_each_entry(slot, &bus->slots, list)\n-\t\tif (pci_slot_reset(slot, PCI_RESET_DO_RESET))\n-\t\t\tgoto bus_reset;\n-\n-\tmutex_unlock(&pci_slot_mutex);\n-\treturn 0;\n-bus_reset:\n-\tmutex_unlock(&pci_slot_mutex);\n-\treturn pci_bus_reset(bridge->subordinate, PCI_RESET_DO_RESET);\n+\treturn pci_reset_bridge(bridge, PCI_RESET_NO_RESTORE);\n }\n \n /**\n@@ -5650,7 +5628,7 @@ EXPORT_SYMBOL_GPL(pci_probe_reset_bus);\n *\n * Same as above except return -EAGAIN if the bus cannot be locked\n */\n-int pci_try_reset_bus(struct pci_bus *bus)\n+static int pci_try_reset_bus(struct pci_bus *bus)\n {\n \tint rc;\n \n@@ -5670,6 +5648,58 @@ int pci_try_reset_bus(struct pci_bus *bus)\n \treturn rc;\n }\n \n+/**\n+ * pci_reset_bridge - reset a bridge's subordinate bus\n+ * @bridge: bridge that connects to the bus to reset\n+ * @restore: true if affected device states need to be restored after the reset\n+ *\n+ * This function will first try to reset the slots on this bus if the method is\n+ * available. If slot reset fails or is not available, this will fall back to a\n+ * secondary bus reset.\n+ */\n+static int pci_reset_bridge(struct pci_dev *bridge, bool restore)\n+{\n+\tstruct pci_bus *bus = bridge->subordinate;\n+\tstruct pci_slot *slot;\n+\n+\tif (!bus)\n+\t\treturn -ENOTTY;\n+\n+\tmutex_lock(&pci_slot_mutex);\n+\tif (list_empty(&bus->slots))\n+\t\tgoto bus_reset;\n+\n+\tlist_for_each_entry(slot, &bus->slots, list)\n+\t\tif (pci_probe_reset_slot(slot))\n+\t\t\tgoto bus_reset;\n+\n+\tlist_for_each_entry(slot, &bus->slots, list) {\n+\t\tint ret;\n+\n+\t\tif (restore)\n+\t\t\tret = pci_try_reset_slot(slot);\n+\t\telse\n+\t\t\tret = pci_slot_reset(slot, PCI_RESET_DO_RESET);\n+\n+\t\tif (ret)\n+\t\t\tgoto bus_reset;\n+\t}\n+\n+\tmutex_unlock(&pci_slot_mutex);\n+\treturn 0;\n+bus_reset:\n+\tmutex_unlock(&pci_slot_mutex);\n+\n+\tif (restore)\n+\t\treturn pci_try_reset_bus(bus);\n+\treturn pci_bus_reset(bridge->subordinate, PCI_RESET_DO_RESET);\n+}\n+\n+int pci_try_reset_bridge(struct pci_dev *bridge)\n+{\n+\treturn pci_reset_bridge(bridge, PCI_RESET_RESTORE);\n+}\n+\n /**\n * pci_reset_bus - Try to reset a PCI bus\n * @pdev: top level PCI device to reset via slot/bus\ndiff --git a/drivers/pci/pci.h b/drivers/pci/pci.h\nindex d1350d54b932d..9e363ad22e161 100644\n--- a/drivers/pci/pci.h\n+++ b/drivers/pci/pci.h\n@@ -231,7 +231,7 @@ bool pci_reset_supported(struct pci_dev *dev);\n void pci_init_reset_methods(struct pci_dev *dev);\n int pci_bridge_secondary_bus_reset(struct pci_dev *dev);\n int pci_bus_error_reset(struct pci_dev *dev);\n-int pci_try_reset_bus(struct pci_bus *bus);\n+int pci_try_reset_bridge(struct pci_dev *bridge);\n \n struct pci_cap_saved_data {\n \tu16\t\tcap_nr;\n", "prefixes": [ "PATCHv4", "3/3" ] }