linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/3] Unify platform suspend/resume routines for PCI DWMAC glue
@ 2025-10-30  4:19 Yao Zi
  2025-10-30  4:19 ` [PATCH net-next v2 1/3] net: stmmac: Add generic suspend/resume helper for PCI-based controllers Yao Zi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Yao Zi @ 2025-10-30  4:19 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Yanteng Si, Huacai Chen, Russell King (Oracle),
	Philipp Stanner, Tiezhu Yang, Qunqin Zhao, Yao Zi,
	Vladimir Oltean, Furong Xu, Kunihiko Hayashi, Jacob Keller
  Cc: netdev, linux-kernel

There are currently three PCI-based DWMAC glue drivers in tree,
stmmac_pci.c, dwmac-intel.c, and dwmac-loongson.c. Both stmmac_pci.c and
dwmac-intel.c implements the same and duplicated platform suspend/resume
routines.

This series introduces a new PCI helper library, stmmac_libpci.c,
providing a pair of helpers, stmmac_pci_plat_{suspend,resume}, and
replaces the driver-specific implementation with the helpers to reduce
code duplication. The helper will also simplify the Motorcomm DWMAC glue
driver which I'm working on.

The glue driver for Intel controllers isn't covered by the series, since
its suspend routine doesn't call pci_disable_device() and thus is a
little different from the new generic helpers.

I only have Loongson hardware on hand, thus the series is only tested on
Loongson 3A5000 machine. I could confirm the controller works after
resume, and WoL works as expected. This shouldn't break stmmac_pci.c,
either, since the new helpers have the exactly same code as the old
driver-specific suspend/resume hooks.

Changed from v1
- Separate the new suspend/resume helpers into a new file,
  stmmac_libpci.c, and provide Kconfig symbol for it
- Link to v1: https://lore.kernel.org/netdev/20251028154332.59118-1-ziyao@disroot.org/

Yao Zi (3):
  net: stmmac: Add generic suspend/resume helper for PCI-based
    controllers
  net: stmmac: loongson: Use generic PCI suspend/resume routines
  net: stmmac: pci: Use generic PCI suspend/resume routines

 drivers/net/ethernet/stmicro/stmmac/Kconfig   | 11 +++++
 drivers/net/ethernet/stmicro/stmmac/Makefile  |  1 +
 .../ethernet/stmicro/stmmac/dwmac-loongson.c  | 36 ++------------
 .../ethernet/stmicro/stmmac/stmmac_libpci.c   | 48 +++++++++++++++++++
 .../ethernet/stmicro/stmmac/stmmac_libpci.h   | 12 +++++
 .../net/ethernet/stmicro/stmmac/stmmac_pci.c  | 36 ++------------
 6 files changed, 78 insertions(+), 66 deletions(-)
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_libpci.c
 create mode 100644 drivers/net/ethernet/stmicro/stmmac/stmmac_libpci.h

-- 
2.51.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-10-31  4:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30  4:19 [PATCH net-next v2 0/3] Unify platform suspend/resume routines for PCI DWMAC glue Yao Zi
2025-10-30  4:19 ` [PATCH net-next v2 1/3] net: stmmac: Add generic suspend/resume helper for PCI-based controllers Yao Zi
2025-10-30  4:19 ` [PATCH net-next v2 2/3] net: stmmac: loongson: Use generic PCI suspend/resume routines Yao Zi
2025-10-30  7:38   ` Maxime Chevallier
2025-10-30  9:11     ` Yao Zi
2025-10-30  9:30     ` Russell King (Oracle)
2025-10-31  4:24       ` Yao Zi
2025-10-30  4:19 ` [PATCH net-next v2 3/3] net: stmmac: pci: " Yao Zi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).