Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196141/?format=api
{ "id": 2196141, "url": "http://patchwork.ozlabs.org/api/patches/2196141/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260212224112.1913980-3-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-3-kbusch@meta.com>", "list_archive_url": null, "date": "2026-02-12T22:41:11", "name": "[PATCHv4,2/3] pci: allow all bus devices to use the same slot", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "65b29c9bcf7643152e4dce6342b3584c9fbafa05", "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-3-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/2196141/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196141/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "\n <linux-pci+bounces-47236-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=ZBUSxLCx;\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-47236-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=\"ZBUSxLCx\"", "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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fBqzS4gSkz1xxM\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 BDAB230A6EA2\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 6F41D335BBB;\n\tThu, 12 Feb 2026 22:41:31 +0000 (UTC)", "from mx0b-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 C4A4E334C3D\n\tfor <linux-pci@vger.kernel.org>; Thu, 12 Feb 2026 22:41:29 +0000 (UTC)", "from pps.filterd (m0109332.ppops.net [127.0.0.1])\n\tby mx0a-00082601.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 61CJlqJd2149970\n\tfor <linux-pci@vger.kernel.org>; Thu, 12 Feb 2026 14:41:28 -0800", "from mail.thefacebook.com ([163.114.134.16])\n\tby mx0a-00082601.pphosted.com (PPS) with ESMTPS id 4c9hynn1r7-3\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 twshared41309.15.frc2.facebook.com (2620:10d:c085:108::4) by\n mail.thefacebook.com (2620:10d:c08b:78::c78f) 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:26 +0000", "by devbig197.nha3.facebook.com (Postfix, from userid 544533)\n\tid AE2F87AD50DC; 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=cbaho07JkEaATxU6vQ8VROebWN1l59kuoYnE7FJqbi6CvZjLPJLtQyvRFywt8CvLRZxh93nBMDGGRtyOC2gy059pDvkpDIkQp8vUheKQ9fkeL4drP/Tw1TXPqExJjh2esGz3vAu9J/kTDbQJi+AgDjohhg5AP0f6f8qbEO5HEgQ=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1770936091; c=relaxed/simple;\n\tbh=7854eXgWaAnuliV0YJpVYIhMw5s8GJgPvktvULOsn+g=;\n\th=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version:Content-Type;\n b=kvAQo6tdP8Z/jUD/b9moJGpzzWgDris07yHJkLD74Kjl0O40zBROX5LHq+0oAGALI2KhZZ/nfpBHO5UCVtiuDHVmUTBCg9t11DmGGJm46+hxWQ7mN+dw4S37PoElkUdg98foWIsd9BGl1CrMxu5Hx8Mz6sm3Zb4mkx4u0+zOUlw=", "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=ZBUSxLCx; 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=qnWvBzmTChH18J7v1ZffziJSY/TlS1zoWPtXI9rDyyY=; b=ZBUSxLCxmLLN\n\tpWFZOzP81SAJfd+YZeZKuy/RfPYXqBn7k960dlERgNtRCYkY9/6QuaYMl1IzqNbn\n\tZG6pJsHCw1PTNY7d05/S+tmQSwud2Vf0S26d5xe11LKu7BztOu5i0w0RjeB8SUhk\n\t2yEngwGJXmkXaonMBZA0PlY/UWaIgNm8iYtbhbJIgT465TLjeUSUwliCJ+wuwe8G\n\tb2Y8ocKDJxb6nFlvp3HUqp41Zf4oEK8919SU79+YOjmmJQXbayMiqx4pGgt36NWA\n\ts8FPABMSUxiHWbrrUZiBQCRxCLVfmQ8MhGmUhXM2NEFh/ilB0Q3x7fQkg3RsI7AB\n\tF+wo26h9CA==", "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 2/3] pci: allow all bus devices to use the same slot", "Date": "Thu, 12 Feb 2026 14:41:11 -0800", "Message-ID": "<20260212224112.1913980-3-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-GUID": "xCo_Cm-aRWyL2ap9FDHEP06JdwwIhFxM", "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwMjEyMDE3NSBTYWx0ZWRfX7dNmGdpKnD/N\n CY65FJ+QL3D+7bR5e88xMWsdQKJjlIFqdMeJYjh/5rimRZEUfTZcmaEemP8gi3BeL32Pw+rkTI1\n f/+OjyPHi6l7/OX289O25MRB/Gny+izyOfYYAef0KUI37Cl7+XZ2PMAJHwevuuYV9vdgKNtiY0w\n h+cyvz23lWs3MzVR8ywqnm7g2MV635Md5uLr01DwFpmH8iVtTOTCAiLclNTiwEnSn3jpvPukvzQ\n K/SB60dAz95R5FqgL7/0UJ9Zc/iE9agX1i2tV+gvLAApUBcBuGyDenXWkEKzAXz0GR/mRBb0j0D\n 4mzm1Xn6avBU10IQggfqEi2Vbn4FaFhLu6hYGysRgerTR70zCSN8OELZJS+czIeQaW0hsO6V4O7\n kNc7ew4VTAKoNZia9w9wL9hRBKLrD2eTkRpn5Q32HW4UxitOqzY4jVHtXBRjjQvaWHv4vRGbcUV\n uFDEnDQv3Iit68E8yHg==", "X-Proofpoint-ORIG-GUID": "xCo_Cm-aRWyL2ap9FDHEP06JdwwIhFxM", "X-Authority-Analysis": "v=2.4 cv=DfMaa/tW c=1 sm=1 tr=0 ts=698e5718 cx=c_pps\n a=CB4LiSf2rd0gKozIdrpkBw==:117 a=CB4LiSf2rd0gKozIdrpkBw==:17\n a=HzLeVaNsDn8A:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22\n a=GgsMoib0sEa3-_RKJdDe:22 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8\n a=CNu0A2bchwO_Ns1ddjEA:9", "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\nA pcie hotplug slot applies to the entire subordinate bus. Thus, pciehp\nonly allocates a single hotplug_slot for the bridge to that bus. The pci\nslot, though, would only match to functions on device 0, meaning all\ndevice beyond that are not matched to any slot even though they share\nit. A slot reset will break all the missing devices because the handling\nskips them.\n\nAllow a slot to be created to claim all devices on a bus, not just a\nmatching device. This is done by introducing a sentinel value, named\nPCI_SLOT_ALL_DEVICES, which then has the pci slot match to any device on\nthe bus. This fixes slot resets for pciehp.\n\nSince 0xff already has special meaning, the chosen value for this new\nfeature is 0xfe. This will not clash with any actual slot number since\nthey are limited to 5 bits.\n\nReviewed-by: Dan Williams <dan.j.williams@intel.com>\nSigned-off-by: Keith Busch <kbusch@kernel.org>\n---\n drivers/pci/hotplug/pciehp_core.c | 3 ++-\n drivers/pci/slot.c | 27 +++++++++++++++++++++++----\n include/linux/pci.h | 8 +++++++-\n 3 files changed, 32 insertions(+), 6 deletions(-)", "diff": "diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c\nindex f59baa9129709..d80346d567049 100644\n--- a/drivers/pci/hotplug/pciehp_core.c\n+++ b/drivers/pci/hotplug/pciehp_core.c\n@@ -79,7 +79,8 @@ static int init_slot(struct controller *ctrl)\n \tsnprintf(name, SLOT_NAME_SIZE, \"%u\", PSN(ctrl));\n \n \tretval = pci_hp_initialize(&ctrl->hotplug_slot,\n-\t\t\t\t ctrl->pcie->port->subordinate, 0, name);\n+\t\t\t\t ctrl->pcie->port->subordinate,\n+\t\t\t\t PCI_SLOT_ALL_DEVICES, name);\n \tif (retval) {\n \t\tctrl_err(ctrl, \"pci_hp_initialize failed: error %d\\n\", retval);\n \t\tkfree(ops);\ndiff --git a/drivers/pci/slot.c b/drivers/pci/slot.c\nindex 50fb3eb595fe6..bf6f265454a84 100644\n--- a/drivers/pci/slot.c\n+++ b/drivers/pci/slot.c\n@@ -42,6 +42,15 @@ static ssize_t address_read_file(struct pci_slot *slot, char *buf)\n \t\t\t\t pci_domain_nr(slot->bus),\n \t\t\t\t slot->bus->number);\n \n+\t/*\n+\t * Preserve legacy ABI expectations that hotplug drivers that manage\n+\t * multiple devices per slot emit 0 for the device number.\n+\t */\n+\tif (slot->number == PCI_SLOT_ALL_DEVICES)\n+\t\treturn sysfs_emit(buf, \"%04x:%02x:00\\n\",\n+\t\t\t\t pci_domain_nr(slot->bus),\n+\t\t\t\t slot->bus->number);\n+\n \treturn sysfs_emit(buf, \"%04x:%02x:%02x\\n\",\n \t\t\t pci_domain_nr(slot->bus),\n \t\t\t slot->bus->number,\n@@ -73,7 +82,8 @@ static void pci_slot_release(struct kobject *kobj)\n \n \tdown_read(&pci_bus_sem);\n \tlist_for_each_entry(dev, &slot->bus->devices, bus_list)\n-\t\tif (PCI_SLOT(dev->devfn) == slot->number)\n+\t\tif (slot->number == PCI_SLOT_ALL_DEVICES ||\n+\t\t PCI_SLOT(dev->devfn) == slot->number)\n \t\t\tdev->slot = NULL;\n \tup_read(&pci_bus_sem);\n \n@@ -166,7 +176,8 @@ void pci_dev_assign_slot(struct pci_dev *dev)\n \n \tmutex_lock(&pci_slot_mutex);\n \tlist_for_each_entry(slot, &dev->bus->slots, list)\n-\t\tif (PCI_SLOT(dev->devfn) == slot->number)\n+\t\tif (slot->number == PCI_SLOT_ALL_DEVICES ||\n+\t\t PCI_SLOT(dev->devfn) == slot->number)\n \t\t\tdev->slot = slot;\n \tmutex_unlock(&pci_slot_mutex);\n }\n@@ -188,7 +199,7 @@ static struct pci_slot *get_slot(struct pci_bus *parent, int slot_nr)\n /**\n * pci_create_slot - create or increment refcount for physical PCI slot\n * @parent: struct pci_bus of parent bridge\n- * @slot_nr: PCI_SLOT(pci_dev->devfn) or -1 for placeholder\n+ * @slot_nr: PCI_SLOT(pci_dev->devfn), -1 for placeholder, or PCI_SLOT_ALL_DEVICES\n * @name: user visible string presented in /sys/bus/pci/slots/<name>\n * @hotplug: set if caller is hotplug driver, NULL otherwise\n *\n@@ -222,6 +233,13 @@ static struct pci_slot *get_slot(struct pci_bus *parent, int slot_nr)\n * consist solely of a dddd:bb tuple, where dddd is the PCI domain of the\n * %struct pci_bus and bb is the bus number. In other words, the devfn of\n * the 'placeholder' slot will not be displayed.\n+ *\n+ * Bus-wide slots:\n+ * For PCIe hotplug, the physical slot encompasses the entire subordinate\n+ * bus, not just a single device number. Pass @slot_nr == PCI_SLOT_ALL_DEVICES\n+ * to create a slot that matches all devices on the bus. Unlike placeholder\n+ * slots, bus-wide slots go through normal slot lookup and reuse existing\n+ * slots if present.\n */\n struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,\n \t\t\t\t const char *name,\n@@ -285,7 +303,8 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,\n \n \tdown_read(&pci_bus_sem);\n \tlist_for_each_entry(dev, &parent->devices, bus_list)\n-\t\tif (PCI_SLOT(dev->devfn) == slot_nr)\n+\t\tif (slot_nr == PCI_SLOT_ALL_DEVICES ||\n+\t\t PCI_SLOT(dev->devfn) == slot_nr)\n \t\t\tdev->slot = slot;\n \tup_read(&pci_bus_sem);\n \ndiff --git a/include/linux/pci.h b/include/linux/pci.h\nindex edf792a79193f..7073519bcc1ad 100644\n--- a/include/linux/pci.h\n+++ b/include/linux/pci.h\n@@ -72,12 +72,18 @@\n /* return bus from PCI devid = ((u16)bus_number) << 8) | devfn */\n #define PCI_BUS_NUM(x) (((x) >> 8) & 0xff)\n \n+/*\n+ * PCI_SLOT_ALL_DEVICES indicates a slot that covers all devices on the bus.\n+ * Used for PCIe hotplug where the physical slot is the entire subordinate bus.\n+ */\n+#define PCI_SLOT_ALL_DEVICES\t0xfe\n+\n /* pci_slot represents a physical slot */\n struct pci_slot {\n \tstruct pci_bus\t\t*bus;\t\t/* Bus this slot is on */\n \tstruct list_head\tlist;\t\t/* Node in list of slots */\n \tstruct hotplug_slot\t*hotplug;\t/* Hotplug info (move here) */\n-\tunsigned char\t\tnumber;\t\t/* PCI_SLOT(pci_dev->devfn) */\n+\tunsigned char\t\tnumber;\t\t/* Device nr, or PCI_SLOT_ALL_DEVICES */\n \tstruct kobject\t\tkobj;\n };\n \n", "prefixes": [ "PATCHv4", "2/3" ] }