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]
Date:   Mon, 9 Jan 2023 16:28:00 -0800
From:   Jakub Kicinski <kuba@...nel.org>
To:     Leon Romanovsky <leon@...nel.org>
Cc:     Lorenzo Bianconi <lorenzo@...nel.org>, netdev@...r.kernel.org,
        davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
        lorenzo.bianconi@...hat.com, nbd@....name, john@...ozen.org,
        sean.wang@...iatek.com, Mark-MC.Lee@...iatek.com,
        sujuan.chen@...iatek.com, daniel@...rotopia.org
Subject: Re: [PATCH v3 net-next 3/5] net: ethernet: mtk_eth_soc: align reset
 procedure to vendor sdk

On Sun, 8 Jan 2023 15:44:09 +0200 Leon Romanovsky wrote:
> On Sat, Jan 07, 2023 at 03:50:52PM +0100, Lorenzo Bianconi wrote:
> > Avoid to power-down the ethernet chip during hw reset and align reset
> > procedure to vendor sdk.
> > 
> > Tested-by: Daniel Golle <daniel@...rotopia.org>
> > Co-developed-by: Sujuan Chen <sujuan.chen@...iatek.com>
> > Signed-off-by: Sujuan Chen <sujuan.chen@...iatek.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> > ---
> >  drivers/net/ethernet/mediatek/mtk_eth_soc.c  | 94 +++++++++++++++-----
> >  drivers/net/ethernet/mediatek/mtk_eth_soc.h  | 12 +++
> >  drivers/net/ethernet/mediatek/mtk_ppe.c      | 27 ++++++
> >  drivers/net/ethernet/mediatek/mtk_ppe.h      |  1 +
> >  drivers/net/ethernet/mediatek/mtk_ppe_regs.h |  6 ++
> >  5 files changed, 116 insertions(+), 24 deletions(-)  
> 
> mdelay is macro wrapper around udelay, to account for possible overflow when
> passing large arguments to udelay. In general, use of mdelay is discouraged
> and code should be refactored to allow for the use of msleep.
> 
> https://www.kernel.org/doc/html/latest/timers/timers-howto.html#delays-information-on-the-various-kern
> 
> It is not your case as you are passing small numbers and can use udelay instead.

Good point, there's one:

	mdelay(100)

in the series which is a lot of time to be spinning blocking a core :S

In this particular patch you basically:

	rtnl_lock();
	mdelay(10);
	..
	mdelay(15);

which seems odd. If you can take rtnl you can sleep, so perhaps this is
trying to be competence-compatible with the vendor driver unnecessarily?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ