diff mbox series

[1/2] Revert "igc: fix a log entry using uninitialized netdev"

Message ID 20240601050601.1782063-2-mika.westerberg@linux.intel.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series igc: fix BUG() during the driver probe | expand

Checks

Context Check Description
netdev/series_format warning Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 901 this patch: 901
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 2 maintainers not CCed: richardcochran@gmail.com intel-wired-lan@lists.osuosl.org
netdev/build_clang success Errors and warnings before: 905 this patch: 905
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 905 this patch: 905
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 17 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 29 this patch: 29
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-06-01--15-00 (tests: 1040)

Commit Message

Mika Westerberg June 1, 2024, 5:06 a.m. UTC
This reverts commit 86167183a17e03ec77198897975e9fdfbd53cb0b.

The commit in question moved call to igc_ptp_init() to happen after
igc_reset() which calls igc_ptp_reset() with the spinlock not yet
initialized so we get following splat:

 BUG: spinlock bad magic on CPU#4, udevd/249
  lock: 0xffff98f317e6d4b0, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
 CPU: 4 PID: 249 Comm: udevd Not tainted 6.10.0-rc1+ #1312
 Call Trace:
  <TASK>
  dump_stack_lvl+0x6c/0x90
  dump_stack+0x10/0x20
  spin_bug+0x8c/0xc0
  do_raw_spin_lock+0x6c/0xc0
  _raw_spin_lock_irqsave+0x30/0x40
  igc_ptp_clear_tx_tstamp+0x2e/0xc0 [igc]
  igc_ptp_set_timestamp_mode+0x191/0x280 [igc]
  igc_ptp_reset+0x33/0x230 [igc]
  igc_reset+0xba/0x100 [igc]
  igc_probe+0x7d1/0xa10 [igc]

It is likely that there are other things igc_ptp_init() does that are
required by igc_ptp_reset(), so for this reason revert the commit in
question.

Fixes: 86167183a17e ("igc: fix a log entry using uninitialized netdev")
Cc: Corinna Vinschen <vinschen@redhat.com>
Cc: Hariprasad Kelam <hkelam@marvell.com>
Cc: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Cc: Naama Meir <naamax.meir@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/net/ethernet/intel/igc/igc_main.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Thorsten Leemhuis June 1, 2024, 6:16 a.m. UTC | #1
On 01.06.24 07:06, Mika Westerberg wrote:
> This reverts commit 86167183a17e03ec77198897975e9fdfbd53cb0b.

TWIMC, Sasha Neftin already submitted a revert for that commit on Wednesday:
https://lore.kernel.org/all/20240529051307.3094901-1-sasha.neftin@intel.com/

Regression reports for this problem I'm tracking:
https://lore.kernel.org/lkml/CABXGCsOkiGxAfA9tPKjYX7wqjBZQxqK2PzTcW-RgLfgo8G74EQ@mail.gmail.com/
https://lore.kernel.org/intel-gfx/87o78rmkhu.fsf@intel.com/

Ciao, Thorsten
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 12f004f46082..ace2fbfd87d6 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -7028,6 +7028,8 @@  static int igc_probe(struct pci_dev *pdev,
 	device_set_wakeup_enable(&adapter->pdev->dev,
 				 adapter->flags & IGC_FLAG_WOL_SUPPORTED);
 
+	igc_ptp_init(adapter);
+
 	igc_tsn_clear_schedule(adapter);
 
 	/* reset the hardware with the new settings */
@@ -7049,9 +7051,6 @@  static int igc_probe(struct pci_dev *pdev,
 	/* Check if Media Autosense is enabled */
 	adapter->ei = *ei;
 
-	/* do hw tstamp init after resetting */
-	igc_ptp_init(adapter);
-
 	/* print pcie link status and MAC address */
 	pcie_print_link_status(pdev);
 	netdev_info(netdev, "MAC: %pM\n", netdev->dev_addr);