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] [day] [month] [year] [list]
Message-ID: <VI1PR04MB68007DC1F11B5A0991BE02E7E6E19@VI1PR04MB6800.eurprd04.prod.outlook.com>
Date:   Mon, 19 Jul 2021 08:52:19 +0000
From:   Joakim Zhang <qiangqing.zhang@....com>
To:     Hao Chen <chenhaoa@...ontech.com>,
        "peppe.cavallaro@...com" <peppe.cavallaro@...com>
CC:     "alexandre.torgue@...s.st.com" <alexandre.torgue@...s.st.com>,
        "joabreu@...opsys.com" <joabreu@...opsys.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "mcoquelin.stm32@...il.com" <mcoquelin.stm32@...il.com>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-stm32@...md-mailman.stormreply.com" 
        <linux-stm32@...md-mailman.stormreply.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] net: stmmac: fix 'ethtool -P' return -EBUSY


> -----Original Message-----
> From: Hao Chen <chenhaoa@...ontech.com>
> Sent: 2021年7月19日 15:44
> To: peppe.cavallaro@...com
> Cc: alexandre.torgue@...s.st.com; joabreu@...opsys.com;
> davem@...emloft.net; kuba@...nel.org; mcoquelin.stm32@...il.com;
> linux@...linux.org.uk; netdev@...r.kernel.org;
> linux-stm32@...md-mailman.stormreply.com; linux-kernel@...r.kernel.org;
> Hao Chen <chenhaoa@...ontech.com>
> Subject: [PATCH v2] net: stmmac: fix 'ethtool -P' return -EBUSY
> 
> The permanent mac address should be available for query when the device is
> not up.
> NetworkManager, the system network daemon, uses 'ethtool -P' to obtain the
> permanent address after the kernel start. When the network device is not up,
> it will return the device busy error with 'ethtool -P'. At that time, it is unable to
> access the Internet through the permanent address by NetworkManager.
> I think that the '.begin' is not used to check if the device is up.
> 
> Signed-off-by: Hao Chen <chenhaoa@...ontech.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> index d0ce608b81c3..7ccb0d738a1c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> @@ -412,8 +412,10 @@ static void stmmac_ethtool_setmsglevel(struct
> net_device *dev, u32 level)
> 
>  static int stmmac_check_if_running(struct net_device *dev)  {
> -	if (!netif_running(dev))
> -		return -EBUSY;
> +	struct stmmac_priv *priv = netdev_priv(dev);
> +
> +	pm_runtime_get_sync(priv->device);
> +
>  	return 0;
>  }

After this code change, clocks always enabled even the NIC is not up, it's not good.
Should implement .complete() to disable clocks after the info you got?

Best Regards,
Joakim Zhang
> 
> --
> 2.20.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ