Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp8836240pxu; Sun, 27 Dec 2020 22:24:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyBQX1zS8M2jOWZM3domK+35eZFirnwNkOTl+Gnezd3jCwCXIxjid4DPlWO6LN1XKmp15D3 X-Received: by 2002:aa7:d9c1:: with SMTP id v1mr41388137eds.115.1609136688472; Sun, 27 Dec 2020 22:24:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609136688; cv=none; d=google.com; s=arc-20160816; b=eKcVCN5InotUVOoC/97cdX7Vcn3oBsYolxR1ELvrdGF22ENFSosNXmK3/qJTgzU68L WxIib20DKOLWAT3S/JquQQO/rUPWyhCk7iCADegop1tkwMoJWfpo2zGrh3J8UleXto28 2bjs6lVkbNmnT6jv63iU0N2Bkp1Vdja5QQ2QJ1O76CEH3g+VRj5d+umKWg24nsRRFflx 5xKyDgRzwcLCTtKbJGl2PDriPVssoO36vCQvoqTurfcsOcLQO18EoHSwlR0q88TTM1Vd /H4vkJvn+7imOeEGMFpMjkozmkx6Lg80Yri1fXBWNSINMhXk+siPE0VlKrBMwYPM5W+h 1j/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=bBQaI4eroTRmm0x4+2Q+qEFawwLNxWB2aEwv9ebwMhs=; b=uehJGXvA9vbT977TJacTFwS0/h7aiLvCOjp0PbBSbT8oRWqH5SCwZmbcf9giFW/c3b 6NwfutcjR3QBo6kTcPlw8WjN/Yx2+E6w0XHnbPFaD5c+6vSCKohsvLN/Tj8Wyj1Df4Zu XVv9riMFWG7+Fqwqr1LRCet9BhWJB2MYSATL8HctXNhBwYhXl8IqbU6FWKFVcMrFOEGu iW6VQ6DjN9KfCt9B2yw4cJ5ADQlW09w5TT+ThLHH/iqZ3VPhV2i86QCXWpTySa1vuAA7 F1nNudW728RXp0AY8t/PmgOxuGUed63sonwagqDR59xljjgyoj2CfcZDEAEvcgMnsPIZ C5cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cPdP7kkh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g13si19522287edk.250.2020.12.27.22.24.25; Sun, 27 Dec 2020 22:24:48 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=cPdP7kkh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727991AbgL1GXi (ORCPT + 99 others); Mon, 28 Dec 2020 01:23:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbgL1GXi (ORCPT ); Mon, 28 Dec 2020 01:23:38 -0500 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA5ADC061796 for ; Sun, 27 Dec 2020 22:22:57 -0800 (PST) Received: by mail-pj1-x102a.google.com with SMTP id j13so5977712pjz.3 for ; Sun, 27 Dec 2020 22:22:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bBQaI4eroTRmm0x4+2Q+qEFawwLNxWB2aEwv9ebwMhs=; b=cPdP7kkh/2GQAzg0cOAkSgg+4Z/Q6YFPDrT8cPEIWgPQcde3qUGxURpjfO6E1bHDX5 X3avIcaIwpZe0l5RjuLs76tegwm2PWF2nIR/3NFqEyoyL7mMQKM38y/oXu8UPBoXDCBe owAlPnx2QEhE97fGYccJS79yI+KQx2U4UXdsmGweTOUwrLsDu9pmHU4Huwoutx9pTsoP 8diXqSx2xAX1gQQbPKkftl20krrAxVSUChxQV7zKgsn7WSoMJGr4Sq7KmuEZCIbsqfdm KKxISWBxSfoIxY6pIT71NfdMH7ym7iMSKRQNzxwpLFNAeRNw43wKsq5DXii3GeV4pWs7 Va4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bBQaI4eroTRmm0x4+2Q+qEFawwLNxWB2aEwv9ebwMhs=; b=pah+LUAfNzgx5+1AKa/e/hL81H3TlAE2QKKwNWjsUwk8NqBmM0CsHsE6fFMgi7HYbM J9NE+JA3cuMmrDCMOsdtjWPv3X0wm3xWeBk4IoJKuajXJ5tD8PDsyaMmCSBvKP9DO/RI nFa3MafuMrCY/bJxEwtD8e461zvq4r7kU+MGQJIiNPfpasCnKygO/bEthkBwkfybrvOA bfR0lSohfR+fUmi36SzHHR31sYqjLXP23eaUa07dU6Jnls7Q1PUn3Xb/vyRGyBUHNk/t WdEa327T2pcng/+0dfZFic5pjWpcbToLl7gpGsGmVaQExduZ9rkQoaInVi5gVclSpgdn ABEA== X-Gm-Message-State: AOAM5315ELacDF7BcUhups97MKwCaI/u9bKIyh69EDyyJYCY5V4RWtEt /pJKV75aXmWY7qLgOt7PYRnxFQ== X-Received: by 2002:a17:902:7291:b029:dc:c69:e985 with SMTP id d17-20020a1709027291b02900dc0c69e985mr20695263pll.33.1609136577345; Sun, 27 Dec 2020 22:22:57 -0800 (PST) Received: from localhost ([122.172.20.109]) by smtp.gmail.com with ESMTPSA id q70sm13313850pja.39.2020.12.27.22.22.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Dec 2020 22:22:56 -0800 (PST) Date: Mon, 28 Dec 2020 11:52:54 +0530 From: Viresh Kumar To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Mark Brown , Liam Girdwood , Ulf Hansson , Mauro Carvalho Chehab , Rob Herring , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski , "Rafael J. Wysocki" , Kevin Hilman , Peter De Schrijver , Viresh Kumar , Stephen Boyd , Michael Turquette , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-tegra@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v2 11/48] opp: Add dev_pm_opp_find_level_ceil() Message-ID: <20201228062254.ui727ka2ftijov4m@vireshk-i7> References: <20201217180638.22748-1-digetx@gmail.com> <20201217180638.22748-12-digetx@gmail.com> <20201222064253.x7vsurh7q5k7qzb5@vireshk-i7> <20201223041931.klnppy4fu3sdgtsz@vireshk-i7> <20201224064339.zngidobhstnlu2a3@vireshk-i7> <780db190-d93d-3bca-4819-790010f82c62@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <780db190-d93d-3bca-4819-790010f82c62@gmail.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24-12-20, 16:00, Dmitry Osipenko wrote: > In a device driver I want to set PD to the lowest performance state by > removing the performance vote when dev_pm_opp_set_rate(dev, 0) is > invoked by the driver. > > The OPP core already does this, but if OPP levels don't start from 0 in > a device-tree for PD, then it currently doesn't work since there is a > need to get a rounded-up performance state because > dev_pm_opp_set_voltage() takes OPP entry for the argument (patches 9 and > 28). > > The PD powering off and performance-changes are separate from each other > in the GENPD core. The GENPD core automatically turns off domain when > all devices within the domain are suspended by system-suspend or RPM. > > The performance state of a power domain is controlled solely by a device > driver. GENPD core only aggregates the performance requests, it doesn't > change the performance state of a domain by itself when device is > suspended or resumed, IIUC this is intentional. And I want to put domain > into lowest performance state when device is suspended. Right, so if you really want to just drop the performance vote, then with a value of 0 for the performance state the call will reach to your genpd's callback ->set_performance_state(). Just as dev_pm_opp_set_rate() accepts the frequency to be 0, I would expect dev_pm_opp_set_rate() to accept opp argument as NULL and in that case set voltage to 0 and do regulator_disable() as well. Won't that work better than going for the lowest voltage ? -- viresh