igc: Disable PCIe L1.2 substate on I225-LMvP and I226-LMvP devices
Subsystems (4)
PATCH 1/1 igc: Disable PCIe L1.2 substate on I225-LMvP and I226-LMvP devices
Commit 0325143b59c6 ("igc: disable L1.2 PCI-E link substate to avoid performance issue") disabled the L1.2 substate on I226 controllers due to hardware exit latency limitations. However, IGC_DEV_ID_I226_LMVP (0x5503) was omitted from igc_is_device_id_i226(), and IGC_DEV_ID_I225_LMVP (0x5502) exhibits the same L1.2 exit latency constraints.
On systems where I225-LMvP is connected behind Thunderbolt/USB4 bridges (such as the HP Thunderbolt Dock G4), negotiating L1.2 triggers severe BadDLLP packet framing errors, link timeouts, and system hangs during shutdown. An earlier attempt ("igc: Mask replay rollover/timeout errors in I225_LMVP") proposed masking AER reporting. However, as Bjorn Helgaas noted in review of that patch, simply masking errors is undesirable and fixing the root cause is preferable; disabling L1.2 prevents the link from entering the unstable substate entirely.
Include IGC_DEV_ID_I226_LMVP in igc_is_device_id_i226() and disable the L1.2 substate for I225-LMvP across probe, resume, and error recovery to ensure link stability without masking AER errors.
--- drivers/net/ethernet/intel/igc/igc_base.c | 1 + drivers/net/ethernet/intel/igc/igc_main.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/igc/igc_base.c +1 -0
@@ -447,6 +447,7 @@ bool igc_is_device_id_i226(struct igc_hw *hw)case IGC_DEV_ID_I226_V :case IGC_DEV_ID_I226_K :case IGC_DEV_ID_I226_IT : +case IGC_DEV_ID_I226_LMVP :return true;default :return false;
drivers/net/ethernet/intel/igc/igc_main.c +4 -4
@@ -7172,8 +7172,8 @@ static int igc_probe(struct pci_dev *pdev, hw->subsystem_vendor_id = pdev->subsystem_vendor; hw->subsystem_device_id = pdev->subsystem_device; -/* Disable ASPM L1.2 on I226 devices to avoid packet loss */ -if (igc_is_device_id_i226 (hw)) +/* Disable ASPM L1.2 on I226 and I225-LMvP devices to avoid packet loss */ +if (igc_is_device_id_i226 (hw) || hw->device_id ==IGC_DEV_ID_I225_LMVP )pci_disable_link_state (pdev,PCIE_LINK_STATE_L1_2 ); err =pci_save_state (pdev);
@@ -7559,7 +7559,7 @@ static int __igc_resume(struct device *dev, bool rpm)pci_enable_wake (pdev, PCI_D3hot,0 );pci_enable_wake (pdev, PCI_D3cold,0 ); -if (igc_is_device_id_i226 (hw)) +if (igc_is_device_id_i226 (hw) || hw->device_id ==IGC_DEV_ID_I225_LMVP )pci_disable_link_state (pdev,PCIE_LINK_STATE_L1_2 );if (igc_init_interrupt_scheme (adapter, true)) {
@@ -7688,7 +7688,7 @@ static pci_ers_result_t igc_io_slot_reset(struct pci_dev *pdev)pci_enable_wake (pdev, PCI_D3hot,0 );pci_enable_wake (pdev, PCI_D3cold,0 ); -if (igc_is_device_id_i226 (hw)) +if (igc_is_device_id_i226 (hw) || hw->device_id ==IGC_DEV_ID_I225_LMVP )pci_disable_link_state_locked (pdev,PCIE_LINK_STATE_L1_2 );/* In case of PCI error, adapter loses its HW address
Signature · 1 line
2.53.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues. It looks great!
Quoted 15 lines
Commit
0325143b59c6("igc: disable L1.2 PCI-E link substate to avoid performance issue") disabled the L1.2 substate on I226 controllers due to hardware exit latency limitations. However,IGC_DEV_ID_I226_LMVP(0x5503) was omitted fromigc_is_device_id_i226(), andIGC_DEV_ID_I225_LMVP(0x5502) exhibits the same L1.2 exit latency constraints.On systems where I225-LMvP is connected behind Thunderbolt/USB4 bridges (such as the HP Thunderbolt Dock G4), negotiating L1.2 triggers severe BadDLLP packet framing errors, link timeouts, and system hangs during shutdown. An earlier attempt ("igc: Mask replay rollover/timeout errors in
I225_LMVP") proposed masking AER reporting. However, as Bjorn Helgaas noted in review of that patch, simply masking errors is undesirable and fixing the root cause is preferable; disabling L1.2 prevents the link from entering the unstable substate entirely.
Quoted 7 lines
Include
IGC_DEV_ID_I226_LMVPinigc_is_device_id_i226()and disable the L1.2 substate for I225-LMvP across probe, resume, and error recovery to ensure link stability without masking AER errors.Fixes 0325143b59c6 ("igc: disable L1.2 PCI-E link substate to avoid performance issue")Signed-off-by Daniel Viaño <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great!
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
[email protected]
AI reviewThank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.
Critical: 0 · High: 1 (1) · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).
- [High] The widened condition in __igc_resume() (igc_main.c:7562-7563) makes I225-LMvP and I226-LMvP call the non-locked…
- [Medium] Adding IGC_DEV_ID_I226_LMVP to igc_is_device_id_i226() (drivers/net/ethernet/intel/igc/igc_base.c:450) changes more than the…
- [Low] In igc_probe(), __igc_resume() and igc_io_slot_reset(), the return value of…
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the patch now exposes I226-LMvP to it.
--
igc: Disable PCIe L1.2 substate on I225-LMvP and I226-LMvP devices
This commit adds IGC_DEV_ID_I226_LMVP to igc_is_device_id_i226(). It also extends the ASPM L1.2 disable in probe, resume and PCI error recovery to IGC_DEV_ID_I225_LMVP. The motivation is BadDLLP errors, link timeouts and shutdown hangs seen when I225-LMvP negotiates L1.2 behind Thunderbolt/USB4 docks.
drivers/net/ethernet/intel/igc/igc_base.c bool igc_is_device_id_i226(struct igc_hw *hw) · line 453
Quoted 12 lines
drivers/net/ethernet/intel/igc/igc_base.c +1
-0@@ -447,6 +447,7 @@ bool igc_is_device_id_i226(struct igc_hw *hw)case IGC_DEV_ID_I226_V :case IGC_DEV_ID_I226_K :case IGC_DEV_ID_I226_IT : +case IGC_DEV_ID_I226_LMVP :return true;default :return false;
[Severity: Medium]
Does this change do more than the L1.2 handling the commit message describes? igc_is_device_id_i226() also selects I226-specific TSN/Qbv register programming in igc_tsn.c. I226-LMvP now takes these paths:
drivers/net/ethernet/intel/igc/igc_tsn.c:igc_tsn_disable_offload() {
...
if (igc_is_device_id_i226(hw))
igc_tsn_restore_retx_default(adapter);
...
}drivers/net/ethernet/intel/igc/igc_tsn.c:igc_tsn_enable_offload() {
...
if (igc_is_device_id_i226(hw))
igc_tsn_set_retx_qbvfullthreshold(adapter);
...
if (igc_is_device_id_i226(hw)) {
...
tqavctrl |= IGC_TQAVCTRL_FUTSCDDIS;
...
hrtimer_start(&adapter->hrtimer, expires_time, HRTIMER_MODE_REL);
}
...
}Before this patch, 0x5503 matched neither igc_is_device_id_i225() nor igc_is_device_id_i226(). So none of the following ran on that SKU: the RETX_CTL QBVFULLTH/QBVFULLEN workaround, the FutScdDis programming, the Qbv hrtimer and the double BASET_L write.
The new behaviour matches the other I226 SKUs, but the subject and body only describe an ASPM L1.2 fix. Because of the Fixes: 0325143b59c6 tag, these TSN register changes would go into stable trees without any mention.
The TSN part also seems to fix an omission from when igc_is_device_id_i226() was introduced, not one from 0325143b59c6.
Could the commit message describe the TSN side effects? Alternatively, could that part be split into a separate patch with its own Fixes: tag?
[Severity: High]
This isn't a bug introduced by this patch. However, classifying 0x5503 as I226 also exposes I226-LMvP to an existing problem with adapter->hrtimer.
igc_tsn_enable_offload() arms adapter->hrtimer when the taprio base time is in the future. The only hrtimer_cancel() for it is in igc_remove().
__igc_shutdown() (system and runtime suspend) and igc_reinit_queues() call igc_clear_interrupt_scheme() without cancelling the timer:
igc_clear_interrupt_scheme()
igc_free_q_vectors()
adapter->num_tx_queues = 0;
igc_reset_q_vector()
adapter->tx_ring[...] = NULL;The timer is not cancelled across suspend, so it can still be pending when resume runs. On resume or reinit, the queue count is restored before the rings exist again:
igc_init_interrupt_scheme()
igc_set_interrupt_capability()
adapter->num_tx_queues = adapter->rss_queues;
pci_enable_msix_range()
igc_alloc_q_vectors()
/* tx_ring[] repopulated here */The timer callback loops over num_tx_queues without a NULL check:
drivers/net/ethernet/intel/igc/igc_main.c:igc_qbv_scheduling_timer() {
...
for (i = 0; i < adapter->num_tx_queues; i++) {
struct igc_ring *tx_ring = adapter->tx_ring[i];
if (tx_ring->admin_gate_closed) {
...
}The callback takes qbv_tx_lock, but the teardown and setup paths don't. Suppose the timer expires between igc_set_interrupt_capability() and igc_alloc_q_vectors(), or runs at the same time as igc_free_q_vectors(). Can it then dereference a NULL tx_ring in hardirq context?
drivers/net/ethernet/intel/igc/igc_main.c static int igc_probe(struct pci_dev *pdev, · line 7177
Quoted 13 lines
drivers/net/ethernet/intel/igc/igc_main.c +2
-2@@ -7172,8 +7172,8 @@ static int igc_probe(struct pci_dev *pdev, hw->subsystem_vendor_id = pdev->subsystem_vendor; hw->subsystem_device_id = pdev->subsystem_device; -/* Disable ASPM L1.2 on I226 devices to avoid packet loss */ -if (igc_is_device_id_i226 (hw)) +/* Disable ASPM L1.2 on I226 and I225-LMvP devices to avoid packet loss */ +if (igc_is_device_id_i226 (hw) || hw->device_id ==IGC_DEV_ID_I225_LMVP )pci_disable_link_state (pdev,PCIE_LINK_STATE_L1_2 );
[Severity: Low]
This probably isn't a bug, but the return value of pci_disable_link_state() is ignored here. The same is true in __igc_resume(), and for pci_disable_link_state_locked() in igc_io_slot_reset().
__pci_disable_link_state() can return -EINVAL when there is no link state (for example with pcie_aspm=off). It can also return -EPERM when the OS doesn't have ASPM control:
drivers/pci/pcie/aspm.c:__pci_disable_link_state() {
...
if (aspm_disabled) {
pci_warn(pdev, "can't disable ASPM; OS doesn't have ASPM control\n");
return -EPERM;
}
...
}In those cases L1.2 stays as firmware configured it on the newly covered I225-LMvP and I226-LMvP devices.
The PCI core already warns on the -EPERM path. Failing probe, resume or recovery would leave the NIC unusable, and the existing I226 handling does the same thing. Is continuing silently here the intended behaviour?
drivers/net/ethernet/intel/igc/igc_main.c static int __igc_resume(struct device *dev, bool rpm) · line 7563
Quoted 7 lines
drivers/net/ethernet/intel/igc/igc_main.c +1
-1@@ -7559,7 +7559,7 @@ static int __igc_resume(struct device *dev, bool rpm)pci_enable_wake (pdev, PCI_D3hot,0 );pci_enable_wake (pdev, PCI_D3cold,0 ); -if (igc_is_device_id_i226 (hw)) +if (igc_is_device_id_i226 (hw) || hw->device_id ==IGC_DEV_ID_I225_LMVP )pci_disable_link_state (pdev,PCIE_LINK_STATE_L1_2 );
[Severity: High]
Can this take pci_bus_sem recursively during AER recovery?
__igc_resume() is also the runtime resume path, and igc runtime suspends after link loss via igc_runtime_idle(). pcie_do_recovery() runtime resumes devices from inside a bus walk that holds pci_bus_sem for read:
pcie_do_recovery()
pci_walk_bridge(bridge, pci_pm_runtime_get_sync, NULL)
pci_walk_bus()
down_read(&pci_bus_sem);
pci_pm_runtime_get_sync()
pm_runtime_get_sync()
igc_runtime_resume()
__igc_resume(dev, true)
pci_disable_link_state()
__pci_disable_link_state()
down_read(&pci_bus_sem);A writer could queue between the two down_read() calls, for example pci_device_add() from enumeration or hotplug, which is plausible behind a Thunderbolt dock. The nested reader would then block behind the writer, while the writer waits for the outer reader. Would that deadlock AER recovery and PCI enumeration? Lockdep would also be expected to report recursive locking here.
igc_io_slot_reset() already uses pci_disable_link_state_locked() for this reason. The runtime resume step earlier in recovery isn't covered, though.
The other I226 IDs already have the same pattern, and this patch extends it to both LMvP devices. Could it be fixed for all of them at the same time?
Signature · 1 line
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260925112850.189302-1-danividanivi%40gmail.com
Quoted 26 lines · On 29/09/2026 14:41, [email protected] wrote:
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider.
Critical: 0 · High: 1 (1) · Medium: 1 · Low: 1
If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough).
- [High] The widened condition in
__igc_resume()(igc_main.c:7562-7563) makes I225-LMvP and I226-LMvP call the non-locked…
- [Medium] AddingIGC_DEV_ID_I226_LMVPtoigc_is_device_id_i226()(drivers/net/ethernet/intel/igc/igc_base.c:450) changes more than the…
- [Low] Inigc_probe(),__igc_resume()andigc_io_slot_reset(), the return value of…Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the patch now exposes I226-LMvP to it.--
igc: Disable PCIe L1.2 substate on I225-LMvP and I226-LMvP devices
Quoted 7 lines
This commit adds
IGC_DEV_ID_I226_LMVPtoigc_is_device_id_i226(). It also extends the ASPM L1.2 disable in probe, resume and PCI error recovery toIGC_DEV_ID_I225_LMVP. The motivation is BadDLLP errors, link timeouts and shutdown hangs seen when I225-LMvP negotiates L1.2 behind Thunderbolt/USB4 docks.
I think this patch might better be split into several patches.
1. Adding the missing IGC_DEV_ID_I226_LMVP to igc_is_device_id_i226(). This was probably an accidental omission.
2. Addressing the locked vs. non-locked call to pci_disable_link_state (the possible deadlock noted by Sashiko) - this should be looked into a bit more, I don't know off the top of my head what race is / isn't possible.
3. The actual problem with L1.2 substate this patch aims to solve. I checked with the HW team and there are two conclusions - (a) it is strange that L1.2 is enabled somehow for I225_LMVP - this is not expected. (b) generally it is probably best and simplest to remove any device ID checks and simply disable L1.2 across the board in this driver. Unless there are downsides to calling the API when it is already disabled (I don't expect there are).
--Dima
Quoted 4 lines · Dima
I think this patch might better be split into several patches.
1. Adding the missing
IGC_DEV_ID_I226_LMVPtoigc_is_device_id_i226(). This was probably an accidental omission.
Agreed, I'll send this as a separate patch. Note that it also changes the TSN code paths in igc_tsn.c for I226-LMvP (they will now get the i226 behaviour), so it would be good if you could confirm that this is correct for 0x5503.
Quoted 4 lines
2. Addressing the locked vs. non-locked call to
pci_disable_link_state(the possible deadlock noted by Sashiko) - this should be looked into a bit more, I don't know off the top of my head what race is / isn't possible.
I believe the deadlock is real and already present for I226. pcie_do_recovery() runtime-resumes the affected devices through pci_walk_bridge(bridge, pci_pm_runtime_get_sync, NULL), i.e. with pci_bus_sem held for read. If igc is runtime-suspended at that point, igc_runtime_resume() -> __igc_resume() -> pci_disable_link_state() takes pci_bus_sem for read a second time, which can deadlock if a writer queues in between.
The L1.2 disable done in probe is sticky (link->aspm_disable) and the PCI core honours it when restoring state on resume, so I plan to drop the call from __igc_resume().
Quoted 4 lines
3. The actual problem with L1.2 substate this patch aims to solve. I checked with the HW team and there are two conclusions - (a) it is strange that L1.2 is enabled somehow for
I225_LMVP- this is not expected.
You are right, and I was wrong about the mechanism. On my setup (HP Thunderbolt Dock G4, I225-LMvP rev 03 behind a Goshen Ridge downstream port) the NIC only advertises L1.1:
L1SubCap: PCI-PM_L1.2- PCI-PM_L1.1+
ASPM_L1.2- ASPM_L1.1+ L1_PM_Substates+
and the upstream port has no L1 PM Substates capability at all, so L1.2 can never be enabled on this link. I will drop the I225-LMvP part and investigate the dock errors separately with AER enabled.
Quoted 3 lines
(b) generally it is probably best and simplest to remove any device ID checks and simply disable L1.2 across the board in this driver.
I can add a third patch doing that if you prefer. Otherwise I'd leave it to you, since I have no I226 hardware to test it on.
Thanks,
Daniel
pw-bot: cr
Quoted 10 lines · Daniel Viaño
Quoted 4 lines · Dima
I think this patch might better be split into several patches.
1. Adding the missing
IGC_DEV_ID_I226_LMVPtoigc_is_device_id_i226(). This was probably an accidental omission.Agreed, I'll send this as a separate patch. Note that it also changes the TSN code paths in
igc_tsn.cfor I226-LMvP (they will now get the i226 behaviour), so it would be good if you could confirm that this is correct for0x5503.
I confirmed that the new I226-only TSN functionality (enabled in upstream commit b8897dc54e3b) applies to the I226_LMVP (0x5503) as well, so I see no risk adding it to the device ID list. This will make the L1.2 disable code function as intended.
Quoted 14 lines
Quoted 5 lines
2. Addressing the locked vs. non-locked call to
pci_disable_link_state(the possible deadlock noted by Sashiko) - this should be looked into a bit more, I don't know off the top of my head what race is / isn't possible.I believe the deadlock is real and already present for I226.
pcie_do_recovery()runtime-resumes the affected devices throughpci_walk_bridge(bridge, pci_pm_runtime_get_sync, NULL), i.e. withpci_bus_semheld for read. If igc is runtime-suspended at that point,igc_runtime_resume()->__igc_resume()->pci_disable_link_state()takespci_bus_semfor read a second time, which can deadlock if a writer queues in between.
Quoted 3 lines
The L1.2 disable done in probe is sticky (
link->aspm_disable) and the PCI core honours it when restoring state on resume, so I plan to drop the call from__igc_resume().
Great, so yes, this is good to have as a separate patch.
Quoted 17 lines
Quoted 5 lines
3. The actual problem with L1.2 substate this patch aims to solve. I checked with the HW team and there are two conclusions - (a) it is strange that L1.2 is enabled somehow for
I225_LMVP- this is not expected.You are right, and I was wrong about the mechanism. On my setup (HP Thunderbolt Dock G4, I225-LMvP rev 03 behind a Goshen Ridge downstream port) the NIC only advertises L1.1:
L1SubCap: PCI-PM_L1.2- PCI-PM_L1.1+ ASPM_L1.2- ASPM_L1.1+ L1_PM_Substates+and the upstream port has no L1 PM Substates capability at all, so L1.2 can never be enabled on this link. I will drop the I225-LMvP part and investigate the dock errors separately with AER enabled.
Quoted 6 lines
Quoted 3 lines
(b) generally it is probably best and simplest to remove any device ID checks and simply disable L1.2 across the board in this driver.
I can add a third patch doing that if you prefer. Otherwise I'd leave it to you, since I have no I226 hardware to test it on.
Thank you for checking. Since you confirm the I225 issue you experience does not actually stem from L1.2, we can skip this for now.
--Dima