From d86fac4c442a24d5bffff02c6b16868a9705d85c Mon Sep 17 00:00:00 2001 From: William Wu Date: Tue, 22 Jul 2025 20:05:33 +0800 Subject: [PATCH] phy: rockchip: inno-usb2: Destroy chg_worker on probe failure Fixes: a78b174c2fb6 ("phy: rockchip: inno-usb2: Fix DEBUG_LOCKS_WARN_ON in chg work") Signed-off-by: William Wu Change-Id: I1f200c7597418d9c174bc68d9a5fea0703cd9cc5 --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 66748c397525..20af74197466 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -2634,6 +2634,16 @@ next_child: return 0; put_child: + for (index = 0; index < rphy->phy_cfg->num_ports; index++) { + struct rockchip_usb2phy_port *rport = &rphy->ports[index]; + + if (!rport->phy) + continue; + + if (rport->port_id == USB2PHY_PORT_OTG && !IS_ERR_OR_NULL(rport->chg_worker)) + kthread_destroy_worker(rport->chg_worker); + } + of_node_put(child_np); disable_clks: pm_runtime_put_sync(dev);