phy: phy-twl4030-usb: fix denied runtime access
authorAndreas Kemnade <andreas@kemnade.info>
Sat, 22 Sep 2018 09:44:05 +0000 (11:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:00:33 +0000 (18:00 +0100)
commit16f9d73aae71b29157f9ccd6623e6bccbab70c95
tree8cb194c34f7e5fafb1def5c102e88677e5fcb26c
parent1ddc4c618dfb74e4f0330e0d6da8fb0917cfbf92
phy: phy-twl4030-usb: fix denied runtime access

[ Upstream commit 6c7103aa026094a4ee2c2708ec6977a6dfc5331d ]

When runtime is not enabled, pm_runtime_get_sync() returns -EACCESS,
the counter will be incremented but the resume callback not called,
so enumeration and charging will not start properly.
To avoid that happen, disable irq on suspend and recheck on resume.

Practically this happens when the device is woken up from suspend by
plugging in usb.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/phy/ti/phy-twl4030-usb.c