linux-uconsole/drivers/phy/qualcomm
Stephan Gerhold 8fa7f8d5ba phy: qcom-usb-hs: Fix extcon double register after power cycle
[ Upstream commit 64f86b9978 ]

Commit f0b5c2c963 ("phy: qcom-usb-hs: Replace the extcon API")
switched from extcon_register_notifier() to the resource-managed
API, i.e. devm_extcon_register_notifier().

This is problematic in this case, because the extcon notifier
is dynamically registered/unregistered whenever the PHY is powered
on/off. The resource-managed API does not unregister the notifier
until the driver is removed, so as soon as the PHY is power cycled,
attempting to register the notifier again results in:

	double register detected
	WARNING: CPU: 1 PID: 182 at kernel/notifier.c:26 notifier_chain_register+0x74/0xa0
	Call trace:
	 ...
	 extcon_register_notifier+0x74/0xb8
	 devm_extcon_register_notifier+0x54/0xb8
	 qcom_usb_hs_phy_power_on+0x1fc/0x208
	 ...

... and USB stops working after plugging the cable out and in
another time.

The easiest way to fix this is to make a partial revert of
commit f0b5c2c963 ("phy: qcom-usb-hs: Replace the extcon API")
and avoid using the resource-managed API in this case.

Fixes: f0b5c2c963 ("phy: qcom-usb-hs: Replace the extcon API")
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-31 16:35:30 +01:00
..
Kconfig phy: Add a driver for the ATH79 USB phy 2018-04-25 10:53:00 +05:30
Makefile phy: Add a driver for the ATH79 USB phy 2018-04-25 10:53:00 +05:30
phy-ath79-usb.c phy: ath79-usb: Fix the main reset name to match the DT binding 2019-03-05 17:58:48 +01:00
phy-qcom-apq8064-sata.c
phy-qcom-ipq806x-sata.c
phy-qcom-qmp.c phy: qcom-qmp: Add QMP V3 USB3 UNI PHY support for sdm845 2018-05-20 21:51:30 +05:30
phy-qcom-qmp.h phy: qcom-qmp: Add QMP V3 USB3 UNI PHY support for sdm845 2018-05-20 21:51:30 +05:30
phy-qcom-qusb2.c phy: qcom-qusb2: Fix HSTX_TRIM tuning with fused value for SDM845 2018-12-17 09:24:34 +01:00
phy-qcom-ufs-i.h ufs/phy: qcom: Refactor to use phy_init call 2017-10-23 11:19:27 +05:30
phy-qcom-ufs-qmp-14nm.c ufs/phy: qcom: Refactor to use phy_init call 2017-10-23 11:19:27 +05:30
phy-qcom-ufs-qmp-14nm.h
phy-qcom-ufs-qmp-20nm.c ufs/phy: qcom: Refactor to use phy_init call 2017-10-23 11:19:27 +05:30
phy-qcom-ufs-qmp-20nm.h
phy-qcom-ufs.c phy: qcom-ufs: add MODULE_LICENSE tag 2018-03-12 15:11:59 +05:30
phy-qcom-usb-hs.c phy: qcom-usb-hs: Fix extcon double register after power cycle 2019-12-31 16:35:30 +01:00
phy-qcom-usb-hsic.c