Skip to content
Commit 35b58b33 authored by Icenowy Zheng's avatar Icenowy Zheng Committed by Vincent Stehle
Browse files

phy: rockchip: inno-usb2: fix hang when multiple controllers exit



The OHCI and EHCI controllers are both bound to the same PHY. They will
both do init and power_on operations when the controller is brought up
and both do power_off and exit when the controller is stopped. However,
the PHY uclass of U-Boot is not as sane as we thought -- they won't
maintain a status mark for PHYs, and thus the functions of the PHYs
could be called for multiple times. Calling init/power_on for multiple
times have no severe problems, however calling power_off/exit for
multiple times have a problem -- the first exit call will stop the PHY
clock, and power_off/exit calls after it still trying to write to PHY
registers. The write operation to PHY registers will fail because clock
is already stopped.

Adapt the count mechanism from phy-sun4i-usb to both init/exit and
power_on/power_off functions to phy-rockchip-inno-usb2 to fix this
problem. With this stopping USB controllers (manually or before booting
a kernel) will work.

Signed-off-by: default avatarIcenowy Zheng <icenowy@aosc.io>
Fixes: ac97a9ec ("phy: rockchip: Add Rockchip USB2PHY driver")
Tested-by: Peter Robinson's avatarPeter Robinson <pbrobinson@gmail.com>
parent 163b3d0f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment