usb: phy: am335x: fix race condition in _probe
authorBin Liu <b-liu@ti.com>
Wed, 16 Jan 2019 17:54:07 +0000 (11:54 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:45:01 +0000 (19:45 +0100)
commit2fc78043df925fb2501cadc77a798f72bf21208e
treea6911e252ba8601a8689c1565268749506ab14a9
parentd9f82def817a91b5c7f66844fc94397056c61792
usb: phy: am335x: fix race condition in _probe

commit a53469a68eb886e84dd8b69a1458a623d3591793 upstream.

power off the phy should be done before populate the phy. Otherwise,
am335x_init() could be called by the phy owner to power on the phy first,
then am335x_phy_probe() turns off the phy again without the caller knowing
it.

Fixes: 2fc711d76352 ("usb: phy: am335x: Enable USB remote wakeup using PHY wakeup")
Cc: stable@vger.kernel.org # v3.18+
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/phy/phy-am335x.c