Commit a479a27f authored by Tim Hostetler's avatar Tim Hostetler Committed by Jakub Kicinski
Browse files

gve: Move gve_init_clock to after AQ CONFIGURE_DEVICE_RESOURCES call



commit 46e7860e ("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: 46e7860e ("gve: Move ptp_schedule_worker to gve_init_clock")
Reviewed-by: default avatarAnkit Garg <nktgrg@google.com>
Signed-off-by: default avatarTim Hostetler <thostet@google.com>
Signed-off-by: default avatarHarshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251202200207.1434749-1-hramamurthy@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent dd75c723
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -647,12 +647,9 @@ static int gve_setup_device_resources(struct gve_priv *priv)
	err = gve_alloc_counter_array(priv);
	if (err)
		goto abort_with_rss_config_cache;
	err = gve_init_clock(priv);
	if (err)
		goto abort_with_counter;
	err = gve_alloc_notify_blocks(priv);
	if (err)
		goto abort_with_clock;
		goto abort_with_counter;
	err = gve_alloc_stats_report(priv);
	if (err)
		goto abort_with_ntfy_blocks;
@@ -683,10 +680,16 @@ static int gve_setup_device_resources(struct gve_priv *priv)
		}
	}

	err = gve_init_clock(priv);
	if (err) {
		dev_err(&priv->pdev->dev, "Failed to init clock");
		goto abort_with_ptype_lut;
	}

	err = gve_init_rss_config(priv, priv->rx_cfg.num_queues);
	if (err) {
		dev_err(&priv->pdev->dev, "Failed to init RSS config");
		goto abort_with_ptype_lut;
		goto abort_with_clock;
	}

	err = gve_adminq_report_stats(priv, priv->stats_report_len,
@@ -698,6 +701,8 @@ static int gve_setup_device_resources(struct gve_priv *priv)
	gve_set_device_resources_ok(priv);
	return 0;

abort_with_clock:
	gve_teardown_clock(priv);
abort_with_ptype_lut:
	kvfree(priv->ptype_lut_dqo);
	priv->ptype_lut_dqo = NULL;
@@ -705,8 +710,6 @@ static int gve_setup_device_resources(struct gve_priv *priv)
	gve_free_stats_report(priv);
abort_with_ntfy_blocks:
	gve_free_notify_blocks(priv);
abort_with_clock:
	gve_teardown_clock(priv);
abort_with_counter:
	gve_free_counter_array(priv);
abort_with_rss_config_cache: