Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp601150pxa; Wed, 12 Aug 2020 09:16:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqwM2UWJAD1ZP3B/gVdHkcBuBdWSbU7G2B9gh8Vag5qBFfIsyiG5OVdmT2/BuVNfGYKV05 X-Received: by 2002:a17:906:b5a:: with SMTP id v26mr526864ejg.515.1597248998440; Wed, 12 Aug 2020 09:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597248998; cv=none; d=google.com; s=arc-20160816; b=NXwTI9ktcJ1fKPZF/3Sthk39AWbo2K61SHpvnoPoJPuHTK1PQYqbNHPIIfi1y1iADI /r4xbIAt/aXLSE4V6IoQ4uXH2Ewwsv1M5Oh1RNSn4zjL5ThBHSv18dnHj9e44G4qTS4x 9UQYqV5ADGMIknblY7/oI5x1O8g5G+vLsSqHW+ajY4mzCMYvEptsnNScxdCohlLeS83Y JHB77Wwg52m6SuESFS8t+FiTsaFEuvlxDgnyjNLd+pvxoRsqm0oODOB+jrhErEN3r6xl BlBAF0k9vdiHVfLRxaf9EJc1rHpzAVhAU6rK0tdhbBYYvWaDAiCWCWCTnLS8oxAsBYxr pN7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=VfMixFtX/OTlr/zRJajyB7g4shFSBIZI0I68qcvTqMQ=; b=UPr/FjcIlGQ4k1prfj8IYxXmqiTquNbepCSZFPlafgvakZHsGvEJEi3RhS1b1vFEKZ rPfpxKk/gx30Szhm1EV7KJZgbgaVc5xN+uqr7FRNnDmwXnYlsfgYGT97WJ+WzhZiUrah WaLEEB+FD+9rjtodT31lpaOL/jqDMcKb3XazuzDQP4Sjcc6XPS6gcAFfkXYqzVAUulJR lMgpv8T8I+fCGQBHAFaxwE7A6fwsLpZ+SB3IHIsX/K524EvbjqS5oFfl+WZRkHWh8FuS 5Q/yJiOsw3Qx2y4uulHsNfg9w+lCqlkfVXxblER3hRmwAcFvxLMh4y/pAqook+1IBjen dRGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=HmDIkSAN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si1629388edr.503.2020.08.12.09.16.15; Wed, 12 Aug 2020 09:16:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=HmDIkSAN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726678AbgHLQNP (ORCPT + 99 others); Wed, 12 Aug 2020 12:13:15 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:37288 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbgHLQNO (ORCPT ); Wed, 12 Aug 2020 12:13:14 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597248794; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=VfMixFtX/OTlr/zRJajyB7g4shFSBIZI0I68qcvTqMQ=; b=HmDIkSANBYaNjIPk+Qxjd93e2nDkJcjCckPCd1UJizlqDtfuBp5NlrL+IipEAXJWOgNr2Bh5 ngPYfQXks4ke2bUpkmNdp25NFxcvhH6dS0SkugQqz0iKVQSL3ANZ5i0c1ljCLZd+FP+lf/KZ 7O++bpKj5KlhHdKDd9vS4jmq++A= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 5f34150d46ed9966744cf82f (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 12 Aug 2020 16:13:01 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B8738C433AF; Wed, 12 Aug 2020 16:13:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: sibis) by smtp.codeaurora.org (Postfix) with ESMTPSA id AF06EC433C9; Wed, 12 Aug 2020 16:12:59 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 12 Aug 2020 21:42:59 +0530 From: Sibi Sankar To: Kevin Hilman Cc: bjorn.andersson@linaro.org, ulf.hansson@linaro.org, rjw@rjwysocki.net, agross@kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, gregkh@linuxfoundation.org, pavel@ucw.cz, len.brown@intel.com, rnayak@codeaurora.org, dianders@chromium.org, khilman@kernel.org, linux-arm-msm-owner@vger.kernel.org Subject: Re: [PATCH 1/2] PM / Domains: Add GENPD_FLAG_SUSPEND_ON flag In-Reply-To: <7heeoc3edk.fsf@baylibre.com> References: <20200811190252.10559-1-sibis@codeaurora.org> <7heeoc3edk.fsf@baylibre.com> Message-ID: <340a7aafcf0301ff3158a4e211992041@codeaurora.org> X-Sender: sibis@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kevin, Thanks for taking time to review the series! On 2020-08-12 05:49, Kevin Hilman wrote: > Sibi Sankar writes: > >> This is for power domains which needs to stay powered on for suspend >> but can be powered on/off as part of runtime PM. This flag is aimed at >> power domains coupled to remote processors which enter suspend states >> independent to that of the application processor. Such power domains >> are turned off only on remote processor crash/shutdown. >> >> Signed-off-by: Sibi Sankar > > Seems like a useful use-case, but i think there should be a bit more > description/documentation about what is the expected/desired behavior > during system suspsend when a power-domain with this flag is already > runtime-PM suspended. Similarily, on system resume, what is the > expected/desired behavior? SUSPEND_ON flag is only aimed at keeping power domains powered on across suspend (only if its already powered on). Also if the power domain is runtime-PM suspended we wouldn't want to power it on during resume. diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 0a5afca250d03..547c091618008 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1003,7 +1003,7 @@ static void genpd_sync_power_on(struct generic_pm_domain *genpd, bool use_lock, { struct gpd_link *link; - if (genpd_status_on(genpd)) + if (genpd_status_on(genpd) || genpd_is_suspend_on(genpd)) return; I'll add the ^^ diff in the next re-spin to prevent power on of a runtime-PM suspended power domain. > > Kevin -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.