Commit 7a410953 authored by Dan Robertson's avatar Dan Robertson Committed by Felipe Balbi

usb: dwc3: meson-g12a: fix shared reset control use

The reset is a shared reset line, but reset_control_reset is still used
and reset_control_deassert is not guaranteed to have been called before
the first reset_control_assert call. When suspending the following
warning may be seen:

WARNING: CPU: 1 PID: 5530 at drivers/reset/core.c:355 reset_control_assert+0x184/0x19c
Hardware name: Hardkernel ODROID-N2 (DT)
[..]
pc : reset_control_assert+0x184/0x19c
lr : dwc3_meson_g12a_suspend+0x68/0x7c
[..]
Call trace:
 reset_control_assert+0x184/0x19c
 dwc3_meson_g12a_suspend+0x68/0x7c
 platform_pm_suspend+0x28/0x54
 __device_suspend+0x590/0xabc
 dpm_suspend+0x104/0x404
 dpm_suspend_start+0x84/0x1bc
 suspend_devices_and_enter+0xc4/0x4fc
 pm_suspend+0x198/0x2d4

Fixes: 6d9fa35a ("usb: dwc3: meson-g12a: get the reset as shared")
Signed-off-by: default avatarDan Robertson <dan@dlrobertson.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent 916f8b62
...@@ -737,13 +737,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ...@@ -737,13 +737,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
goto err_disable_clks; goto err_disable_clks;
} }
ret = reset_control_reset(priv->reset); ret = reset_control_deassert(priv->reset);
if (ret) if (ret)
goto err_disable_clks; goto err_assert_reset;
ret = dwc3_meson_g12a_get_phys(priv); ret = dwc3_meson_g12a_get_phys(priv);
if (ret) if (ret)
goto err_disable_clks; goto err_assert_reset;
ret = priv->drvdata->setup_regmaps(priv, base); ret = priv->drvdata->setup_regmaps(priv, base);
if (ret) if (ret)
...@@ -752,7 +752,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ...@@ -752,7 +752,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
if (priv->vbus) { if (priv->vbus) {
ret = regulator_enable(priv->vbus); ret = regulator_enable(priv->vbus);
if (ret) if (ret)
goto err_disable_clks; goto err_assert_reset;
} }
/* Get dr_mode */ /* Get dr_mode */
...@@ -765,13 +765,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ...@@ -765,13 +765,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
ret = priv->drvdata->usb_init(priv); ret = priv->drvdata->usb_init(priv);
if (ret) if (ret)
goto err_disable_clks; goto err_assert_reset;
/* Init PHYs */ /* Init PHYs */
for (i = 0 ; i < PHY_COUNT ; ++i) { for (i = 0 ; i < PHY_COUNT ; ++i) {
ret = phy_init(priv->phys[i]); ret = phy_init(priv->phys[i]);
if (ret) if (ret)
goto err_disable_clks; goto err_assert_reset;
} }
/* Set PHY Power */ /* Set PHY Power */
...@@ -809,6 +809,9 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev) ...@@ -809,6 +809,9 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
for (i = 0 ; i < PHY_COUNT ; ++i) for (i = 0 ; i < PHY_COUNT ; ++i)
phy_exit(priv->phys[i]); phy_exit(priv->phys[i]);
err_assert_reset:
reset_control_assert(priv->reset);
err_disable_clks: err_disable_clks:
clk_bulk_disable_unprepare(priv->drvdata->num_clks, clk_bulk_disable_unprepare(priv->drvdata->num_clks,
priv->drvdata->clks); priv->drvdata->clks);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment