mirror of
https://github.com/libretro/Lakka-LibreELEC.git
synced 2025-03-01 04:31:30 +00:00
49 lines
1.6 KiB
Diff
49 lines
1.6 KiB
Diff
From 09312f60d216525cc3f139575497e2c2775d7042 Mon Sep 17 00:00:00 2001
|
|
From: Amjad Ouled-Ameur <aouledameur@baylibre.com>
|
|
Date: Fri, 13 Nov 2020 07:45:15 +0000
|
|
Subject: [PATCH 36/88] FROMLIST(v1): phy: amlogic: phy-meson-gxl-usb2: fix
|
|
shared reset controller use
|
|
|
|
Use reset_control_rearm() call if an error occurs in case
|
|
phy_meson_gxl_usb2_init() fails after reset() has been called ; or in case
|
|
phy_meson_gxl_usb2_exit() is called i.e the resource is no longer used
|
|
and the reset line may be triggered again by other devices.
|
|
|
|
reset_control_rearm() keeps use of triggered_count sane in the reset
|
|
framework. Therefore, use of reset_control_reset() on shared reset line
|
|
should be balanced with reset_control_rearm().
|
|
|
|
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
|
|
Reported-by: Jerome Brunet <jbrunet@baylibre.com>
|
|
---
|
|
drivers/phy/amlogic/phy-meson-gxl-usb2.c | 5 ++++-
|
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/phy/amlogic/phy-meson-gxl-usb2.c b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
|
|
index 2b3c0d730f20..17826cd03142 100644
|
|
--- a/drivers/phy/amlogic/phy-meson-gxl-usb2.c
|
|
+++ b/drivers/phy/amlogic/phy-meson-gxl-usb2.c
|
|
@@ -114,8 +114,10 @@ static int phy_meson_gxl_usb2_init(struct phy *phy)
|
|
return ret;
|
|
|
|
ret = clk_prepare_enable(priv->clk);
|
|
- if (ret)
|
|
+ if (ret) {
|
|
+ reset_control_rearm(priv->reset);
|
|
return ret;
|
|
+ }
|
|
|
|
return 0;
|
|
}
|
|
@@ -124,6 +126,7 @@ static int phy_meson_gxl_usb2_exit(struct phy *phy)
|
|
{
|
|
struct phy_meson_gxl_usb2_priv *priv = phy_get_drvdata(phy);
|
|
|
|
+ reset_control_rearm(priv->reset);
|
|
clk_disable_unprepare(priv->clk);
|
|
|
|
return 0;
|
|
--
|
|
2.17.1
|
|
|