linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 01/33] extcon-intel-cht-wc: Don't reset USB data connection at probe
@ 2020-01-24  1:16 Sasha Levin
  2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 02/33] ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0 Sasha Levin
                   ` (31 more replies)
  0 siblings, 32 replies; 33+ messages in thread
From: Sasha Levin @ 2020-01-24  1:16 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Yauhen Kharuzhy, Hans de Goede, Andy Shevchenko, Chanwoo Choi,
	Sasha Levin

From: Yauhen Kharuzhy <jekhor@gmail.com>

[ Upstream commit e81b88932985c9134d410f4eaaaa9b81a3b4bd0c ]

Intel Cherry Trail Whiskey Cove extcon driver connect USB data lines to
PMIC at driver probing for further charger detection. This causes reset of
USB data sessions and removing all devices from bus. If system was
booted from Live CD or USB dongle, this makes system unusable.

Check if USB ID pin is floating and re-route data lines in this case
only, don't touch otherwise.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
[cw00.choi: Clean-up the minor coding style]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/extcon/extcon-intel-cht-wc.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/extcon/extcon-intel-cht-wc.c b/drivers/extcon/extcon-intel-cht-wc.c
index 9d32150e68db5..771f6f4cf92e6 100644
--- a/drivers/extcon/extcon-intel-cht-wc.c
+++ b/drivers/extcon/extcon-intel-cht-wc.c
@@ -338,6 +338,7 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
 	struct intel_soc_pmic *pmic = dev_get_drvdata(pdev->dev.parent);
 	struct cht_wc_extcon_data *ext;
 	unsigned long mask = ~(CHT_WC_PWRSRC_VBUS | CHT_WC_PWRSRC_USBID_MASK);
+	int pwrsrc_sts, id;
 	int irq, ret;
 
 	irq = platform_get_irq(pdev, 0);
@@ -387,8 +388,19 @@ static int cht_wc_extcon_probe(struct platform_device *pdev)
 		goto disable_sw_control;
 	}
 
-	/* Route D+ and D- to PMIC for initial charger detection */
-	cht_wc_extcon_set_phymux(ext, MUX_SEL_PMIC);
+	ret = regmap_read(ext->regmap, CHT_WC_PWRSRC_STS, &pwrsrc_sts);
+	if (ret) {
+		dev_err(ext->dev, "Error reading pwrsrc status: %d\n", ret);
+		goto disable_sw_control;
+	}
+
+	/*
+	 * If no USB host or device connected, route D+ and D- to PMIC for
+	 * initial charger detection
+	 */
+	id = cht_wc_extcon_get_id(ext, pwrsrc_sts);
+	if (id != INTEL_USB_ID_GND)
+		cht_wc_extcon_set_phymux(ext, MUX_SEL_PMIC);
 
 	/* Get initial state */
 	cht_wc_extcon_pwrsrc_event(ext);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2020-01-24  1:20 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-24  1:16 [PATCH AUTOSEL 5.4 01/33] extcon-intel-cht-wc: Don't reset USB data connection at probe Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 02/33] ASoC: Intel: cht_bsw_rt5645: Add quirk for boards using pmc_plt_clk_0 Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 03/33] drm/amdgpu/SRIOV: add navi12 pci id for SRIOV (v2) Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 04/33] libbpf: Fix BTF-defined map's __type macro handling of arrays Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 05/33] staging: mt7621-pci: add quirks for 'E2' revision using 'soc_device_attribute' Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 06/33] platform/x86: dell-laptop: disable kbd backlight on Inspiron 10xx Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 07/33] drm: rcar_lvds: Fix color mismatches on R-Car H2 ES2.0 and later Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 08/33] PCI: Add DMA alias quirk for Intel VCA NTB Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 09/33] media: dvbsky: add support for eyeTV Geniatech T2 lite Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 10/33] bus: ti-sysc: Handle mstandby quirk and use it for musb Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 11/33] bus: ti-sysc: Use swsup quirks also for am335x musb Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 12/33] spi: pxa2xx: Add support for Intel Comet Lake-H Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 13/33] iommu/amd: Support multiple PCI DMA aliases in device table Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 14/33] iommu/amd: Support multiple PCI DMA aliases in IRQ Remapping Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 15/33] perf/imx_ddr: Add enhanced AXI ID filter support Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 16/33] mfd: intel-lpss: Add default I2C device properties for Gemini Lake Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 17/33] mfd: intel-lpss: Add Intel Comet Lake PCH-H PCI IDs Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 18/33] ARM: config: aspeed-g5: Enable 8250_DW quirks Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 19/33] ARM: OMAP2+: SmartReflex: add omap_sr_pdata definition Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 20/33] mmc: sdhci-pci: Quirk for AMD SDHC Device 0x7906 Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 21/33] mmc: sdhci-pci: Add support for Intel JSL Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 22/33] bus: ti-sysc: Add module enable quirk for audio AESS Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 23/33] mmc: sdio: fix wl1251 vendor id Sasha Levin
2020-01-24  1:16 ` [PATCH AUTOSEL 5.4 24/33] mmc: core: fix wl1251 sdio quirks Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 25/33] usb-storage: Disable UAS on JMicron SATA enclosure Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 26/33] ALSA: hda/realtek - Move some alc236 pintbls to fallback table Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 27/33] Bluetooth: Allow combination of BDADDR_PROPERTY and INVALID_BDADDR quirks Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 28/33] Bluetooth: btbcm: Use the BDADDR_PROPERTY quirk Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 29/33] bus: ti-sysc: Fix missing force mstandby quirk handling Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 30/33] HID: Add quirk for Xin-Mo Dual Controller Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 31/33] HID: ite: Add USB id match for Acer SW5-012 keyboard dock Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 32/33] HID: Add quirk for incorrect input length on Lenovo Y720 Sasha Levin
2020-01-24  1:17 ` [PATCH AUTOSEL 5.4 33/33] drivers/hid/hid-multitouch.c: fix a possible null pointer access Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).