Received: by 2002:a05:6512:3d0e:0:0:0:0 with SMTP id d14csp614132lfv; Tue, 12 Apr 2022 00:09:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsL5xUZ0yOrPdZCQ80MvZNzeMEDPlRWOTKOF3rJZArSI69b7DpyYzlCToYlavAq8yPm5Lf X-Received: by 2002:a05:6a00:1810:b0:505:aa07:9852 with SMTP id y16-20020a056a00181000b00505aa079852mr12899840pfa.8.1649747391394; Tue, 12 Apr 2022 00:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649747391; cv=none; d=google.com; s=arc-20160816; b=gU25p8uP5qjOlDVSvC885Rym1nMsT0UTQj4wGNHsbULwUoc6Hd9Xq8LFQB3JseEVA8 EUIhD4IbBP+lmc7LrvtFMs7n87gRuT5soAWImhXrhd7xGL47XBnxUa65ZMe0AA6tTmdP 9k48VE88hH6cylrD1Pr2qMxJVFkT29/AdBALHhTCf6JXkYA//hqoLlFkEeLR3PC3S/TX Bikb8HNXEXZkC1x/bL9dLE2pq4601vkM5cySF1A5J7oa7o1easBx8vnxnmaRqLcXCKwS 9jx+Tx3XclAGEGkTSywGCnS+CtFv68/2bQLnRynPjhpEjTPCZw/HMK68E0IatsvGV2Th 1IKg== 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=TUy4LS9KUkbOEtWB2GQVoYzHmDPe1S/kFNwMYnz0zkM=; b=g4IFQ2P4+7K+whKwGKMCGUodoBRoBOLVTE6q5uXCkHOylJAltKabLf8F53poh7S2z9 ixgn+PEP7mYpf2xsiDkNJb+uONn/lEVdgXmD681KKmpFPzJ/VTZIosOma6ZcuyAfbAVq YkOchH4IwqNP6VgWJfn/UKg1sMlqTpuDBx/OBfu91ZMGw064rdlDDEYxf0jVRu2S4DVo /CgRh/AqidbJIln4Mh8ibaDQ25NPh0TiSymrJt+tTQYx+oZc85yZyK//nk/pneAIEpHu zsoHBJ9cLjVDsmc86+b65GxCgOUeE3/EdfSv6RnK6ztiJ0DMi1jgi1oznK74CSfHu26D /YLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=L+06CO23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lr7-20020a17090b4b8700b001cba11df7afsi4761981pjb.3.2022.04.12.00.09.38; Tue, 12 Apr 2022 00:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=L+06CO23; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241446AbiDKTUO (ORCPT + 99 others); Mon, 11 Apr 2022 15:20:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349590AbiDKTUC (ORCPT ); Mon, 11 Apr 2022 15:20:02 -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 352C136E2F; Mon, 11 Apr 2022 12:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1649704665; x=1681240665; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=TUy4LS9KUkbOEtWB2GQVoYzHmDPe1S/kFNwMYnz0zkM=; b=L+06CO23JzuSH/Brk+UkVBGNloDI09246YLSVPAA6UC2O8TNj2F6NnL5 MbCui9jJuo2Z+9NNOU0/Y4DzXhScWVGNE/3qvScK+V3LiNyojpVsLQuUK xcMpebUzH4pCNEhfMxki4PfF2B2kMFy1uWzQZ501VPZpFwhGEB/Y2zTSo 4=; Received: from unknown (HELO ironmsg03-sd.qualcomm.com) ([10.53.140.143]) by alexa-out-sd-01.qualcomm.com with ESMTP; 11 Apr 2022 12:17:45 -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; 11 Apr 2022 12:17:44 -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; Mon, 11 Apr 2022 12:17:44 -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; Mon, 11 Apr 2022 12:17:38 -0700 From: Sandeep Maheswaram To: Rob Herring , Andy Gross , "Bjorn Andersson" , Greg Kroah-Hartman , Felipe Balbi , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Mathias Nyman , Krzysztof Kozlowski CC: , , , , , , , , Sandeep Maheswaram Subject: [PATCH v13 5/6] usb: dwc3: qcom: Keep power domain on to retain controller status Date: Tue, 12 Apr 2022 00:46:53 +0530 Message-ID: <1649704614-31518-6-git-send-email-quic_c_sanm@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1649704614-31518-1-git-send-email-quic_c_sanm@quicinc.com> References: <1649704614-31518-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=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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 --- drivers/usb/dwc3/dwc3-qcom.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 9804a19..9747be6 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 @@ -724,6 +725,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) 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, device_may_wakeup(&qcom->dwc3->dev)); qcom->is_suspended = false; pm_runtime_set_active(dev); pm_runtime_enable(dev); -- 2.7.4