summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorXuanqiang Luo <luoxuanqiang@kylinos.cn>2026-08-11 23:13:45 +0800
committerJakub Kicinski <kuba@kernel.org>2026-08-13 17:30:15 -0700
commit854ac5fde2215a3cb06f6d05b744869a31889064 (patch)
treedb182849dfc6e58b243d4cb01a63c3376a3c6ebb /tools/perf/scripts/python
parente8b166c1f0a53312bd50355ea4db77b2a6728e0f (diff)
net: phy: dp83640: fix per-bus clock lifetime
Commit 42e2a9e11a1d ("net: phy: dp83640: improve phydev and driver removal handling") moved per-bus clock cleanup from module exit to the remove path. This leaves two lifetime problems. dp83640_clock_get_bus() publishes a newly allocated clock before the driver allocates its per-PHY data and registers the PTP clock. If either operation fails, no PHY is bound and the remove callback cannot release the clock, leaking the clock and the MII bus device reference. The remove path can also free a clock after dropping clock_lock. A concurrent probe may already have found the clock under phyter_clocks_lock and be waiting for clock_lock, allowing it to acquire a freed mutex and access the freed clock. Use the PHY package infrastructure for the per-bus clock. PHY packages are tracked per MII bus, and the driver uses BROADCAST_ADDR as the package key so the DP83640 PHYs on the same bus share the same clock storage. Call phy_package_join() during probe and phy_package_leave() on probe errors and in remove. Serialize the one-time clock initialization with the package lock because phy_package_probe_once() elects an initializer but does not wait for initialization to finish. Cc: stable+noautosel@kernel.org # untested fix to a driver init path Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Xuanqiang Luo <luoxuanqiang@kylinos.cn> Link: https://patch.msgid.link/20260811151345.73582-5-xuanqiang.luo@linux.dev Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions