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]
Message-ID: <aQHXlbDRAu76m5by@shell.armlinux.org.uk>
Date: Wed, 29 Oct 2025 09:00:05 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Yanteng Si <si.yanteng@...ux.dev>
Cc: Yao Zi <ziyao@...root.org>, Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Huacai Chen <chenhuacai@...nel.org>,
	Philipp Stanner <phasta@...nel.org>,
	Tiezhu Yang <yangtiezhu@...ngson.cn>,
	Qunqin Zhao <zhaoqunqin@...ngson.cn>,
	Vladimir Oltean <vladimir.oltean@....com>,
	Furong Xu <0x1207@...il.com>,
	Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>,
	Jacob Keller <jacob.e.keller@...el.com>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 1/3] net: stmmac: Add generic suspend/resume
 helper for PCI-based controllers

On Wed, Oct 29, 2025 at 10:27:18AM +0800, Yanteng Si wrote:
> 在 2025/10/28 下午11:59, Russell King (Oracle) 写道:
> > On Tue, Oct 28, 2025 at 03:43:30PM +0000, Yao Zi wrote:
> > > Most glue driver for PCI-based DWMAC controllers utilize similar
> > > platform suspend/resume routines. Add a generic implementation to reduce
> > > duplicated code.
> > > 
> > > Signed-off-by: Yao Zi <ziyao@...root.org>
> > > ---
> > >   drivers/net/ethernet/stmicro/stmmac/stmmac.h  |  2 +
> > >   .../net/ethernet/stmicro/stmmac/stmmac_main.c | 37 +++++++++++++++++++
> > I would prefer not to make stmmac_main.c even larger by including bus
> > specific helpers there. We already have stmmac_pltfm.c for those which
> > use struct platform_device. The logical name would be stmmac_pci.c, but
> > that's already taken by a driver.
> > 
> > One way around that would be to rename stmmac_pci.c to dwmac-pci.c
> > (glue drivers tend to be named dwmac-foo.c) and then re-use
> > stmmac_pci.c for PCI-related stuff in the same way that stmmac_pltfm.c
> > is used.
> > 
> > Another idea would be stmmac_libpci.c.
> 
> I also don't want stmmac_main.c to grow larger, and I prefer
> stmmac_libpci.c instead. Another approach - maybe we can
> keep these helper functions in stmmac_pci.c and just declare
> them as extern where needed?

stmmac_pci.c is itself a glue driver, supporting PCI IDs:

	0x0700, 0x1108	- synthetic ID
	0x104a, 0xcc09	- ST Micro MAC
	0x16c3, 0x7102	- Synopsys GMAC5

I don't think we should try to turn a glue driver into a library,
even though it would be the easier option (we could reuse
CONFIG_STMMAC_PCI.)

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ