Skip to content

Commit 8616718

Browse files
github-cygwinanguy11
authored andcommitted
igc: fix a log entry using uninitialized netdev
During successful probe, igc logs this: [ 5.133667] igc 0000:01:00.0 (unnamed net_device) (uninitialized): PHC added ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The reason is that igc_ptp_init() is called very early, even before register_netdev() has been called. So the netdev_info() call works on a partially uninitialized netdev. Fix this by calling igc_ptp_init() after register_netdev(), right after the media autosense check, just as in igb. Add a comment, just as in igb. Now the log message is fine: [ 5.200987] igc 0000:01:00.0 eth0: PHC added Signed-off-by: Corinna Vinschen <[email protected]> Reviewed-by: Hariprasad Kelam <[email protected]> Acked-by: Vinicius Costa Gomes <[email protected]> Tested-by: Naama Meir <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 8e3a90f commit 8616718

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7028,8 +7028,6 @@ static int igc_probe(struct pci_dev *pdev,
70287028
device_set_wakeup_enable(&adapter->pdev->dev,
70297029
adapter->flags & IGC_FLAG_WOL_SUPPORTED);
70307030

7031-
igc_ptp_init(adapter);
7032-
70337031
igc_tsn_clear_schedule(adapter);
70347032

70357033
/* reset the hardware with the new settings */
@@ -7051,6 +7049,9 @@ static int igc_probe(struct pci_dev *pdev,
70517049
/* Check if Media Autosense is enabled */
70527050
adapter->ei = *ei;
70537051

7052+
/* do hw tstamp init after resetting */
7053+
igc_ptp_init(adapter);
7054+
70547055
/* print pcie link status and MAC address */
70557056
pcie_print_link_status(pdev);
70567057
netdev_info(netdev, "MAC: %pM\n", netdev->dev_addr);

0 commit comments

Comments
 (0)