Skip to content

Commit a479a27

Browse files
tdh911kuba-moo
authored andcommitted
gve: Move gve_init_clock to after AQ CONFIGURE_DEVICE_RESOURCES call
commit 46e7860 ("gve: Move ptp_schedule_worker to gve_init_clock") moved the first invocation of the AQ command REPORT_NIC_TIMESTAMP to gve_probe(). However, gve_init_clock() invoking REPORT_NIC_TIMESTAMP is not valid until after gve_probe() invokes the AQ command CONFIGURE_DEVICE_RESOURCES. Failure to do so results in the following error: gve 0000:00:07.0: failed to read NIC clock -11 This was missed earlier because the driver under test was loaded at runtime instead of boot-time. The boot-time driver had already initialized the device, causing the runtime driver to successfully call gve_init_clock() incorrectly. Fixes: 46e7860 ("gve: Move ptp_schedule_worker to gve_init_clock") Reviewed-by: Ankit Garg <nktgrg@google.com> Signed-off-by: Tim Hostetler <thostet@google.com> Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/20251202200207.1434749-1-hramamurthy@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent dd75c72 commit a479a27

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

drivers/net/ethernet/google/gve/gve_main.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -647,12 +647,9 @@ static int gve_setup_device_resources(struct gve_priv *priv)
647647
err = gve_alloc_counter_array(priv);
648648
if (err)
649649
goto abort_with_rss_config_cache;
650-
err = gve_init_clock(priv);
651-
if (err)
652-
goto abort_with_counter;
653650
err = gve_alloc_notify_blocks(priv);
654651
if (err)
655-
goto abort_with_clock;
652+
goto abort_with_counter;
656653
err = gve_alloc_stats_report(priv);
657654
if (err)
658655
goto abort_with_ntfy_blocks;
@@ -683,10 +680,16 @@ static int gve_setup_device_resources(struct gve_priv *priv)
683680
}
684681
}
685682

683+
err = gve_init_clock(priv);
684+
if (err) {
685+
dev_err(&priv->pdev->dev, "Failed to init clock");
686+
goto abort_with_ptype_lut;
687+
}
688+
686689
err = gve_init_rss_config(priv, priv->rx_cfg.num_queues);
687690
if (err) {
688691
dev_err(&priv->pdev->dev, "Failed to init RSS config");
689-
goto abort_with_ptype_lut;
692+
goto abort_with_clock;
690693
}
691694

692695
err = gve_adminq_report_stats(priv, priv->stats_report_len,
@@ -698,15 +701,15 @@ static int gve_setup_device_resources(struct gve_priv *priv)
698701
gve_set_device_resources_ok(priv);
699702
return 0;
700703

704+
abort_with_clock:
705+
gve_teardown_clock(priv);
701706
abort_with_ptype_lut:
702707
kvfree(priv->ptype_lut_dqo);
703708
priv->ptype_lut_dqo = NULL;
704709
abort_with_stats_report:
705710
gve_free_stats_report(priv);
706711
abort_with_ntfy_blocks:
707712
gve_free_notify_blocks(priv);
708-
abort_with_clock:
709-
gve_teardown_clock(priv);
710713
abort_with_counter:
711714
gve_free_counter_array(priv);
712715
abort_with_rss_config_cache:

0 commit comments

Comments
 (0)