1
0
Fork 0
alistair23-linux/drivers/phy/qualcomm
Stephan Gerhold 8d42643c6c 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:44:29 +01:00
..
Kconfig phy: for 5.3 2019-07-01 15:04:59 +02:00
Makefile phy: qcom: Add Qualcomm PCIe2 PHY driver 2019-05-31 19:41:13 +05:30
phy-ath79-usb.c phy: ath79-usb: Fix the main reset name to match the DT binding 2019-01-16 18:00:57 +05:30
phy-qcom-apq8064-sata.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-ipq806x-sata.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-pcie2.c phy: qcom: Add Qualcomm PCIe2 PHY driver 2019-05-31 19:41:13 +05:30
phy-qcom-qmp.c phy: qcom-qmp: Correct ready status, again 2019-08-26 17:20:04 +05:30
phy-qcom-qmp.h phy: qcom-qmp: Add msm8998 PCIe QMP PHY support 2019-04-17 14:13:20 +05:30
phy-qcom-qusb2.c phy: qcom-qusb2: fix missing assignment of ret when calling clk_prepare_enable 2019-06-03 17:03:52 +05:30
phy-qcom-ufs-i.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-ufs-qmp-14nm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-ufs-qmp-14nm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-ufs-qmp-20nm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-ufs-qmp-20nm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-ufs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
phy-qcom-usb-hs.c phy: qcom-usb-hs: Fix extcon double register after power cycle 2019-12-31 16:44:29 +01:00
phy-qcom-usb-hsic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00