Re: [PATCH 2/6] usb: chipidea: usb2: add optional reset support
Junzhong Pan <[email protected]>
| Newsgroups | dev.linux.lists.sashiko-reviews,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <258DBF747B7DC4A4+78f75b27-4006-4abf-b5e3-1293d1c514bc@linux.spacemit.com> |
> ci_hdrc_usb2_probe() {
> ...
> priv->ci_pdev = ci_hdrc_add_device(...);
> if (IS_ERR(priv->ci_pdev)) {
> ...
> goto clk_err;
> }
> ...
> clk_err:
> clk_disable_unprepare(priv->clk);
> return ret;
> }
>
> This means the reset will be asserted after the clock is disabled. On many
> architectures, asserting a peripheral reset while its clock is disabled can
> cause bus lockups or system hangs.
>
> This same inversion appears to affect device unbind as well, since
> ci_hdrc_usb2_remove() manually disables the clock before devres runs.
>
> Would using devres for the clock enablement ensure standard LIFO teardown
> ordering?
Okay, I will add a preparatory patch to the series in v2 to use devres for
clock before the reset patch. thank you sashiko.