From: Konrad Dybcio <konrad.dybcio@linaro.org>
To: Sarosh Hasan <quic_sarohasa@quicinc.com>,
Vinod Koul <vkoul@kernel.org>,
Bhupesh Sharma <bhupesh.sharma@linaro.org>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
Prasad Sodagudi <psodagud@quicinc.com>,
Andrew Halaney <ahalaney@redhat.com>,
Rob Herring <robh@kernel.org>
Cc: kernel@quicinc.com, Sneh Shah <quic_snehshah@quicinc.com>,
Suraj Jaiswal <quic_jsuraj@quicinc.com>
Subject: Re: [PATCH net-next] net: stmmac: dwmac-qcom-ethqos: Update link clock rate only for RGMII
Date: Thu, 22 Feb 2024 14:01:44 +0100 [thread overview]
Message-ID: <54b8c58a-6288-4ae6-9ed7-aa7b212e63da@linaro.org> (raw)
In-Reply-To: <20240222125517.3356-1-quic_sarohasa@quicinc.com>
On 2/22/24 13:55, Sarosh Hasan wrote:
> Updating link clock rate for different speeds is only needed when
> using RGMII, as that mode requires changing clock speed when the link
> speed changes. Let's restrict updating the link clock speed in
> ethqos_update_link_clk() to just RGMII. Other modes such as SGMII
> only need to enable the link clock (which is already done in probe).
>
> Signed-off-by: Sarosh Hasan <quic_sarohasa@quicinc.com>
> ---
> .../stmicro/stmmac/dwmac-qcom-ethqos.c | 26 ++++++++++---------
> 1 file changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 31631e3f89d0..9cd144fb3005 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -169,21 +169,23 @@ static void rgmii_dump(void *priv)
> static void
> ethqos_update_link_clk(struct qcom_ethqos *ethqos, unsigned int speed)
> {
> - switch (speed) {
> - case SPEED_1000:
> - ethqos->link_clk_rate = RGMII_1000_NOM_CLK_FREQ;
> - break;
> + if (phy_interface_mode_is_rgmii(ethqos->phy_mode)) {
> + switch (speed) {
> + case SPEED_1000:
> + ethqos->link_clk_rate = RGMII_1000_NOM_CLK_FREQ;
> + break;
>
> - case SPEED_100:
> - ethqos->link_clk_rate = RGMII_ID_MODE_100_LOW_SVS_CLK_FREQ;
> - break;
> + case SPEED_100:
> + ethqos->link_clk_rate = RGMII_ID_MODE_100_LOW_SVS_CLK_FREQ;
> + break;
>
> - case SPEED_10:
> - ethqos->link_clk_rate = RGMII_ID_MODE_10_LOW_SVS_CLK_FREQ;
> - break;
> - }
> + case SPEED_10:
> + ethqos->link_clk_rate = RGMII_ID_MODE_10_LOW_SVS_CLK_FREQ;
> + break;
> + }
>
> - clk_set_rate(ethqos->link_clk, ethqos->link_clk_rate);
> + clk_set_rate(ethqos->link_clk, ethqos->link_clk_rate);
> + }
> }
if (!phy_interface_mode_is_rgmii(ethqos->phy_mode))
return 0;
[leave the rest unchanged]
?
Konrad
next prev parent reply other threads:[~2024-02-22 13:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 12:55 [PATCH net-next] net: stmmac: dwmac-qcom-ethqos: Update link clock rate only for RGMII Sarosh Hasan
2024-02-22 13:01 ` Konrad Dybcio [this message]
2024-02-26 23:05 ` Andrew Lunn
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=54b8c58a-6288-4ae6-9ed7-aa7b212e63da@linaro.org \
--to=konrad.dybcio@linaro.org \
--cc=agross@kernel.org \
--cc=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andersson@kernel.org \
--cc=bhupesh.sharma@linaro.org \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=kernel@quicinc.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=kuba@kernel.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=psodagud@quicinc.com \
--cc=quic_jsuraj@quicinc.com \
--cc=quic_sarohasa@quicinc.com \
--cc=quic_snehshah@quicinc.com \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--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).