Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229933/?format=api
{ "id": 2229933, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229933/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260428225146.3104063-1-gloveless@jqluv.com/", "project": { "id": 28, "url": "http://patchwork.ozlabs.org/api/1.1/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 }, "msgid": "<20260428225146.3104063-1-gloveless@jqluv.com>", "date": "2026-04-28T22:51:46", "name": "[v3] PCI: release empty sibling bridge windows during window resize", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "e6eb26b84955e83ec47ce10b42cbcf03720b04e9", "submitter": { "id": 93094, "url": "http://patchwork.ozlabs.org/api/1.1/people/93094/?format=api", "name": "Geramy Loveless", "email": "gloveless@jqluv.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-pci/patch/20260428225146.3104063-1-gloveless@jqluv.com/mbox/", "series": [ { "id": 501944, "url": "http://patchwork.ozlabs.org/api/1.1/series/501944/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-pci/list/?series=501944", "date": "2026-04-28T22:51:46", "name": "[v3] PCI: release empty sibling bridge windows during window resize", "version": 3, "mbox": "http://patchwork.ozlabs.org/series/501944/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229933/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229933/checks/", "tags": {}, "headers": { "Return-Path": "\n <linux-pci+bounces-53360-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=jqluv-com.20251104.gappssmtp.com\n header.i=@jqluv-com.20251104.gappssmtp.com header.a=rsa-sha256\n header.s=20251104 header.b=ILj43TSE;\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-53360-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)", "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=jqluv-com.20251104.gappssmtp.com\n header.i=@jqluv-com.20251104.gappssmtp.com header.b=\"ILj43TSE\"", "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.216.42", "smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=jqluv.com", "smtp.subspace.kernel.org;\n spf=none smtp.mailfrom=jqluv.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 4g4wfq4mRCz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 29 Apr 2026 08:52:03 +1000 (AEST)", "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 263DE30053D2\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 22:52:01 +0000 (UTC)", "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 3B067233D9E;\n\tTue, 28 Apr 2026 22:52:00 +0000 (UTC)", "from mail-pj1-f42.google.com (mail-pj1-f42.google.com\n [209.85.216.42])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E60B2772D\n\tfor <linux-pci@vger.kernel.org>; Tue, 28 Apr 2026 22:51:55 +0000 (UTC)", "by mail-pj1-f42.google.com with SMTP id\n 98e67ed59e1d1-35fb16e56efso7819796a91.2\n for <linux-pci@vger.kernel.org>; Tue, 28 Apr 2026 15:51:55 -0700 (PDT)", "from geramyl-MS-S1-MAX.. ([2601:201:8080:e5c0:4857:38db:7c94:21e1])\n by smtp.gmail.com with ESMTPSA id\n 98e67ed59e1d1-364a25c11b9sm176000a91.0.2026.04.28.15.51.53\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 28 Apr 2026 15:51:54 -0700 (PDT)" ], "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777416720; cv=none;\n b=ebbXPVpMCoY2Z95CWIaEq/3w0s7QRHTp68K4zfgh2dq++3vifZltIVZAvsbT//TmQZL0roBvgTq7BuxoR5Lgf3JV1TjKH3gPmSKbLT4M+BpziAWd31+3jw42zqchWyzn06qoSMP5S7iw9otXGOD9VbSqAv44LmxT8obOoDDljIs=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777416720; c=relaxed/simple;\n\tbh=EhAHeYRUZ1QV6wnUYX6Peu5JGPfj3YPRFCobZ1NqpLs=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=QHsfE0HCItIbD/Op/dkpCC0aoTuvUuf/KxNrfXDUSohCjAmqkSnSZiVMn/asyoHtpzLf8f7mpmsqwWEjdovi2TdZUp3LB93hipe4E9i1PxShq7SmKuDSLTNjVTvaJKcGE7Sei15LnGg2Mch3tD9fl9PBnJxdTIipYfkZBRNfSmQ=", "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=none (p=none dis=none) header.from=jqluv.com;\n spf=none smtp.mailfrom=jqluv.com;\n dkim=pass (2048-bit key) header.d=jqluv-com.20251104.gappssmtp.com\n header.i=@jqluv-com.20251104.gappssmtp.com header.b=ILj43TSE;\n arc=none smtp.client-ip=209.85.216.42", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=jqluv-com.20251104.gappssmtp.com; s=20251104; t=1777416715;\n x=1778021515; darn=vger.kernel.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=GLJP6H6AkL9gb44VkGT2QFdVl/FUb87//pKbmPEt1ZM=;\n b=ILj43TSErOw8AcanOv+RXRFMhRLB7Wr3JoukLytc2yFB+4cQeriVqhDGqInAcRiLNL\n jPR3hGSjB6fiuuSVB2OyfvGEPq0dDw+GogZmTofQoRNAcU8kR/Ev4w7yF+84jb3UNWCZ\n UuFpMQ2SpDFl2LUk+hroYlCiVegcJX/vqA5uwdOyBdNP/MMPZmXJcRr5CeK9vhu52TGV\n FAzZjpm6fdoX77zxU8N8i1xL+GsNkBAZ6LkJ4aTklxCXidPTg4MNftBIvm6AxCkF8gE9\n faYGgw6JeO+qh+Fbwbk02q2TcIKIt0d69BV8zvPcQoJ1Ca7scmO56K7xEh+rICE0VGvk\n b/VA==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777416715; x=1778021515;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=GLJP6H6AkL9gb44VkGT2QFdVl/FUb87//pKbmPEt1ZM=;\n b=hdkAP32ksQkx83m5BekwuoXOKWkg1CjM9CrRIWG6/IB7rRUGJsFhWhuZX8EmcbROPr\n M7MsKFgWjUCu34Acsf65tztCchdNqM9rjxjpHh93NfYLJt/qYWKib4erC4Eft8hXbZax\n Q3hdzq0KfRH463w8PY23B7m1sUMUWP4iOHzXjwLI3SOyJPCom1rhaHEx2vETQHtl9/tl\n fsXDVbdj+5zpbwGYqAcfO6XyXPYH6RSxpQ1BSQJ4leZHjF3fSDdFcI46Wbw72ofe+QWY\n VR84x5XdkfhSBoDja+M9lW2u6WN/VEua36XvjF7Yy4CVkCRpRS+TQ6D/+DdTYlNG2ErR\n tciA==", "X-Forwarded-Encrypted": "i=1;\n AFNElJ+b0TF4s6Hu9CNu8iijuY2xS/mqY65gb92pvUb+1Gvwi2DhGw8RrgfpiiVqfNVpVotbIztjbBXyQyU=@vger.kernel.org", "X-Gm-Message-State": "AOJu0YxZpK0j3Z2DCTJqUieq6DCprtFx9bgkaCiKLuxhuaUL31rsVEEh\n\tfGhVBvjEgnyiYSKIULHYyexXnOqKnU1q/UNy7QsU7+zcYfS5uhZ0XcbSVTX/NIirWV8=", "X-Gm-Gg": "AeBDieu3KVXzopLQ5/cpcOOnSo18p8MUVsA6JM/Bv+et7TQKY/Wvj9yFYM1BLGQkpvX\n\tnCtOEQdFluBr0FQl3KBPLh30NJBloxmYWYn5N5ockGL53Tc7wUWNjAG0qfNYE9hsrW69BsY0CnV\n\tFtVDeJi2iF9hDfBZZWV+ixt/gg91KNJh7MNhNWh4Ww8e1meuGRKil6n3pTNsT4c3wMQ5xBzuHJA\n\tE558H4CqMHoBzqQX2GoLPENVPcVBeEilccFF9/2DSMxzH+47m3Rrb3W0s2Ul6aHRgf6562XG1cm\n\tnMnqbUhuZCqNhEp2P9V1VosXF8lS10siz5tGDsSA3zd5nznZ5utGS5M9p/VPrnBLkrv5W/J/hAA\n\tTGyAZV/zYd0P4T4mzYowyNf9BLIcpIRpx9qOsJfyl9MWTouUsHyprSYT1yej/nbbXT9CN5G4Utq\n\t/ry2uwMTx1xc8ziJ2SrXIDIlw6DXPunRH2GoLIOcWPPqjfZ+s=", "X-Received": "by 2002:a17:90b:1c09:b0:35d:9efd:7956 with SMTP id\n 98e67ed59e1d1-364a0b40d40mr1241214a91.11.1777416714744;\n Tue, 28 Apr 2026 15:51:54 -0700 (PDT)", "From": "Geramy Loveless <gloveless@jqluv.com>", "To": "=?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>", "Cc": "Cristian Cocos <cristi@ieee.org>,\n =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>,\n linux-pci@vger.kernel.org, Geramy Loveless <gloveless@jqluv.com>", "Subject": "[PATCH v3] PCI: release empty sibling bridge windows during window\n resize", "Date": "Tue, 28 Apr 2026 15:51:46 -0700", "Message-ID": "<20260428225146.3104063-1-gloveless@jqluv.com>", "X-Mailer": "git-send-email 2.43.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", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit" }, "content": "pbus_reassign_bridge_resources() refuses to release bridge windows that\nhave child resources. On multi-port PCIe switches (e.g. Thunderbolt\ndocks), empty sibling downstream ports hold small reservations that\nprevent the parent window from being freed and re-sized for rebar.\n\nWalk descendants of the target window depth-first, saving and freeing\neach empty bridge window so the parent can then be released and grown.\n\nWithout this change, attempts to grow a window deep below a switch\nfabric leave nested empty windows pinning the ancestor:\n\n pcieport 0000:65:00.0: bridge window [mem 0x8880000000-0x98800fffff\n 64bit pref]: not released, active children present\n pcieport 0000:00:03.2: bridge window [mem 0x8880000000-0x98800fffff\n 64bit pref]: not released, active children present\n\nWith the bottom-up walk and upstream ancestry check, the chain unwinds\nand the rebar succeeds:\n\n pcieport 0000:96:00.0: bridge window [...]: releasing\n pcieport 0000:95:00.0: bridge window [...]: releasing\n pcieport 0000:94:00.0: bridge window [...]: releasing\n pcieport 0000:65:00.0: bridge window [...]: releasing\n amdgpu 0000:97:00.0: BAR 0 [mem 0x9000000000-0x97ffffffff 64bit pref]:\n assigned\n\nSuggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>\nSigned-off-by: Geramy Loveless <gloveless@jqluv.com>\n---\nv3:\n - Restructure helper: outer loop only recurses; inner iterates bus\n resources via pci_bus_for_each_resource(). The release path is now\n unified, so the caller-side block in pbus_reassign_bridge_resources()\n is gone.\n - Walk the resource tree upstream when checking ancestry of @b_win,\n so descendants in nested topologies are also released (Ilpo).\n - Drop pci_resource_is_bridge_win() filter; bus resources are\n inherently bridge windows.\n - Rename pci_bus_release_empty_bridge_resources() to\n pbus_release_empty_bridge_resources().\n - Drop misleading \"Uses PCI bus/device iterators...\" paragraph from\n commit message.\n - Kerneldoc tweaks per Ilpo's review.\n\nv2:\n - Use PCI bus/device iterators instead of walking raw resource tree.\n - Save released resources to rollback list.\n - Filter via pci_resource_is_bridge_win() (now removed in v3).\n - Call release before the !res->child check.\n - Check bridge->subordinate before recursion.\n---\n drivers/pci/setup-bus.c | 63 +++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 61 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c\nindex 4cf120ebe5a..0c1fb654c9c 100644\n--- a/drivers/pci/setup-bus.c\n+++ b/drivers/pci/setup-bus.c\n@@ -2292,6 +2292,60 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)\n }\n EXPORT_SYMBOL_GPL(pci_assign_unassigned_bridge_resources);\n \n+/*\n+ * pci_bus_release_empty_bridge_resources - Bottom-up release of bridge\n+ * window resources in empty subtrees.\n+ * @bus: PCI bus whose child bridges to process\n+ * @b_win: Ancestor bridge window; only children of this resource are released\n+ * @saved: List to save released resources for rollback\n+ *\n+ * Recurses depth-first into subordinate buses, then releases bridge windows\n+ * on the way back up. Each resource is individually saved before release so\n+ * the entire operation can be rolled back.\n+ */\n+static void pci_bus_release_empty_bridge_resources(struct pci_bus *bus,\n+\t\t\t\t\t\t struct resource *b_win,\n+\t\t\t\t\t\t struct list_head *saved)\n+{\n+\tstruct pci_dev *dev;\n+\n+\tlist_for_each_entry(dev, &bus->devices, bus_list) {\n+\t\tstruct resource *r;\n+\t\tunsigned int i;\n+\n+\t\tif (!dev->subordinate)\n+\t\t\tcontinue;\n+\n+\t\t/* Recurse first — release deepest resources before parents */\n+\t\tpci_bus_release_empty_bridge_resources(dev->subordinate,\n+\t\t\t\t\t\t b_win, saved);\n+\n+\t\tpci_dev_for_each_resource(dev, r, i) {\n+\t\t\tif (!pci_resource_is_bridge_win(i))\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (!resource_assigned(r))\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (r->parent != b_win)\n+\t\t\t\tcontinue;\n+\n+\t\t\tif (r->child) {\n+\t\t\t\tconst char *res_name = pci_resource_name(dev, i);\n+\n+\t\t\t\tpci_info(dev, \"%s %pR: not released, children still present\\n\",\n+\t\t\t\t\t res_name, r);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n+\t\t\tif (pci_dev_res_add_to_list(saved, dev, r, 0, 0))\n+\t\t\t\tcontinue;\n+\n+\t\t\tpci_release_resource(dev, i);\n+\t\t}\n+\t}\n+}\n+\n /*\n * Walk to the root bus, find the bridge window relevant for @res and\n * release it when possible. If the bridge window contains assigned\n@@ -2316,7 +2370,12 @@ static int pbus_reassign_bridge_resources(struct pci_bus *bus, struct resource *\n \n \t\ti = pci_resource_num(bridge, res);\n \n-\t\t/* Ignore BARs which are still in use */\n+\t\t/* Release empty sibling bridge windows bottom-up */\n+\t\tif (bridge->subordinate)\n+\t\t\tpci_bus_release_empty_bridge_resources(\n+\t\t\t\tbridge->subordinate, res, saved);\n+\n+\t\t/* Ignore bridge windows which are still in use */\n \t\tif (!res->child) {\n \t\t\tret = pci_dev_res_add_to_list(saved, bridge, res, 0, 0);\n \t\t\tif (ret)\n@@ -2327,7 +2386,7 @@ static int pbus_reassign_bridge_resources(struct pci_bus *bus, struct resource *\n \t\t\tconst char *res_name = pci_resource_name(bridge, i);\n \n \t\t\tpci_warn(bridge,\n-\t\t\t\t \"%s %pR: was not released (still contains assigned resources)\\n\",\n+\t\t\t\t \"%s %pR: not released, active children present\\n\",\n \t\t\t\t res_name, res);\n \t\t}\n \n", "prefixes": [ "v3" ] }