[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230711205732.364954-4-ahalaney@redhat.com>
Date: Tue, 11 Jul 2023 15:35:32 -0500
From: Andrew Halaney <ahalaney@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com, netdev@...r.kernel.org,
mcoquelin.stm32@...il.com, pabeni@...hat.com, kuba@...nel.org,
edumazet@...gle.com, davem@...emloft.net, joabreu@...opsys.com,
alexandre.torgue@...s.st.com, peppe.cavallaro@...com,
bhupesh.sharma@...aro.org, vkoul@...nel.org,
linux-arm-msm@...r.kernel.org, jsuraj@....qualcomm.com,
Andrew Halaney <ahalaney@...hat.com>
Subject: [PATCH RFC/RFT net-next 3/3] net: stmmac: Use the max frequency possible for clk_ptp_ref
Using the max frequency allows for the best PTP timestamping resolution,
so let's default to that.
Signed-off-by: Andrew Halaney <ahalaney@...hat.com>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 231152ee5a32..c9a27a71a3f4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -602,6 +602,11 @@ stmmac_probe_config_dt(struct platform_device *pdev, u8 *mac)
plat->clk_ptp_ref = NULL;
dev_info(&pdev->dev, "PTP uses main clock\n");
} else {
+ /* Get the best resolution possible */
+ rc = clk_set_rate(plat->clk_ptp_ref, ULONG_MAX);
+ if (rc)
+ dev_err(&pdev->dev,
+ "Failed to set clk_ptp_ref rate: %d\n", rc);
plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref);
dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate);
}
--
2.41.0
Powered by blists - more mailing lists