From: Andrew Halaney <ahalaney@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com, netdev@vger.kernel.org,
mcoquelin.stm32@gmail.com, pabeni@redhat.com, kuba@kernel.org,
edumazet@google.com, davem@davemloft.net, joabreu@synopsys.com,
alexandre.torgue@foss.st.com, peppe.cavallaro@st.com,
bhupesh.sharma@linaro.org, vkoul@kernel.org,
linux-arm-msm@vger.kernel.org, jsuraj@qti.qualcomm.com,
Andrew Halaney <ahalaney@redhat.com>
Subject: [PATCH RFC/RFT net-next 3/3] net: stmmac: Use the max frequency possible for clk_ptp_ref
Date: Tue, 11 Jul 2023 15:35:32 -0500 [thread overview]
Message-ID: <20230711205732.364954-4-ahalaney@redhat.com> (raw)
In-Reply-To: <20230711205732.364954-1-ahalaney@redhat.com>
Using the max frequency allows for the best PTP timestamping resolution,
so let's default to that.
Signed-off-by: Andrew Halaney <ahalaney@redhat.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
next prev parent reply other threads:[~2023-07-11 20:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-11 20:35 [PATCH RFC/RFT net-next 0/3] net: stmmac: Increase clk_ptp_ref rate Andrew Halaney
2023-07-11 20:35 ` [PATCH RFC/RFT net-next 1/3] net: stmmac: Make ptp_clk_freq_config variable type explicit Andrew Halaney
2023-07-13 9:56 ` Simon Horman
2023-07-11 20:35 ` [PATCH RFC/RFT net-next 2/3] net: stmmac: dwmac-qcom-ethqos: Use max frequency for clk_ptp_ref Andrew Halaney
2023-07-13 9:57 ` Simon Horman
2023-07-11 20:35 ` Andrew Halaney [this message]
2023-07-13 9:58 ` [PATCH RFC/RFT net-next 3/3] net: stmmac: Use the max frequency possible " Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230711205732.364954-4-ahalaney@redhat.com \
--to=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=bhupesh.sharma@linaro.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=jsuraj@qti.qualcomm.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peppe.cavallaro@st.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).