lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 24 Feb 2021 09:03:00 +0000
From:   Joakim Zhang <qiangqing.zhang@....com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "peppe.cavallaro@...com" <peppe.cavallaro@...com>,
        "alexandre.torgue@...com" <alexandre.torgue@...com>,
        "joabreu@...opsys.com" <joabreu@...opsys.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH V1 net-next 0/3] net: stmmac: implement clocks


> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: 2021年2月24日 10:35
> To: Joakim Zhang <qiangqing.zhang@....com>
> Cc: peppe.cavallaro@...com; alexandre.torgue@...com;
> joabreu@...opsys.com; davem@...emloft.net; netdev@...r.kernel.org;
> dl-linux-imx <linux-imx@....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.

Hi Jakub,

I check the code, ethtool from stmmac driver only can be used when net is running now, so the clocks are enabled.
net/ethtool/ioctl.c -> dev_ethtool()
	[...]
	if (dev->ethtool_ops->begin) {
		rc = dev->ethtool_ops->begin(dev);
		if (rc < 0)
			return rc;
	}
	[...]

Stmmac driver implement begin callback like below:
	static int stmmac_check_if_running(struct net_device *dev)
	{
		if (!netif_running(dev))
			return -EBUSY;
		return 0;
	}

Best Regards,
Joakim Zhang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ