From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796432681; b=Lto6UDiGxlQ2o3yGIrhXwpbdfMXhdoSzHe0Y0hv813GPHn9E2h2Y4ealWaJ4oUsGyVJf eGgQsel84xFWUT8fOnVEC+O5fJO5pAPEBp/K271YuyDHpWgLWm20dfznzBFuLnfY/4mKC ORTk2zdBgCRrfVtm5Je/V81RpjFP50LMLsv15Wsoak21/arl6ccWFnwIeyLD9pjVKLANQ a8Lsh13IQBDkeWrqfRD3BOrd6r2FFFIMDIcDg7XMC+5oyB1gDIytBjqtU2BBtVPUK6gvK 57End/YgEUaKb9ht5XKLHVBwWIj0P82G3lfSEORrwifL4y28q0mBffI9cCUlVBA5uRw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796432681; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=NBU0KuKdzx0FFftGb2fuhv5wJKq1yfw1Y1Nbw6tM7wU=; b=bP6bVi/dPFUPe/dPrbV1SXhih2nEU1WyJidC7K57z80I6FCptqrRf+kKqmoKpiasCvUm RytXdHKiihdxuymmQjpRAf79Lplm+NFn/PglZZp3sa048RdCHQC1Xwvmw83rcx5L5DePB PjpD/S1eVZ3eACi6O6y93qJkPyMOhzCQUYzVQl5/Eb7bQg6aG+lXSgttgx+AoSAWyGUQX JbbyNXV52hLKhfOVi8bc+j6atsEjfYMRO/8QxFrB8Je9Ap3VV3cA92xRjOCq4Leime7ML gZa4s9kcTE9BMpfJ+b25BFuULwvMJXEsxLpfY2AFTPi/R1b76uYcsJJukYzxpUdI1nQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="P/oGLxBd"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F2E51606A322 for ; Sat, 5 Dec 2026 01:04:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=P/oGLxBd Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54AD21F0092B; Sat, 5 Dec 2026 01:04:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796432680; bh=NBU0KuKdzx0FFftGb2fuhv5wJKq1yfw1Y1Nbw6tM7wU=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=P/oGLxBdLoCDZbUKuq2Zx37DYeZrdDMGFx+5FeeL9JVwW+JeY120Gs513A9MCOaxI flro/h73kky09WJwPzduMOZDYv7m3BPlxrBI2pL3Y+sy/b/Gni71RAh18IWLu330UW KRDGxFUxHBVqvPw/crls96jYOlqeTGMi1GFXRo3MWUvbmNBwu5kiTu3s66HTxuuRu/ zX2qKxFjkWJuNMx7uf/lfnSE9lY1GQJymREFDnJZ1LSJY0BvArLS1AJ2s4BLUXU1SC nNLqROm328jreJJ/Q5ZiIMDg9fw6dIupEU2QcPKfJo5kfht/j/Eo2uhcJi289hVopU DeKfOdgL7DQ6Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 04/16] PCI: Consistently use Header Type to detect bridge headers Reply-To: sashiko-reviews@lists.linux.dev To: =?utf-8?b?SWxwbyBKw6RydmluZW4=?= , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-pci@vger.kernel.org In-Reply-To: <20261205003957.3304-5-ilpo.jarvinen@linux.intel.com> References: <20261205003957.3304-1-ilpo.jarvinen@linux.intel.com> <20261205003957.3304-5-ilpo.jarvinen@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 01:04:39 +0000 X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] PCI: Header Type bridge release conflicts with pdev_resources_assignable() -- commit 41cfb3d22724c17ea21af1abcdf645f81bdde152 Author: Ilpo J=C3=A4rvinen PCI: Consistently use Header Type to detect bridge headers This commit updates pci_claim_bridge_resource(), __pci_bridge_assign_resources(), and pci_bus_release_bridge_resources() to check hdr_type instead of class when identifying PCI and CardBus bridges. > diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c > index c18664b5e5a25..cf062a9ac9a93 100644 > --- a/drivers/pci/setup-bus.c > +++ b/drivers/pci/setup-bus.c > @@ -948,7 +948,7 @@ int pci_claim_bridge_resource(struct pci_dev *bridge,= int i) > if (pci_claim_resource(bridge, i) =3D=3D 0) > return 0; /* Claimed the window */ > =20 > - if ((bridge->class >> 8) !=3D PCI_CLASS_BRIDGE_PCI) > + if (bridge->hdr_type !=3D PCI_HEADER_TYPE_BRIDGE) > return 0; > =20 > if (i > PCI_BRIDGE_PREF_MEM_WINDOW) > @@ -1636,12 +1636,12 @@ static void __pci_bridge_assign_resources(struct = pci_dev *bridge, > =20 > __pci_bus_assign_resources(b, add_list, fail_head); > =20 > - switch (bridge->class >> 8) { > - case PCI_CLASS_BRIDGE_PCI: > + switch (bridge->hdr_type) { > + case PCI_HEADER_TYPE_BRIDGE: > pci_setup_bridge(b); > break; > =20 > - case PCI_CLASS_BRIDGE_CARDBUS: > + case PCI_HEADER_TYPE_CARDBUS: > pci_setup_cardbus_bridge(b); > break; > =20 > @@ -1701,7 +1701,7 @@ static void pci_bus_release_bridge_resources(struct= pci_bus *bus, > =20 > is_leaf_bridge =3D false; > =20 > - if ((dev->class >> 8) !=3D PCI_CLASS_BRIDGE_PCI) > + if (dev->hdr_type !=3D PCI_HEADER_TYPE_BRIDGE) > continue; > =20 > if (rel_type !=3D whole_subtree) > @@ -1718,7 +1718,7 @@ static void pci_bus_release_bridge_resources(struct= pci_bus *bus, > if (pci_is_root_bus(bus)) > return; > =20 > - if ((bus->self->class >> 8) !=3D PCI_CLASS_BRIDGE_PCI) > + if (bus->self->hdr_type !=3D PCI_HEADER_TYPE_BRIDGE) > return; > =20 > if ((rel_type =3D=3D whole_subtree) || is_leaf_bridge) [Severity: High] Can this permanently disable bridge windows on Type 1 bridges that pdev_resources_assignable() skips? pdev_resources_assignable() still filters by Class Code, returning false for PCI_CLASS_NOT_DEFINED, PCI_CLASS_BRIDGE_HOST, and firmware-enabled PCI_CLASS_SYSTEM_PIC devices. During a retry, pci_bus_release_bridge_resources() now releases and disables their windows. On the next round, pdev_sort_resources() skips bus->self because pdev_resources_assignable() is false, so the window is never reassigned and downstream devices are stranded. With add_list enabled, __pci_bus_size_bridges() still queues the window on add_list, which pdev_sort_resources() leaves unconsumed and triggers WARN_ON_ONCE(add_list && !list_empty(add_list)). Similarly, __pci_bridge_assign_resources() now calls pci_setup_bridge() on bridges skipped by pdev_assign_resources_sorted(), and pci_claim_bridge_resource() clips and reprograms windows that pdev_resources_assignable() refuses to manage. Should these paths also check pdev_resources_assignable(), or should pdev_resources_assignable() be aligned with Header Type handling? --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205003957.3304= -1-ilpo.jarvinen@linux.intel.com?part=3D4