Skip to content

Commit 7a41095

Browse files
dlrobertsonfelipebalbi
authored andcommitted
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: 6d9fa35 ("usb: dwc3: meson-g12a: get the reset as shared") Signed-off-by: Dan Robertson <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent 916f8b6 commit 7a41095

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/usb/dwc3/dwc3-meson-g12a.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -737,13 +737,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
737737
goto err_disable_clks;
738738
}
739739

740-
ret = reset_control_reset(priv->reset);
740+
ret = reset_control_deassert(priv->reset);
741741
if (ret)
742-
goto err_disable_clks;
742+
goto err_assert_reset;
743743

744744
ret = dwc3_meson_g12a_get_phys(priv);
745745
if (ret)
746-
goto err_disable_clks;
746+
goto err_assert_reset;
747747

748748
ret = priv->drvdata->setup_regmaps(priv, base);
749749
if (ret)
@@ -752,7 +752,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
752752
if (priv->vbus) {
753753
ret = regulator_enable(priv->vbus);
754754
if (ret)
755-
goto err_disable_clks;
755+
goto err_assert_reset;
756756
}
757757

758758
/* Get dr_mode */
@@ -765,13 +765,13 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
765765

766766
ret = priv->drvdata->usb_init(priv);
767767
if (ret)
768-
goto err_disable_clks;
768+
goto err_assert_reset;
769769

770770
/* Init PHYs */
771771
for (i = 0 ; i < PHY_COUNT ; ++i) {
772772
ret = phy_init(priv->phys[i]);
773773
if (ret)
774-
goto err_disable_clks;
774+
goto err_assert_reset;
775775
}
776776

777777
/* Set PHY Power */
@@ -809,6 +809,9 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
809809
for (i = 0 ; i < PHY_COUNT ; ++i)
810810
phy_exit(priv->phys[i]);
811811

812+
err_assert_reset:
813+
reset_control_assert(priv->reset);
814+
812815
err_disable_clks:
813816
clk_bulk_disable_unprepare(priv->drvdata->num_clks,
814817
priv->drvdata->clks);

0 commit comments

Comments
 (0)