All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Yanteng Si <si.yanteng@linux.dev>,
	"Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Huacai Chen <chenhuacai@kernel.org>,
	Philipp Stanner <phasta@kernel.org>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Qunqin Zhao <zhaoqunqin@loongson.cn>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Furong Xu <0x1207@gmail.com>,
	Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	Jacob Keller <jacob.e.keller@intel.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/3] net: stmmac: Add generic suspend/resume helper for PCI-based controllers
Date: Wed, 29 Oct 2025 02:50:50 +0000	[thread overview]
Message-ID: <aQGA8b5Il-U2IlJi@pie> (raw)
In-Reply-To: <91de05f5-3475-45eb-bbf7-162365186297@linux.dev>

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@disroot.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.

Okay, then I'll separate the code into stmmac_libpci.c instead. This
also avoids moving code around, making it easier to track git log in the
future.

> 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 a standalone DWMAC glue driver, none of its symbols are
for external usage. I don't think it's appropriate to put these helpers
in the driver. Furthermore, this will also require PCI-based glues
making use of these helpers to depend on an unrelated driver,
introducing unnecessary code size, which doesn't sound like a good idea
to me.

I'd still like to introduce stmmac_libpci.c for these helpers.

> Thanks,
> 
> Yanteng
> 
> > 

Best regards,
Yao Zi

  reply	other threads:[~2025-10-29  2:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-28 15:43 [PATCH net-next 0/3] Unify platform suspend/resume routines for PCI DWMAC glue Yao Zi
2025-10-28 15:43 ` [PATCH net-next 1/3] net: stmmac: Add generic suspend/resume helper for PCI-based controllers Yao Zi
2025-10-28 15:59   ` Russell King (Oracle)
2025-10-29  2:27     ` Yanteng Si
2025-10-29  2:50       ` Yao Zi [this message]
2025-10-29  9:00       ` Russell King (Oracle)
2025-10-29  9:07         ` Yanteng Si
2025-10-28 15:43 ` [PATCH net-next 2/3] net: stmmac: loongson: Use generic PCI suspend/resume routines Yao Zi
2025-10-28 15:43 ` [PATCH net-next 3/3] net: stmmac: pci: " Yao Zi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aQGA8b5Il-U2IlJi@pie \
    --to=ziyao@disroot.org \
    --cc=0x1207@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=chenhuacai@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=jacob.e.keller@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phasta@kernel.org \
    --cc=si.yanteng@linux.dev \
    --cc=vladimir.oltean@nxp.com \
    --cc=yangtiezhu@loongson.cn \
    --cc=zhaoqunqin@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.