netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Joakim Zhang <qiangqing.zhang@nxp.com>, Jakub Kicinski <kuba@kernel.org>
Cc: "peppe.cavallaro@st.com" <peppe.cavallaro@st.com>,
	"alexandre.torgue@st.com" <alexandre.torgue@st.com>,
	"joabreu@synopsys.com" <joabreu@synopsys.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH V1 net-next 0/3] net: stmmac: implement clocks
Date: Tue, 23 Feb 2021 19:54:17 -0800	[thread overview]
Message-ID: <7866cb18-b50e-7e1f-545a-86f4678f868b@gmail.com> (raw)
In-Reply-To: <DB8PR04MB6795C1D02AAB9F01571AFED9E69F9@DB8PR04MB6795.eurprd04.prod.outlook.com>



On 2/23/2021 6:47 PM, Joakim Zhang wrote:
> 
>> -----Original Message-----
>> From: Jakub Kicinski <kuba@kernel.org>
>> Sent: 2021年2月24日 10:35
>> To: Joakim Zhang <qiangqing.zhang@nxp.com>
>> Cc: peppe.cavallaro@st.com; alexandre.torgue@st.com;
>> joabreu@synopsys.com; davem@davemloft.net; netdev@vger.kernel.org;
>> dl-linux-imx <linux-imx@nxp.com>
>> Subject: Re: [PATCH V1 net-next 0/3] net: stmmac: implement clocks
>>
>> On Wed, 24 Feb 2021 02:13:05 +0000 Joakim Zhang wrote:
>>>>> The aim is to enable clocks when it needs, others keep clocks disabled.
>>>>
>>>> Understood. Please double check ethtool callbacks work fine. People
>>>> often forget about those when disabling clocks in .close.
>>>
>>> Hi Jakub,
>>>
>>> If NIC is open then clocks are always enabled, so all ethtool
>>> callbacks should be okay.
>>>
>>> Could you point me which ethtool callbacks could be invoked when NIC
>>> is closed? I'm not very familiar with ethtool use case. Thanks.
>>
>> Well, all of them - ethtool does not check if the device is open.
>> User can access and configure the device when it's closed.
>> Often the callbacks access only driver data, but it's implementation specific so
>> you'll need to validate the callbacks stmmac implements.
> 
> Thanks Jakub, I will check these callbacks.

You can implement ethtool_ops::begin and ethtool_ops::complete where you
would enable the clock, and respectively disable it just for the time of
the operation. The ethtool framework guarantees that begin is called at
the beginning and complete at the end. You can also make sure that if
the interface is disabled you only return a cached copy of the
settings/MIB counters (they are not updating since the HW is disabled)
and conversely only store parameters in a cached structure and apply
those when the network device gets opened again. Either way would work.
-- 
Florian

  reply	other threads:[~2021-02-24  3:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 10:48 [PATCH V1 net-next 0/3] net: stmmac: implement clocks Joakim Zhang
2021-02-23 10:48 ` [PATCH V1 net-next 1/3] net: stmmac: add clocks management for gmac driver Joakim Zhang
2021-02-23 16:46   ` Jakub Kicinski
2021-02-24  1:46     ` Joakim Zhang
2021-02-23 10:48 ` [PATCH V1 net-next 2/3] net: stmmac: add platform level clocks management Joakim Zhang
2021-02-23 10:48 ` [PATCH V1 net-next 3/3] net: stmmac: add platform level clocks management for i.MX Joakim Zhang
2021-02-23 16:45 ` [PATCH V1 net-next 0/3] net: stmmac: implement clocks Jakub Kicinski
2021-02-24  1:45   ` Joakim Zhang
2021-02-24  1:54     ` Jakub Kicinski
2021-02-24  2:13       ` Joakim Zhang
2021-02-24  2:34         ` Jakub Kicinski
2021-02-24  2:47           ` Joakim Zhang
2021-02-24  3:54             ` Florian Fainelli [this message]
2021-02-25  1:42               ` Joakim Zhang
2021-02-24  9:03           ` Joakim Zhang
2021-02-24 13:01       ` Andrew Lunn
2021-02-25  2:15         ` Joakim Zhang
     [not found]         ` <DB8PR04MB6795FAE4C1736AABDCA75FA7E69E9@DB8PR04MB6795.eurprd04.prod.outlook.com>
2021-02-25  2:33           ` Andrew Lunn
2021-02-25 11:48             ` Joakim Zhang
2021-02-25 13:14               ` 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=7866cb18-b50e-7e1f-545a-86f4678f868b@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=qiangqing.zhang@nxp.com \
    /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).