Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH] igb: Unconditionally deallocate workqueues as allocation already does
@ 2023-07-18 13:45 Alessio Igor Bogani
  2023-07-19 21:18 ` Tony Nguyen
  0 siblings, 1 reply; 5+ messages in thread
From: Alessio Igor Bogani @ 2023-07-18 13:45 UTC (permalink / raw)
  To: intel-wired-lan; +Cc: Alessio Igor Bogani

The workqueues ptp_tx_work and ptp_overflow_work are unconditionally allocated
by igb_ptp_init() but, at the moment, are deallocated only if the flag
IGB_PTP_ENABLED is on which isn't the case if there are errors or
if CONFIG_PTP is disabled.

Otherwise, when we unbind the igb driver with vfio-pci we receive a stack trace:
BUG: unable to handle page fault for address: ffffc9000440b6f8
[...]
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
---
 drivers/net/ethernet/intel/igb/igb_ptp.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 6f471b91f562..56839bf65c13 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -1440,9 +1440,6 @@ void igb_ptp_sdp_init(struct igb_adapter *adapter)
  */
 void igb_ptp_suspend(struct igb_adapter *adapter)
 {
-	if (!(adapter->ptp_flags & IGB_PTP_ENABLED))
-		return;
-
 	if (adapter->ptp_flags & IGB_PTP_OVERFLOW_CHECK)
 		cancel_delayed_work_sync(&adapter->ptp_overflow_work);
 
-- 
2.17.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-08-21  5:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18 13:45 [Intel-wired-lan] [PATCH] igb: Unconditionally deallocate workqueues as allocation already does Alessio Igor Bogani
2023-07-19 21:18 ` Tony Nguyen
2023-07-20 14:50   ` [Intel-wired-lan] [PATCH] igb: Avoid starting unnecessary workqueues Alessio Igor Bogani
2023-07-21 17:15     ` Tony Nguyen
2023-08-21  5:47     ` Arland, ArpanaX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox