devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sagar Cheluvegowda <quic_scheluve@quicinc.com>
To: Andrew Halaney <ahalaney@redhat.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>,
	Russell King <linux@armlinux.org.uk>,
	"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 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: Mon, 1 Jul 2024 12:18:19 -0700	[thread overview]
Message-ID: <eb63b7c2-9485-4b11-bf73-4d38a2365f19@quicinc.com> (raw)
In-Reply-To: <fd5c86d8-4243-43d6-a07d-919ceeb12d82@quicinc.com>



On 6/28/2024 2:50 PM, Sagar Cheluvegowda wrote:
> 
> 
> On 6/26/2024 7:58 AM, Andrew Halaney wrote:
>> On Tue, Jun 25, 2024 at 04:49:30PM GMT, 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.
>>>
>>> Signed-off-by: Sagar Cheluvegowda <quic_scheluve@quicinc.com>
>>> ---
>>>  drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++++++
>>>  1 file changed, 8 insertions(+)
>>>
>>> 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);
>>> +
The above fix_mac_speed needs to be removed, i lately realized this mistake.
>>>  	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);
>>
>>
>> I think you're doing this at the beginning and end of
>> stmmac_mac_link_down(), is that intentional?
>>
>>
> 
> I realised that bringing down the clock to 10Mbps should be the last operation
> of the link down process, the reason being if we bring down the clocks first it will
> deprive essential internal clocks to DMA/MTL modules which are required for
> Cleanup operations this might cause excessive delays in stopping DMA
> or flusing MTL queues.
>  
>>

  reply	other threads:[~2024-07-01 19:19 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 [this message]
2024-06-28 22:16   ` Russell King (Oracle)
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=eb63b7c2-9485-4b11-bf73-4d38a2365f19@quicinc.com \
    --to=quic_scheluve@quicinc.com \
    --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=linux@armlinux.org.uk \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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 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).