Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1049210iob; Fri, 13 May 2022 21:04:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRRlAB+G6BompRWB3NM5ca+L0ekmJUDtFXwCvshL9wV0Q8WKhY/1U+caFWcTZBLIoYbQyr X-Received: by 2002:a05:600c:5105:b0:394:7d22:aa93 with SMTP id o5-20020a05600c510500b003947d22aa93mr7139192wms.107.1652501088742; Fri, 13 May 2022 21:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652501088; cv=none; d=google.com; s=arc-20160816; b=uizBoIW26EPYkH2wxwuQZtsWN+BKFaVor5ar6R9deYzn5P3u4CN3X0v02xuZ43u3We ZANOeierBkWa3KrDmt3PzOn2Ip5gYip/Ny9aHg/uTvwBurmPryRyQYCB7snliW8850B6 s3N3iH0Rih9x1zlHlevokZ7nLXhLwFyK7bWqCj+0/6DfoelrwPbNMPEib1nlKXPVOQvY 5PlTxqXJtZ51P4vIhHWFJYGJKEPyDCgosVmxPYuZBdMc6MOEDicjjT9oxWHPKa1VvNOG Tnu8wF7lPz1WF2CGH8bBCqTlF2kTOtaagI0QYAtbWiIGtjp+uJrhSrIP91gWrxdijG7E CN8A== 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=V7sjjm49a0/QUz6WLYHMRbDzxjsAIpjkcvIhcXa4mU4=; b=v41MpWAfD9OxtJacUwS7QYSrmzkJ03CJcNd3aoJAyuokJGq5gQko+bnNQEuwH5lTXM b+YKJ/qDI6tnK64GUxK++/hy0HUBBMmE4pQepE14hyBhWzVzwtboT1DIak+TivxT8Xqy 4AKukl2gSL8i2ro7QLuTOKKm+m7nCbhNy7+6JZ9Nq7kdoaf0GLyOpfty9VUVA5hoqaUl EGAv8LH6EyGd9T7YBsKTF3ypeiBX98yBFWLGmeYQvXyCjxAcJPVJwMrLjAnmWlPyYm38 xIR2Mnzm3vSLcIpKgWWbhtsu2vgBQVbM1Hu9q0S1XFyuPIs39+uKaEWfwDgiuEIDn5wt rqjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ZgsT6HFf; 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 f12-20020a5d64cc000000b0020ae77c9e7dsi3729821wri.1033.2022.05.13.21.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 21:04:48 -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=ZgsT6HFf; 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 4F4074B775A; Fri, 13 May 2022 17:36:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357651AbiELSYZ (ORCPT + 99 others); Thu, 12 May 2022 14:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357657AbiELSYO (ORCPT ); Thu, 12 May 2022 14:24:14 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AFFF270CBD; Thu, 12 May 2022 11:24:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1652379851; x=1683915851; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=V7sjjm49a0/QUz6WLYHMRbDzxjsAIpjkcvIhcXa4mU4=; b=ZgsT6HFfD0tpkgpHyLmtMuTEPU1OZybVdX4qiMvn/rkH+xDeQB6l1VEB aWcRc85LrKnouqMYuQ/8/g/NrU6HiTs4Rpr3VoMPCSSXX6boWHZVDwDsi xTMhSB6DxGBHNkQXHSeQMHivQhjtaBKNDApApr4FmFLnWOlpdV9uEHhF3 c=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 12 May 2022 11:24:08 -0700 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.47.97.222]) by ironmsg03-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2022 11:24:07 -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; Thu, 12 May 2022 11:24:07 -0700 Received: from hu-kriskura-hyd.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; Thu, 12 May 2022 11:24:01 -0700 From: Krishna Kurapati To: Krzysztof Kozlowski , Rob Herring , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman CC: , , , , , , , , Sandeep Maheswaram , Krishna Kurapati Subject: [v16 5/5] usb: dwc3: qcom: Keep power domain on to retain controller status Date: Thu, 12 May 2022 23:53:22 +0530 Message-ID: <1652379802-8318-6-git-send-email-quic_kriskura@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1652379802-8318-1-git-send-email-quic_kriskura@quicinc.com> References: <1652379802-8318-1-git-send-email-quic_kriskura@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 From: Sandeep Maheswaram Keep the power domain always on during runtime suspend or if the controller supports wakeup in order to retain controller status and to support wakeup from devices. Signed-off-by: Sandeep Maheswaram Signed-off-by: Krishna Kurapati --- drivers/usb/dwc3/dwc3-qcom.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 9804a19..1f9589a 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -718,12 +719,13 @@ dwc3_qcom_create_urs_usb_platdev(struct device *dev) static int dwc3_qcom_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; - struct device *dev = &pdev->dev; - struct dwc3_qcom *qcom; - struct resource *res, *parent_res = NULL; - int ret, i; - bool ignore_pipe_clk; + struct device_node *np = pdev->dev.of_node; + struct device *dev = &pdev->dev; + struct dwc3_qcom *qcom; + struct resource *res, *parent_res = NULL; + int ret, i; + bool ignore_pipe_clk; + struct generic_pm_domain *genpd; qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL); if (!qcom) @@ -732,6 +734,8 @@ static int dwc3_qcom_probe(struct platform_device *pdev) platform_set_drvdata(pdev, qcom); qcom->dev = &pdev->dev; + genpd = pd_to_genpd(qcom->dev->pm_domain); + if (has_acpi_companion(dev)) { qcom->acpi_pdata = acpi_device_get_match_data(dev); if (!qcom->acpi_pdata) { @@ -839,7 +843,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev) if (ret) goto interconnect_exit; - device_init_wakeup(&pdev->dev, 1); + genpd->flags |= GENPD_FLAG_RPM_ALWAYS_ON; + + if (device_may_wakeup(&qcom->dwc3->dev)) { + genpd->flags |= GENPD_FLAG_ALWAYS_ON; + device_init_wakeup(&pdev->dev, true); + } qcom->is_suspended = false; pm_runtime_set_active(dev); pm_runtime_enable(dev); -- 2.7.4