Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2555646pxp; Tue, 22 Mar 2022 00:31:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWk8rOJwKI9y2HNQu8S7bfwxbipzKkOSqwH9XGmVo8T9hm+lv7tSqZd/zV5X+2ROeAnlor X-Received: by 2002:aa7:8896:0:b0:4f7:b8f7:772e with SMTP id z22-20020aa78896000000b004f7b8f7772emr27179442pfe.62.1647934313342; Tue, 22 Mar 2022 00:31:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647934313; cv=none; d=google.com; s=arc-20160816; b=IG0HnXLiI1uXJELQmIhlSeEy+dtaXpm8twIUmkk1w++0esJDPNm5zxMhBRsfMX5Mip QH0ueNyV1P+USygNXXnz4TCdJHz0MMzX6ADTHDvPc0jH6ur6j1ClYQB4uVq2xG3CLwdE dpQ0c/u540rt4a/Vks2xUuoHv9PCcP2nEwvBou0AM8VZNls0DcaZzjJNnkW2nqGqveqT uAezixG1zwl0S3cl73zVC4wzGLxYR8wKDvmtrUz6/HCEbCsVFKAFuM9DKg8hF7goz9IW k3ogsIWOmXBRtMbiozQHL120aZItqk5cH7vbD9090TNXKJHeuytJtthsAYtax3fd0IF2 p8/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=m9OIxfyXSUjUpgDoFZi38XYjOOeNbtx/hknuTUFoDSk=; b=0cceewfAL8eAtqXemXrMUrzt+5wf7HiY24TK/+SFOPysHJ7SKv3XLJNbQicXtbnKQO 0T1xmlEI68SqCc976yI7aEqt2HB7oXjfjH/sHMXhBJPqeHGUiaDAFk5t9wh2iNkzkxdL 1G3rLzIvy/ifBf8RQsdj6vLw23LKIK7oWlovbF4MmUQPLpWYruIOXN+UzgxChpRPu8nt +vlCAbt2/KQfHNJufhZZq/MkDluDR0PprrzjB3ZSbUVOeOVB1JhTh1H4N5gQMwhEtYER bs+yL/RsJ+kTNeCBGZpJaD28CySg4+ObPASml60bNho+lfC7aGj+3N9JjK6NjmutED0l uC0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="pVyQJ/fT"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bi7-20020a170902bf0700b00153b2d164b9si12531064plb.193.2022.03.22.00.31.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Mar 2022 00:31:53 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b="pVyQJ/fT"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 685C363BD2; Tue, 22 Mar 2022 00:09:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237279AbiCVHKY (ORCPT + 99 others); Tue, 22 Mar 2022 03:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237329AbiCVHKG (ORCPT ); Tue, 22 Mar 2022 03:10:06 -0400 Received: from alexa-out.qualcomm.com (alexa-out.qualcomm.com [129.46.98.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54BA06005D; Tue, 22 Mar 2022 00:08:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1647932913; x=1679468913; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=m9OIxfyXSUjUpgDoFZi38XYjOOeNbtx/hknuTUFoDSk=; b=pVyQJ/fTEaGr1rHosVzF4QT+OTiyInCnLvxOyxYE8MHQbODhTxmCkLhh bONJeKWlV8FgFsoDvkkOz/HgWv73+d/ZDx4Ro++P+nxnTOPIrppM07+Bh Oift8OvSx2d1kLPyTPBN/1dN9yg5nv0YmE1Os7mHj9FXFXUyhyfBTCWJH 0=; Received: from ironmsg09-lv.qualcomm.com ([10.47.202.153]) by alexa-out.qualcomm.com with ESMTP; 22 Mar 2022 00:08:32 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg09-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2022 00:08:31 -0700 Received: from nalasex01a.na.qualcomm.com (10.47.209.196) by nasanex01c.na.qualcomm.com (10.47.97.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 22 Mar 2022 00:08:31 -0700 Received: from c-sanm-linux.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 22 Mar 2022 00:08:27 -0700 From: Sandeep Maheswaram To: Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman CC: , , , , , Sandeep Maheswaram Subject: [PATCH v11 4/5] usb: dwc3: qcom: Configure wakeup interrupts during suspend Date: Tue, 22 Mar 2022 12:37:55 +0530 Message-ID: <1647932876-23249-5-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1647932876-23249-1-git-send-email-quic_c_sanm@quicinc.com> References: <1647932876-23249-1-git-send-email-quic_c_sanm@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Configure interrupts based on hs_phy_mode to avoid triggering of interrupts during system suspend and suspend the device successfully. Signed-off-by: Sandeep Maheswaram Reviewed-by: Matthias Kaehlcke --- drivers/usb/dwc3/dwc3-qcom.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 7352124..9804a19 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -316,22 +316,36 @@ static void dwc3_qcom_disable_wakeup_irq(int irq) static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom) { - dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); + struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); - dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_disable_wakeup_irq(qcom->hs_phy_irq); - dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); + if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) { + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); + } else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) { + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); + } else { + dwc3_qcom_disable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_disable_wakeup_irq(qcom->dm_hs_phy_irq); + } dwc3_qcom_disable_wakeup_irq(qcom->ss_phy_irq); } static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom) { - dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); + struct dwc3 *dwc = platform_get_drvdata(qcom->dwc3); - dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_enable_wakeup_irq(qcom->hs_phy_irq); - dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); + if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_LS) { + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); + } else if (dwc->hs_phy_mode & PHY_MODE_USB_HOST_HS) { + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); + } else { + dwc3_qcom_enable_wakeup_irq(qcom->dp_hs_phy_irq); + dwc3_qcom_enable_wakeup_irq(qcom->dm_hs_phy_irq); + } dwc3_qcom_enable_wakeup_irq(qcom->ss_phy_irq); } -- 2.7.4