On 7/22/2025 11:04 PM, ValdikSS wrote:
Device ID comparison in igc_is_device_id_i226 is performed before
the ID is set, resulting in always failing check.
Link:
https://lore.kernel.org/intel-wired-lan/[email protected]
Signed-off-by: ValdikSS <[email protected]>
---
drivers/net/ethernet/intel/igc/igc_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c
b/drivers/net/ethernet/intel/igc/igc_main.c
index 031c332f6..2df36373f 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -7116,6 +7116,7 @@ static int igc_probe(struct pci_dev *pdev,
adapter->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
/* Disable ASPM L1.2 on I226 devices to avoid packet loss */
+ hw->device_id = pdev->device;
if (igc_is_device_id_i226(hw))
pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_2);
@@ -7143,7 +7144,6 @@ static int igc_probe(struct pci_dev *pdev,
/* PCI config space info */
hw->vendor_id = pdev->vendor;
- hw->device_id = pdev->device;
hw->revision_id = pdev->revision;
hw->subsystem_vendor_id = pdev->subsystem_vendor;
hw->subsystem_device_id = pdev->subsystem_device;
Hi Vladik,
Thank you for the fix.
I believe it would be better to move all the device ID related
assignments into a single block at the beginning, rather than assigning
only hw->device_id first and the rest later. This would improve the
readability and flow of the code.