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: <okbvyvjjww5mvwj2ogrphfsy66gx2bjn4fl27vywbl52gdgwe5@aps4umive6lk>
Date: Wed, 13 Sep 2023 03:56:07 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Jose Abreu <Jose.Abreu@...opsys.com>, 
	Alexandre Torgue <alexandre.torgue@...s.st.com>, Alexei Starovoitov <ast@...nel.org>, 
	"bpf@...r.kernel.org" <bpf@...r.kernel.org>, Daniel Borkmann <daniel@...earbox.net>, 
	"David S. Miller" <davem@...emloft.net>, Emil Renner Berthing <kernel@...il.dk>, 
	Eric Dumazet <edumazet@...gle.com>, Fabio Estevam <festevam@...il.com>, 
	Jakub Kicinski <kuba@...nel.org>, Jesper Dangaard Brouer <hawk@...nel.org>, 
	John Fastabend <john.fastabend@...il.com>, 
	"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>, 
	"linux-stm32@...md-mailman.stormreply.com" <linux-stm32@...md-mailman.stormreply.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>, 
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>, NXP Linux Team <linux-imx@....com>, 
	Paolo Abeni <pabeni@...hat.com>, Pengutronix Kernel Team <kernel@...gutronix.de>, 
	Samin Guo <samin.guo@...rfivetech.com>, Sascha Hauer <s.hauer@...gutronix.de>, 
	Shawn Guo <shawnguo@...nel.org>
Subject: Re: [PATCH net-next 1/6] net: stmmac: add platform library

On Tue, Sep 12, 2023 at 06:08:23PM +0100, Russell King (Oracle) wrote:
> On Tue, Sep 12, 2023 at 12:32:40PM +0300, Serge Semin wrote:
> > On Tue, Sep 12, 2023 at 07:59:49AM +0000, Jose Abreu wrote:
> > > From: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> > > Date: Mon, Sep 11, 2023 at 16:28:40
> > > 
> > > > Add a platform library of helper functions for common traits in the
> > > > platform drivers. Currently, this is setting the tx clock.
> > > > 
> > > > Signed-off-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> > > > ---
> > 
> > > >  drivers/net/ethernet/stmicro/stmmac/Makefile  |  2 +-
> > > >  .../ethernet/stmicro/stmmac/stmmac_plat_lib.c | 29 +++++++++++++++++++
> > > >  .../ethernet/stmicro/stmmac/stmmac_plat_lib.h |  8 +++++
> > > 
> > > Wouldn't it be better to just call it "stmmac_lib{.c,.h}" in case we need to add
> > > more helpers on the future that are not only for platform-based drivers?
> > 
> > What is the difference between stmmac_platform.{c,h} and
> > stmmac_plat_lib.{c,h} files? It isn't clear really. In perspective it
> > may cause confusions like mixed definitions in both of these files.
> > 
> > Why not to use the stmmac_platform.{c,h} instead of adding one more
> > file?
> 

> Is stmmac_platform.{c,h} used by all the drivers that are making use of
> this? I'm not entirely sure.
> 
> If it is, then yes, it can go in stmmac_platform.[ch]. If not, then I
> don't think we'd want the bloat of forcing all of stmmac_platform.[ch]
> onto drivers that only want to use this one function.

With a few exceptions almost all the STMMAC/DW*MAC glue drivers use
the methods from the stmmac_platform.c module including the bits
touched by your patchset. AFAICS semantically both stmmac_platform.c
and stmmac_plat_lib.c look the same. They don't do anything on its own
but provide some common methods utilized by the glue drivers for some
platform-specific setups. So basically stmmac_platform.[ch] is already
a library of the common platform methods. There is no need in creating
another one.

-Serge(y)

> 
> -- 
> 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