Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp498684rdb; Thu, 19 Oct 2023 10:08:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBAj/0qmieEmzya2potOO7pzFwDgnjyuA7kfaz+AQ+YFiNl9UgMcRpmPeBNQJLL0EkugVV X-Received: by 2002:a17:90a:5990:b0:27d:36df:8479 with SMTP id l16-20020a17090a599000b0027d36df8479mr2651388pji.4.1697735290382; Thu, 19 Oct 2023 10:08:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697735290; cv=pass; d=google.com; s=arc-20160816; b=HPVCv75UQCz4S0jDzUywda4a91zvvRhEW0ADBHwp9wH41m2BftulJERieB+SYt3+Oo Md+cE7aD/Qs6Hg7Ee7fjYIxvaBmAMOUXP6wWoyfLMDGSd0QQMyXHD5po/KItfR4jm1bR F1oobiu+YHqcBioRuo5hdIqYZ2s2ywiL1VvLk6KwKe9UYKzxlv7MjfWk8uSVLHIDLxtA uSuS6E6Jerj4ZoK23JZDS/TXzRREcgNXMCA0kCoD+QZL9lw8KWYc7RbryuR068+qA63f nr5I5lkJyNzfWigZse+4GBPkxm87qvAwDgSlhU9Rql5U8LRRhuKiE8GrWp4mC5Fi+t0+ ab7g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=ggdAcZ8XFp1hnFIstd7n2G5k77VgwuMSI/PGdGGtmZ8=; fh=sTqTtI2yqCYRfD1zpGcwA+KdzNICoLHN/KIa/mjzLDY=; b=tByzBtlQvSLbC6FW6h0AMYdVS/2G1cQlSJ8MOCxnK1cwkI5UxuawzOyt+5f7KV3po2 PK3Svk+zgSn2Exv6e/q3z7oluE+4AgZobQlu9MZS9bneVR2GOIZ7Y5ZIQduoJPio7PUJ NJttz4RVrtOwnL6i9uFVzHazpJFBWV5HbthzfdqJjQxBBnE8TT+Bv2MGBzs1KStnTe7F ejuZkPkHPUlebDZwuJusyH0DSMQLy0rqSjKQZEkNpq0Xxb5qYmyEZ9Dw+p/fIsR6mlCm R92ORNCPxQ58CIr2JG3m9BJ7apFe0e1dorGrtYsmecptVZX/v4FatYzdNeB8q0fDH5U7 ppjA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b="SUmf/7em"; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id z1-20020a17090ab10100b0027ce6cd3144si2509503pjq.126.2023.10.19.10.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 10:08:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gerhold.net header.s=strato-dkim-0002 header.b="SUmf/7em"; dkim=neutral (no key) header.i=@gerhold.net; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6D18C82BB1B8; Thu, 19 Oct 2023 10:08:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345139AbjJSRHz (ORCPT + 99 others); Thu, 19 Oct 2023 13:07:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233041AbjJSRHy (ORCPT ); Thu, 19 Oct 2023 13:07:54 -0400 Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F1B9E; Thu, 19 Oct 2023 10:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697735268; cv=none; d=strato.com; s=strato-dkim-0002; b=gL+OYJWOZsBK8wjUer7YzfA6lu2/OAmILo7rXbMEpIo6Q5vpMyC7mSWdbhANMzl7q+ Yu5Sz+ZybFahk9W7740bmh3r2LQT5BzJ9GIa8FZy0cXEABKXDEY8LS0fzGz4GNwzzAo2 7PIAaqu2cgWNqw5JgtFO/ghcduIJuqL9WtdsO3ZItYiXxK8iFxT9KrozvKRvEojXiUCn 1hXv6cMNAJGsvhVYq7ntP5eZ+xrumKheqlDvHcyuDN3ITzSmXHIDuPkDxaiznH/Fz83I 8wDGnOGbV1esiSODY+sD3w13uc8ia4t1qetiLpxsB0ucKa/Z9Vlf5cBXMHaZcdvp/nIG a5Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1697735268; s=strato-dkim-0002; d=strato.com; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ggdAcZ8XFp1hnFIstd7n2G5k77VgwuMSI/PGdGGtmZ8=; b=T8uEwk7akEKn3bWwEfLVQY5L3xK5W0hJHI2EdktHjkdNySOpoSZpJ8sl9eAXEtVwnz P+J2UNQb7RmFnrgApP98u3q24kXUIGQgDv2hlwZfEZzuAgvZp7VCxYq+DTqaNlkjZGbV N+oOEWGaIwpKMKxPUTq3xZPtv+2rrajpsOE1E/VHbjRX9d1eCi9HB8IUyAWLea4U5XSq sVSFQ/EiFq6GfBWeDAD/QVfMyUHbQf2HSc9jqiYy/SDfh7rM5/xzBnqknx/lVFMItKvk wWh2Uw9zNJAWmPqap08exwrIK/zGkyqopS+SAZBHzYJR/DFMa8Ud9FHaZR4QoDdwMFGw Pb4g== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1697735268; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ggdAcZ8XFp1hnFIstd7n2G5k77VgwuMSI/PGdGGtmZ8=; b=SUmf/7em3PDqqlxJi6XO0HJImqy824rDa1rYbI+jD1uANy/YAqLOaFom9WYb+THzPZ iaDWgRpAtIZSJQvVGyRk2U+/KctdVGTBXKNcZrPV+Za6kbIflE60hn7QCoJQYVocVtrQ cjTrSfj26muuvN1xwmWY02Iz7g/mdToTG6efrS0AzAmyLDhLkVUhCQRHIO5/360bsFkP opF4nVSAQIjPPCf2FVhDW6k6n4rUtOwlLdD+CiaAFvOJ++oqgz5PrgTCAgYa2s0hxef3 twDk4RrWo/nWEMlDOQciApA6kKkejkZEpp5rSsfDC5PuIIbknlslSR/ptr6wpsH7262n jFzg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1697735268; s=strato-dkim-0003; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=ggdAcZ8XFp1hnFIstd7n2G5k77VgwuMSI/PGdGGtmZ8=; b=9jhv3SStOE/B1Ma3imgq1ohB5nXLSIXSN7EHHaG3zof6i2DaDRzyTci5sZfrlo/LQN J8uF5e3y68hG2BkmleCw== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u261EJF5OxJD4paA95vh" Received: from gerhold.net by smtp.strato.de (RZmta 49.9.0 DYNA|AUTH) with ESMTPSA id j34a49z9JH7lEPB (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 19 Oct 2023 19:07:47 +0200 (CEST) Date: Thu, 19 Oct 2023 19:07:40 +0200 From: Stephan Gerhold To: Ulf Hansson Cc: Stephan Gerhold , Viresh Kumar , Andy Gross , Bjorn Andersson , Konrad Dybcio , Ilia Lin , "Rafael J. Wysocki" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 2/3] cpufreq: qcom-nvmem: Enable virtual power domain devices Message-ID: References: <20231018-msm8909-cpufreq-v2-0-0962df95f654@kernkonzept.com> <20231018-msm8909-cpufreq-v2-2-0962df95f654@kernkonzept.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 19 Oct 2023 10:08:07 -0700 (PDT) On Thu, Oct 19, 2023 at 05:19:53PM +0200, Ulf Hansson wrote: > On Thu, 19 Oct 2023 at 16:49, Stephan Gerhold wrote: > > On Thu, Oct 19, 2023 at 04:12:56PM +0200, Ulf Hansson wrote: > > > On Thu, 19 Oct 2023 at 15:05, Stephan Gerhold wrote: > > > > On Thu, Oct 19, 2023 at 01:26:19PM +0200, Ulf Hansson wrote: > > > > > BTW, if you really need something like the above, the proper way to do > > > > > it would instead be to call device_set_awake_path() for the device. > > > > > > > > > > This informs genpd that the device needs to stay powered-on during > > > > > system suspend (assuming that GENPD_FLAG_ACTIVE_WAKEUP has been set > > > > > for it), hence it will keep the corresponding PM domain powered-on > > > > > too. > > > > > > > > Thanks, I can try if this works as alternative to the > > > > dev_pm_syscore_device()! > > > > > > Yes, please. We don't want to abuse the dev_pm_syscore_device() thingy. > > > > Could you clarify the idea behind GENPD_FLAG_ACTIVE_WAKEUP? Would I set > > it conditionally for all RPMPDs or just the ones consumed by the CPU? > > How does the genpd *provider* know if one of its *consumer* devices > > needs to have its power domain kept on for wakeup? > > We are thinking of the GENPD_FLAG_ACTIVE_WAKEUP as a platform > configuration type of flag for the genpd in question. The consumer > driver shouldn't need to know about the details of what is happening > on the PM domain level - only whether it needs its device to remain > powered-on during system suspend or not. > Thanks! I will test if this works for RPMPD and post new versions of the patches. By coincidence I think this flag might actually be useful as temporary solution for CPR. If I: 1. Change $subject patch to use device_set_awake_path() instead, and 2. Set GENPD_FLAG_ACTIVE_WAKEUP for the RPMPD genpds, but 3. Do *not* set GENPD_FLAG_ACTIVE_WAKEUP for the CPR genpd. Then the genpd ->power_on|off() callbacks should still be called for CPR during system suspend, right? :D > I suspect that the GENPD_FLAG_ACTIVE_WAKEUP is probably okay to set > for most genpds, but there may be some exceptions. > Out of curiosity, do you have an example for such an exception where GENPD_FLAG_ACTIVE_WAKEUP shouldn't be set, aside from workarounds like I just described? As you said, the consumer device should just say that it wants to stay powered for wakeup during suspend. But if its power domains get powered off, I would expect that to break. How could a genpd driver still provide power without being powered on? Wouldn't that rather be a low performance state? Thanks, Stephan