From: Xuanqiang Luo <xuanqiang.luo@linux.dev>
To: netdev@vger.kernel.org, andrew@lunn.ch
Cc: kuba@kernel.org, richardcochran@gmail.com, hkallweit1@gmail.com,
linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, maxime.chevallier@bootlin.com,
luoxuanqiang@kylinos.cn
Subject: [PATCH net v6 0/4] net: phy: dp83640: fix shared clock lifetime and probe error cleanup
Date: Tue, 11 Aug 2026 23:13:41 +0800 [thread overview]
Message-ID: <20260811151345.73582-1-xuanqiang.luo@linux.dev> (raw)
From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
The DP83640 driver shares one PTP clock between all PHYs on the same MII
bus.
Its driver-local clock lookup and removal scheme can leak the shared clock
on probe failure or free it while another probe is acquiring it.
This series moves the shared clock to the PHY package infrastructure.
Patch 1 adds PHY package locking helpers.
Patch 2 embeds the pin configuration in the shared clock.
Patch 3 clears per-PHY state when PTP clock registration fails.
Patch 4 fixes the shared clock lifetime using the PHY package
infrastructure.
---
Changes:
v6:
Patch 4:
- Correct the author and Signed-off-by email address.
- Add Reviewed-by tag. (Andrew Lunn.)
v5: https://lore.kernel.org/all/20260810141511.73204-1-xuanqiang.luo@linux.dev/
Patch 1 ~ 3:
- Add Reviewed-by tags. (Andrew Lunn.)
Patch 4:
- Replace devm_phy_package_join() with explicit phy_package_join() and
phy_package_leave(). (Andrew Lunn.)
v4: https://lore.kernel.org/all/20260807070729.12545-1-xuanqiang.luo@linux.dev/
Patch 1 (new):
- Add PHY package locking helpers for shared package data.
(Andrew Lunn.)
Patch 2 (new):
- Split the pin configuration storage change into a separate patch and
clarify that the pin functions remain configurable at runtime.
(Andrew Lunn.)
- Clarify the locking comments for pin_config. (Sashiko.)
Patch 3 (new):
- Split the PTP registration failure cleanup into a separate patch.
Patch 4:
- Use the PHY package locking helpers instead of accessing the MII bus
shared lock directly. (Andrew Lunn.)
- Adapt the lifetime fix to the preparatory changes split into separate
patches. (Andrew Lunn.)
v3: https://lore.kernel.org/all/20260805072725.169431-1-xuanqiang.luo@linux.dev/
- Drop the Suggested-by tag. (Jakub Kicinski.)
- Set err to -ENOMEM on the kzalloc_obj() failure path. (Sashiko.)
- Let devres handle cleanup on driver detach instead of explicitly
releasing the action from .remove(). (Jakub Kicinski.)
v2: https://lore.kernel.org/all/20260730064451.32261-1-xuanqiang.luo@linux.dev/
- Replace the driver-local clock list and kref with the PHY package API.
(Jakub Kicinski.)
- Use devres to avoid leaking the new package reference on later PHY core
initialization failures.
- Embed the pin configuration in the package private data to simplify
lifetime management.
v1: https://lore.kernel.org/all/20260724023532.14583-1-xuanqiang.luo@linux.dev/
Xuanqiang Luo (4):
net: phy: add PHY package locking helpers
net: phy: dp83640: embed pin configuration in clock
net: phy: dp83640: clear state after PTP registration failure
net: phy: dp83640: fix per-bus clock lifetime
drivers/net/phy/dp83640.c | 131 +++++++++-------------------------
drivers/net/phy/phy_package.c | 23 ++++++
drivers/net/phy/phylib.h | 2 +
drivers/ptp/Kconfig | 1 +
4 files changed, 61 insertions(+), 96 deletions(-)
--
2.43.0
next reply other threads:[~2026-08-11 15:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 15:13 Xuanqiang Luo [this message]
2026-08-11 15:13 ` [PATCH net v6 1/4] net: phy: add PHY package locking helpers Xuanqiang Luo
2026-08-11 15:13 ` [PATCH net v6 2/4] net: phy: dp83640: embed pin configuration in clock Xuanqiang Luo
2026-08-11 15:13 ` [PATCH net v6 3/4] net: phy: dp83640: clear state after PTP registration failure Xuanqiang Luo
2026-08-11 15:13 ` [PATCH net v6 4/4] net: phy: dp83640: fix per-bus clock lifetime Xuanqiang Luo
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=20260811151345.73582-1-xuanqiang.luo@linux.dev \
--to=xuanqiang.luo@linux.dev \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=luoxuanqiang@kylinos.cn \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/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.