From 4ee28c3cb783cdc1a03ee0695378ab01d19d1bb8 Mon Sep 17 00:00:00 2001 From: Ajay Agarwal Date: Mon, 25 Jan 2021 18:48:47 +0530 Subject: [PATCH] usb: phy: snps: Enable autoresume for FS/HS peripherals only Currently the driver enables autoresume for all the connected peripherals. In a case where an LS device is connected but fails the enumeration, this autoresume enablement is leading to PHY keeping the Dm pulled up even when the peripheral is detached. Hence, the detach hs_phy_irq is never fired and disconnect is not processed. Since remote wakeup from LS peripherals is not a requirement on our platforms, enable autoresume for FS/HS devices only. Change-Id: I0a62d08e58af18b523af322c64529f5183d55907 Signed-off-by: Ajay Agarwal --- drivers/usb/phy/phy-msm-snps-hs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-msm-snps-hs.c b/drivers/usb/phy/phy-msm-snps-hs.c index f1fef3c48c96..d6d76c450ef4 100644 --- a/drivers/usb/phy/phy-msm-snps-hs.c +++ b/drivers/usb/phy/phy-msm-snps-hs.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #include @@ -487,12 +487,11 @@ static int msm_hsphy_set_suspend(struct usb_phy *uphy, int suspend) suspend: if (suspend) { /* Bus suspend */ if (phy->cable_connected) { - /* Enable auto-resume functionality only during host - * mode bus suspend with some peripheral connected. + /* Enable auto-resume functionality during host mode + * bus suspend with some FS/HS peripheral connected. */ if ((phy->phy.flags & PHY_HOST_MODE) && - ((phy->phy.flags & PHY_HSFS_MODE) || - (phy->phy.flags & PHY_LS_MODE))) { + (phy->phy.flags & PHY_HSFS_MODE)) { /* Enable auto-resume functionality by pulsing * signal */