Patch "igb: Avoid starting unnecessary workqueues" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    igb: Avoid starting unnecessary workqueues

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     igb-avoid-starting-unnecessary-workqueues.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 41a177f06c4d850cb3f5754d3dc43f4b14df15c6
Author: Alessio Igor Bogani <alessio.bogani@xxxxxxxxxx>
Date:   Mon Aug 21 10:19:27 2023 -0700

    igb: Avoid starting unnecessary workqueues
    
    [ Upstream commit b888c510f7b3d64ca75fc0f43b4a4bd1a611312f ]
    
    If ptp_clock_register() fails or CONFIG_PTP isn't enabled, avoid starting
    PTP related workqueues.
    
    In this way we can fix this:
     BUG: unable to handle page fault for address: ffffc9000440b6f8
     #PF: supervisor read access in kernel mode
     #PF: error_code(0x0000) - not-present page
     PGD 100000067 P4D 100000067 PUD 1001e0067 PMD 107dc5067 PTE 0
     Oops: 0000 [#1] PREEMPT SMP
     [...]
     Workqueue: events igb_ptp_overflow_check
     RIP: 0010:igb_rd32+0x1f/0x60
     [...]
     Call Trace:
      igb_ptp_read_82580+0x20/0x50
      timecounter_read+0x15/0x60
      igb_ptp_overflow_check+0x1a/0x50
      process_one_work+0x1cb/0x3c0
      worker_thread+0x53/0x3f0
      ? rescuer_thread+0x370/0x370
      kthread+0x142/0x160
      ? kthread_associate_blkcg+0xc0/0xc0
      ret_from_fork+0x1f/0x30
    
    Fixes: 1f6e8178d685 ("igb: Prevent dropped Tx timestamps via work items and interrupts.")
    Fixes: d339b1331616 ("igb: add PTP Hardware Clock code")
    Signed-off-by: Alessio Igor Bogani <alessio.bogani@xxxxxxxxxx>
    Tested-by: Arpana Arland <arpanax.arland@xxxxxxxxx> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230821171927.2203644-1-anthony.l.nguyen@xxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index c39e921757ba9..3c501c67bdbb6 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -1245,18 +1245,6 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		return;
 	}
 
-	spin_lock_init(&adapter->tmreg_lock);
-	INIT_WORK(&adapter->ptp_tx_work, igb_ptp_tx_work);
-
-	if (adapter->ptp_flags & IGB_PTP_OVERFLOW_CHECK)
-		INIT_DELAYED_WORK(&adapter->ptp_overflow_work,
-				  igb_ptp_overflow_check);
-
-	adapter->tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE;
-	adapter->tstamp_config.tx_type = HWTSTAMP_TX_OFF;
-
-	igb_ptp_reset(adapter);
-
 	adapter->ptp_clock = ptp_clock_register(&adapter->ptp_caps,
 						&adapter->pdev->dev);
 	if (IS_ERR(adapter->ptp_clock)) {
@@ -1266,6 +1254,18 @@ void igb_ptp_init(struct igb_adapter *adapter)
 		dev_info(&adapter->pdev->dev, "added PHC on %s\n",
 			 adapter->netdev->name);
 		adapter->ptp_flags |= IGB_PTP_ENABLED;
+
+		spin_lock_init(&adapter->tmreg_lock);
+		INIT_WORK(&adapter->ptp_tx_work, igb_ptp_tx_work);
+
+		if (adapter->ptp_flags & IGB_PTP_OVERFLOW_CHECK)
+			INIT_DELAYED_WORK(&adapter->ptp_overflow_work,
+					  igb_ptp_overflow_check);
+
+		adapter->tstamp_config.rx_filter = HWTSTAMP_FILTER_NONE;
+		adapter->tstamp_config.tx_type = HWTSTAMP_TX_OFF;
+
+		igb_ptp_reset(adapter);
 	}
 }
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux