Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp916486rdb; Fri, 20 Oct 2023 03:21:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEAsaEEiCVuakc4n+YWmZXzBSceoQw2VAYKdhUdYP4Juj+3fFmX1bWRA34kDL2Dk16ly7xM X-Received: by 2002:a05:6a00:10c4:b0:6b8:780:94e5 with SMTP id d4-20020a056a0010c400b006b8078094e5mr1392105pfu.18.1697797307853; Fri, 20 Oct 2023 03:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697797307; cv=none; d=google.com; s=arc-20160816; b=IC7ZvkJE1n3XaY0+NZaR3SMedRvMMdxbwUMA89G9a2LvsFh65rv90AYUDoaYMOoRVr cULtepOmg8f0Rnc31RnjN+5qA/oHtO9QaNFk0JByUxOVqDTzvQQJiBSSYYr1jqEJlMNU i1uqClpixmlaMYHcadhpEZIkAgV0Z9QPRA34FiK7oSA4/DAgnDViujZkMtt8pBzu0+yr MR8/EM9frwz3bRCcgwb/32hiMVswTIFsMDtv/WW28MhWp20OWmF7fFYd7vKipkN1HKa6 WeYJ4uZrGB6P01JVfwVg+Z1TUYed0jGUkxE/99bKN7L32+9ekthukAEAPhXOv5Dy2AkV 2tsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=W79U9iklHwLSbhR/94JhGNefp7ntZs362QatUfI3IfI=; fh=nZJSwUHoZdzAYmX6xtxEnz9HM7cA0QGUBLAyl0AHDA4=; b=BHiaRoeR/VPKEMTqXDoosugxUBL0jdEnRvsicNrvjAtSltW5vsy/dS3roiqt86BW7a R1XsCX4A5/hB4Aehidu5I+7it31+t01MZeidwSobVlMxTb6uR8Xst+wHuz81GTfq32gA xw2/seznRHFqbwam1Si5tVHWBjdm9THpdQH4UYoWWwOnc5fqxnvNG7V8mCD3V1A/HvhU qKlpzaBqWdGtBLweF0nkb7l7K3FLwvgRXBDnKicusKuhlO6qh+msuae8sLIlJc4P6Bev ACJEpFHFgNKlXihfIsSQfdEPcXNvuGYJyLrZodhkzAr2ZHsTmuS2aJbYbvYrSkxCL/52 tcCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nfxlTP0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id t4-20020a63f344000000b00563de199314si1552427pgj.896.2023.10.20.03.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 03:21:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nfxlTP0z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D4AF480A73F6; Fri, 20 Oct 2023 03:21:09 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376784AbjJTKUw (ORCPT + 99 others); Fri, 20 Oct 2023 06:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376596AbjJTKUv (ORCPT ); Fri, 20 Oct 2023 06:20:51 -0400 Received: from mail-yw1-x1136.google.com (mail-yw1-x1136.google.com [IPv6:2607:f8b0:4864:20::1136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B460D53 for ; Fri, 20 Oct 2023 03:20:48 -0700 (PDT) Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-5a8ee23f043so6790117b3.3 for ; Fri, 20 Oct 2023 03:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697797247; x=1698402047; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=W79U9iklHwLSbhR/94JhGNefp7ntZs362QatUfI3IfI=; b=nfxlTP0z3z6L6PAXEscyKxYpQTRCM9o0adr1SrnQ9q7CTPZqHv+abj+1QI+m0iKr2+ BBcWd5APgf9VIUg6OVry26MMWPBCNMIkeM3nzriOyFD6/q+KgwZohtWaGScP0H2GohMw eM3dEx+RI6vZdgKAuJXQqLppBga08jWW/11ebkjXAqF5MRBprg1hXmfMcPX2PC9LFN8c wideoaqq7CUToxKN310zNTGaXduLInkr2lJ9+W6obY+h/ynKuDoHRnLKLgwEoD85vP5b NBXLAhzvJnAkR/oQxFosT3LkLycnau5bKrBvF6CWmlKPfhygvnwPUAvv+rROVDedtnpf SebA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697797247; x=1698402047; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W79U9iklHwLSbhR/94JhGNefp7ntZs362QatUfI3IfI=; b=Rg+9AnzCDPxeIK4gyL0EETjF+eaY15Qn8RjaJ/TLYt4vsTs/1TsKDuozB/M2rYqCxH DEjzTQZkrr0/94pEYW3UJqcgIokYgQmSSZ/fxXNFY1u5+e7zpiJUSb4yoJCM+jDGthG4 sC1krB4/r/BD1GuG3/x+32uVWsoevLx6DJm6faR5YJtXlkGjPGkSIvu5durA8CL1sAP0 TF8rSu0SU3JRrNJabdqtpvjA71nJbMnZiUtKb2HYztqIZHPZhUq73uF8Lg9RZV0wx2pb e9vRzG0RDPo7ZHeL8lK93ueHUBxvDpGrVQY+w4NpucEUBtR6omMeY72g5H3IjfoUi9MN Zisg== X-Gm-Message-State: AOJu0Yyr8FGdEnyUurKXh4bN04g7/nmmjh9nJx9H6RmxzJWJ0WU5wIDL Rq9wsQl38sSiv5xhbiDIJFoCkNm1Al+xpoH4W2YpVhV2M8GXJVGU4bQ= X-Received: by 2002:a5b:f4c:0:b0:d9a:3bf1:35e9 with SMTP id y12-20020a5b0f4c000000b00d9a3bf135e9mr1288441ybr.3.1697797247740; Fri, 20 Oct 2023 03:20:47 -0700 (PDT) MIME-Version: 1.0 References: <20231018-msm8909-cpufreq-v2-0-0962df95f654@kernkonzept.com> <20231018-msm8909-cpufreq-v2-2-0962df95f654@kernkonzept.com> In-Reply-To: From: Ulf Hansson Date: Fri, 20 Oct 2023 12:20:11 +0200 Message-ID: Subject: Re: [PATCH v2 2/3] cpufreq: qcom-nvmem: Enable virtual power domain devices To: Stephan Gerhold 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 Content-Type: text/plain; charset="UTF-8" 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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 03:21:09 -0700 (PDT) On Thu, 19 Oct 2023 at 19:08, Stephan Gerhold wrote: > > 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 Yes, correct, that should work fine! > > > 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? I think this boils down to how the power-rail that the genpd manages, is handled by the platform during system suspend. In principle there could be some other separate logic that helps a FW/PMIC to understand whether it needs to keep the power-rail on or not - no matter whether the genpd releases its vote for it during system suspend. This becomes mostly hypothetical, but clearly there are a lot of genpd/platforms that don't use GENPD_FLAG_ACTIVE_WAKEUP too. If those are just mistakes or just not needed, I don't actually know. Kind regards Uffe