From ec70606fce7a390220cc02dff9058a5ebd8d4193 Mon Sep 17 00:00:00 2001 From: Ren Jianing Date: Thu, 28 Jan 2021 11:26:05 +0800 Subject: [PATCH] phy: phy-core: remove mutex lock for rockchip rv1126-usb2phy calibrate For RV1126, phy_calibrate will run in dwc3 reset irq function and lead to dead lock. Besides, there is no critical area resources. So we should remove mutex lock in phy calibrate for Rockchip platform. Signed-off-by: Ren Jianing Change-Id: Ic205959d96e7a6831aa9426738c1fd06deee1a22 --- drivers/phy/phy-core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c index 467ddddec0f9..b7b041c5a5c1 100644 --- a/drivers/phy/phy-core.c +++ b/drivers/phy/phy-core.c @@ -399,6 +399,13 @@ int phy_calibrate(struct phy *phy) if (!phy || !phy->ops->calibrate) return 0; + if (phy->dev.parent && + of_device_is_compatible(phy->dev.parent->of_node, + "rockchip,rv1126-usb2phy")) { + ret = phy->ops->calibrate(phy); + return ret; + } + mutex_lock(&phy->mutex); ret = phy->ops->calibrate(phy); mutex_unlock(&phy->mutex);