[PATCH net v2 0/4] net: pcs: xpcs: fix runtime PM and clock lifecycle
flat view
DORMANTno replies
From: Coia Prant <coiaprant@gmail.com>
Date: 2026-10-23 07:53:55
Also in:
linux-arm-kernel, linux-rockchip, lkml
This series fixes the runtime PM and CSR clock lifecycle in the DW XPCS
platform driver, a misleading error message in the Rockchip glue driver,
and the MAINTAINERS coverage for the platform driver and its binding.
The issue was found while using pcs-xpcs-plat.c as a reference for the
Rockchip XPCS glue driver (pcs-xpcs-rk.c). On Rockchip the CSR clock
(PCLK_XPCS) is required for register access, which exposed two problems
in the generic platform driver:
- it calls pm_runtime_set_active() before runtime PM is enabled and
before the clock is prepared/enabled, so a later suspend tries to
disable a clock that was never enabled;
- with CONFIG_PM disabled, the runtime resume path is compiled out
and the CSR clock is never enabled at all.
Patch 1 fixes the initial runtime PM status and registers a devm action
that force-suspends the device on teardown, so the clock does not leak
when the driver is removed while runtime-active.
Patch 2 handles !CONFIG_PM builds by preparing/enabling the CSR clock
manually and disabling it in the cleanup action. It also switches to
RUNTIME_PM_OPS() and pm_ptr(), which are no-ops when CONFIG_PM is
enabled, so that the runtime callbacks stay referenced and .pm is NULL
in !CONFIG_PM builds. Because the CSR clock is optional and both cases
are handled in the driver, Kconfig is left untouched and no PM
dependency is added.
Patch 3 rewords the cleanup action error message in the Rockchip glue
driver, which was merged into mainline today and currently mentions only
the EEE clock even though the action also tears down runtime PM.
Patch 4 lists pcs-xpcs-plat.c and its DT binding under the DW XPCS
entry. pcs-xpcs-plat.c currently only matches the ETHERNET PHY LIBRARY
entry, and the binding is only matched by the generic DT and networking
rules, so the entry does not cover the whole driver.
No upstream platform currently enables pcs-xpcs-plat with a real CSR
clock dependency, so neither runtime issue is reachable in mainline
today. Because of that, no Fixes: or Cc: stable tags are included, as
discussed in the v1 thread.
The patches touch code that is already in mainline: the platform driver
has been there since f6bb3e9d98c2, and the Rockchip glue driver was
merged today. They are fixes to existing code, not new drivers or new
features.
Changes in v2:
- drop Fixes: and Cc: stable, and state in the commit messages that
no upstream platform can trigger the issue;
- add a note on Kconfig: the CSR clock is optional, so there is no
need to select or depend on PM for all platforms;
- add a fix for the Rockchip glue driver error message;
- add MAINTAINERS coverage for pcs-xpcs-plat.c and its binding.
Thread v1: https://lore.kernel.org/all/20260704214808.1566710-1-coiaprant@gmail.com/ (local)
---
Coia Prant (4):
net: pcs: xpcs-plat: fix runtime PM initialization
net: pcs: xpcs-plat: fix clock lifecycle for !CONFIG_PM builds
net: pcs: xpcs-rk: fix cleanup action error message
MAINTAINERS: list DW XPCS platform driver and binding under XPCS entry
MAINTAINERS | 2 ++
drivers/net/pcs/pcs-xpcs-plat.c | 62 ++++++++++++++++++++++++++++-----
drivers/net/pcs/pcs-xpcs-rk.c | 2 +-
3 files changed, 56 insertions(+), 10 deletions(-)
--
2.47.3