Skip to content

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

Dan Robertson linux-amlogic linux-arm-kernel linux-usb 1 version Applied

Status from this message: This patch was applied to khilman/linux-amlogic.git (refs/heads/for-next).

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 28 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/1usb: dwc3: meson-g12a: fix shared reset control usedrivers/usb/dwc3/dwc3-meson-g12a.c+9 -618 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] usb: dwc3: meson-g12a: fix shared reset control use

When testing suspend for another driver I noticed the following warning:

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

In my limited experience and knowlege it appears that we hit this because the reset control was switched to shared and the the use of the reset control was not changed.

Quoted 3 lines

* Calling reset_control_assert without first calling reset_control_deassert
* is not allowed on a shared reset control. Calling reset_control_reset is
* also not allowed on a shared reset control.

The above snippet from reset_control_get_shared() seems to indicate that this is due to the use of reset_control_reset() in dwc3_meson_g12a_probe() and reset_control_deassert is not guaranteed to have been called before dwc3_meson_g12a_suspend() and reset_control_assert().

After some basic tests with the following patch I no longer hit the warning. Comments and critiques on the patch are welcome. If there is a reason for the current use of the reset control, I'd love to learn why! Like I said before, I have not really looked at this driver before and have verify limited experience with reset controls... Was working on another driver, hit the warning, and thought I'd take a shot at the fix :-)

Cheers,

- Dan

Dan Robertson (1):
usb: dwc3: meson-g12a: fix shared reset control use

 drivers/usb/dwc3/dwc3-meson-g12a.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic