From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Sagar Cheluvegowda <quic_scheluve@quicinc.com>
Cc: Vinod Koul <vkoul@kernel.org>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Jose Abreu <joabreu@synopsys.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Bhupesh Sharma <bhupesh.sharma@linaro.org>,
kernel@quicinc.com, Andrew Halaney <ahalaney@redhat.com>,
Andrew Lunn <andrew@lunn.ch>,
linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 3/3] net: stmmac: Bring down the clocks to lower frequencies when mac link goes down
Date: Fri, 28 Jun 2024 23:16:53 +0100 [thread overview]
Message-ID: <Zn82VaTQBe0LkhSa@shell.armlinux.org.uk> (raw)
In-Reply-To: <20240625-icc_bw_voting_from_ethqos-v2-3-eaa7cf9060f0@quicinc.com>
On Tue, Jun 25, 2024 at 04:49:30PM -0700, Sagar Cheluvegowda wrote:
> When mac link goes down we don't need to mainitain the clocks to operate
> at higher frequencies, as an optimized solution to save power when
> the link goes down we are trying to bring down the clocks to the
> frequencies corresponding to the lowest speed possible.
I thought I had already commented on a similar patch, but I can't find
anything in my mailboxes to suggest I had.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index ec7c61ee44d4..f0166f0bc25f 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -996,6 +996,9 @@ static void stmmac_mac_link_down(struct phylink_config *config,
> {
> struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
>
> + if (priv->plat->fix_mac_speed)
> + priv->plat->fix_mac_speed(priv->plat->bsp_priv, SPEED_10, mode);
> +
> stmmac_mac_set(priv, priv->ioaddr, false);
> priv->eee_active = false;
> priv->tx_lpi_enabled = false;
> @@ -1004,6 +1007,11 @@ static void stmmac_mac_link_down(struct phylink_config *config,
>
> if (priv->dma_cap.fpesel)
> stmmac_fpe_link_state_handle(priv, false);
> +
> + stmmac_set_icc_bw(priv, SPEED_10);
> +
> + if (priv->plat->fix_mac_speed)
> + priv->plat->fix_mac_speed(priv->plat->bsp_priv, SPEED_10, mode);
Two things here:
1) Why do we need to call fix_mac_speed() at the start and end of this
stmmac_mac_link_down()?
2) What if the MAC doesn't support 10M operation? For example, dwxgmac2
and dwxlgmac2 do not support anything below 1G. It feels that this
is storing up a problem for the future, where a platform that uses
e.g. xlgmac2 also implements fix_mac_speed() and then gets a
surprise when it's called with SPEED_10.
Personally, I don't like "fix_mac_speed", and I don't like it even more
with this change. I would prefer to see link_up/link_down style
operations so that platforms can do whatever they need to on those
events, rather than being told what to do by a single call that may
look identical irrespective of whether the link came up or went down.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2024-06-28 22:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-25 23:49 [PATCH v2 0/3] Add interconnect support for stmmac driver Sagar Cheluvegowda
2024-06-25 23:49 ` [PATCH v2 1/3] dt-bindings: net: qcom: ethernet: Add interconnect properties Sagar Cheluvegowda
2024-06-26 7:39 ` Krzysztof Kozlowski
2024-06-26 14:53 ` Andrew Halaney
2024-07-02 18:50 ` Sagar Cheluvegowda
2024-06-25 23:49 ` [PATCH v2 2/3] net: stmmac: Add interconnect support Sagar Cheluvegowda
2024-06-26 7:40 ` Krzysztof Kozlowski
2024-06-28 19:43 ` Sagar Cheluvegowda
2024-06-28 20:12 ` Andrew Lunn
2024-06-26 13:07 ` Andrew Lunn
2024-06-26 23:36 ` Sagar Cheluvegowda
2024-06-27 0:12 ` Andrew Lunn
2024-06-28 21:58 ` Sagar Cheluvegowda
2024-06-28 22:23 ` Andrew Lunn
2024-06-28 22:41 ` Sagar Cheluvegowda
2024-06-26 14:54 ` Andrew Halaney
2024-06-26 23:38 ` Sagar Cheluvegowda
2024-06-27 0:14 ` Andrew Lunn
2024-06-28 19:55 ` Sagar Cheluvegowda
2024-06-25 23:49 ` [PATCH v2 3/3] net: stmmac: Bring down the clocks to lower frequencies when mac link goes down Sagar Cheluvegowda
2024-06-26 14:58 ` Andrew Halaney
2024-06-26 15:10 ` Andrew Lunn
2024-06-28 21:50 ` Sagar Cheluvegowda
2024-07-01 19:18 ` Sagar Cheluvegowda
2024-06-28 22:16 ` Russell King (Oracle) [this message]
2024-07-02 23:38 ` Sagar Cheluvegowda
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=Zn82VaTQBe0LkhSa@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew@lunn.ch \
--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=krzk+dt@kernel.org \
--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=quic_scheluve@quicinc.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.