* [PATCH AUTOSEL 6.19-5.10] PCI: Mark Nvidia GB10 to avoid bus reset
[not found] <20260214212452.782265-1-sashal@kernel.org>
@ 2026-02-14 21:23 ` Sasha Levin
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] vmw_vsock: bypass false-positive Wnonnull warning with gcc-16 Sasha Levin
1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Johnny-CC Chang, Bjorn Helgaas, Manivannan Sadhasivam,
Sasha Levin, matthias.bgg, angelogioacchino.delregno, linux-pci,
linux-kernel, linux-arm-kernel, linux-mediatek
From: Johnny-CC Chang <Johnny-CC.Chang@mediatek.com>
[ Upstream commit c81a2ce6b6a844d1a57d2a69833a9d0f00403f00 ]
After asserting Secondary Bus Reset to downstream devices via a GB10 Root
Port, the link may not retrain correctly, e.g., the link may retrain with a
lower lane count or config accesses to downstream devices may fail.
Prevent use of Secondary Bus Reset for devices below GB10.
Signed-off-by: Johnny-CC Chang <Johnny-CC.Chang@mediatek.com>
[bhelgaas: drop pci_ids.h update (only used once), update commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20251113084441.2124737-1-Johnny-CC.Chang@mediatek.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis of PCI Quirk for Nvidia GB10 Bus Reset
### Commit Message Analysis
The commit adds a PCI quirk to prevent Secondary Bus Reset (SBR) for
devices behind Nvidia GB10 Root Ports. The problem is clearly stated:
after asserting SBR, the link may not retrain correctly — leading to
reduced lane count or complete failure of config accesses to downstream
devices. This is a real hardware bug with concrete symptoms (link
degradation, device inaccessibility).
### Code Change Analysis
The change is minimal and surgical:
- Two `DECLARE_PCI_FIXUP_HEADER` lines are added for two specific Nvidia
device IDs (`0x22CE` and `0x22D0`)
- Both call the existing `quirk_no_bus_reset()` function, which simply
sets `PCI_DEV_FLAGS_NO_BUS_RESET` on the device
- A comment block explains why the quirk is needed, with a link to the
mailing list discussion
The diff also shows context that there's already a similar quirk pattern
for other Nvidia GPU devices (`quirk_nvidia_no_bus_reset` matching
`0x2340` range), as well as Atheros devices. This is a well-established
pattern in the kernel.
### Classification: Hardware Quirk
This falls squarely into the **hardware quirk** category, which is
explicitly listed as a strong YES signal for stable backporting.
Hardware quirks:
- Fix real-world hardware issues
- Are trivial additions to existing infrastructure
- Have near-zero risk of regression (they only affect the specific
hardware identified by the PCI IDs)
### Scope and Risk Assessment
- **Lines changed**: ~8 lines (2 macro invocations + comment block)
- **Files touched**: 1 (`drivers/pci/quirks.c`)
- **Complexity**: Minimal — uses existing `quirk_no_bus_reset()`
function
- **Risk**: Extremely low — only affects devices with vendor ID
`PCI_VENDOR_ID_NVIDIA` and device IDs `0x22CE` or `0x22D0`
- **No dependencies**: The `quirk_no_bus_reset()` function and
`DECLARE_PCI_FIXUP_HEADER` macro have existed in the kernel for a very
long time
### User Impact
- **Who is affected**: Users with Nvidia GB10 Root Ports (likely
MediaTek platforms given the author's affiliation)
- **Severity without fix**: Bus reset can cause downstream devices to
become inaccessible (config accesses fail) or degrade link performance
(lower lane count). This can manifest as device failures, system
hangs, or degraded performance
- **Severity with fix**: Bus reset is avoided for these specific root
ports, preventing the link training failure
### Stability Indicators
- **Reviewed-by**: Manivannan Sadhasivam (PCI subsystem reviewer)
- **Committed by**: Bjorn Helgaas (PCI subsystem maintainer), who also
edited the commit log
- **Mailing list link**: Provided for traceability
- The pattern is identical to many existing quirks in the same file
### Dependency Check
No dependencies. The `quirk_no_bus_reset()` function exists in all
stable trees. `DECLARE_PCI_FIXUP_HEADER` and `PCI_VENDOR_ID_NVIDIA` are
long-established. This will apply cleanly to any stable tree.
### Conclusion
This is a textbook hardware quirk addition — small, self-contained, zero
regression risk, fixes a real hardware issue (bus reset failure causing
device inaccessibility), uses existing well-tested infrastructure,
reviewed and committed by the PCI subsystem maintainer. It meets all
stable kernel criteria.
**YES**
drivers/pci/quirks.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 54c76ba9a767e..5782dfb863cad 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3748,6 +3748,14 @@ static void quirk_no_bus_reset(struct pci_dev *dev)
dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET;
}
+/*
+ * After asserting Secondary Bus Reset to downstream devices via a GB10
+ * Root Port, the link may not retrain correctly.
+ * https://lore.kernel.org/r/20251113084441.2124737-1-Johnny-CC.Chang@mediatek.com
+ */
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x22CE, quirk_no_bus_reset);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NVIDIA, 0x22D0, quirk_no_bus_reset);
+
/*
* Some NVIDIA GPU devices do not work with bus reset, SBR needs to be
* prevented for those affected devices.
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread* [PATCH AUTOSEL 6.19-5.10] vmw_vsock: bypass false-positive Wnonnull warning with gcc-16
[not found] <20260214212452.782265-1-sashal@kernel.org>
2026-02-14 21:23 ` [PATCH AUTOSEL 6.19-5.10] PCI: Mark Nvidia GB10 to avoid bus reset Sasha Levin
@ 2026-02-14 21:23 ` Sasha Levin
1 sibling, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2026-02-14 21:23 UTC (permalink / raw)
To: patches, stable
Cc: Arnd Bergmann, Bobby Eshleman, Stefano Garzarella, Bryan Tan,
Jakub Kicinski, Sasha Levin, vishnu.dasa, linux-kernel,
virtualization, netdev
From: Arnd Bergmann <arnd@arndb.de>
[ Upstream commit e25dbf561e03c0c5e36228e3b8b784392819ce85 ]
The gcc-16.0.1 snapshot produces a false-positive warning that turns
into a build failure with CONFIG_WERROR:
In file included from arch/x86/include/asm/string.h:6,
from net/vmw_vsock/vmci_transport.c:10:
In function 'vmci_transport_packet_init',
inlined from '__vmci_transport_send_control_pkt.constprop' at net/vmw_vsock/vmci_transport.c:198:2:
arch/x86/include/asm/string_32.h:150:25: error: argument 2 null where non-null expected because argument 3 is nonzero [-Werror=nonnull]
150 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
net/vmw_vsock/vmci_transport.c:164:17: note: in expansion of macro 'memcpy'
164 | memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait));
| ^~~~~~
arch/x86/include/asm/string_32.h:150:25: note: in a call to built-in function '__builtin_memcpy'
net/vmw_vsock/vmci_transport.c:164:17: note: in expansion of macro 'memcpy'
164 | memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait));
| ^~~~~~
This seems relatively harmless, and it so far the only instance of this
warning I have found. The __vmci_transport_send_control_pkt function
is called either with wait=NULL or with one of the type values that
pass 'wait' into memcpy() here, but not from the same caller.
Replacing the memcpy with a struct assignment is otherwise the same
but avoids the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Bryan Tan <bryan-bt.tan@broadcom.com>
Link: https://patch.msgid.link/20260203163406.2636463-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
## Analysis
### Commit Message Analysis
This commit addresses a **false-positive compiler warning** with
gcc-16.0.1 that becomes a **build failure** when `CONFIG_WERROR` is
enabled. The fix replaces a `memcpy()` call with a direct struct
assignment, which is semantically equivalent but avoids triggering the
`-Wnonnull` warning.
### Code Change Analysis
The change is extremely minimal — a single line change:
```c
- memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait));
+ pkt->u.wait = *wait;
```
This is a purely mechanical transformation. A struct assignment and a
`memcpy` of the same struct size produce identical behavior. The
compiler generates equivalent code. The only difference is that the
struct assignment form doesn't trigger gcc-16's `-Wnonnull` analysis,
which was producing a false positive by analyzing the `memcpy` call
without considering that the `wait` parameter is only NULL for packet
types that don't reach this code path.
### Classification: Build Fix
This is a **build fix** — one of the explicitly allowed categories for
stable backports. With `CONFIG_WERROR` enabled (which is the default in
many distribution kernel configs and increasingly common), this warning
becomes a hard build error. Users building with gcc-16 and
`CONFIG_WERROR` would be unable to compile the kernel.
### Risk Assessment
- **Risk: Extremely low.** The change is a 1:1 semantic equivalent.
`pkt->u.wait = *wait` does exactly what `memcpy(&pkt->u.wait, wait,
sizeof(pkt->u.wait))` does — it copies the struct contents. There is
zero behavioral change.
- **Scope: One line in one file.** Maximally contained.
- **Testing: Well-reviewed.** Has three `Reviewed-by` tags from relevant
maintainers (Bobby Eshleman, Stefano Garzarella, Bryan Tan).
### Dependency Check
This commit has no dependencies on other patches. The code being
modified (`vmci_transport_packet_init`) has existed for a long time in
the stable trees.
### User Impact
- Users building the kernel with gcc-16 and `CONFIG_WERROR` will hit a
build failure without this fix.
- gcc-16 is a snapshot/development compiler now, but will become the
standard gcc version in distributions. As distributions adopt gcc-16,
this will become a real issue for stable kernel users.
- Build fixes are critical for the usability of stable kernels.
### Stability Assessment
- The change is trivially correct — struct assignment and memcpy of a
struct are equivalent.
- Multiple experienced reviewers have confirmed correctness.
- Zero risk of runtime regression.
### Conclusion
This is a textbook stable backport candidate: a minimal, zero-risk build
fix that prevents compilation failure with newer compiler versions. It
falls squarely into the "build fixes that prevent compilation" exception
category. The change is semantically identical to the original code and
has been well-reviewed.
**YES**
net/vmw_vsock/vmci_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c
index 7eccd6708d664..aca3132689cf1 100644
--- a/net/vmw_vsock/vmci_transport.c
+++ b/net/vmw_vsock/vmci_transport.c
@@ -161,7 +161,7 @@ vmci_transport_packet_init(struct vmci_transport_packet *pkt,
case VMCI_TRANSPORT_PACKET_TYPE_WAITING_READ:
case VMCI_TRANSPORT_PACKET_TYPE_WAITING_WRITE:
- memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait));
+ pkt->u.wait = *wait;
break;
case VMCI_TRANSPORT_PACKET_TYPE_REQUEST2:
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread