Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp893350pxj; Fri, 4 Jun 2021 00:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvGr4y6MYtaBK5seCZOTcntBB98x4vkVSRDz/CPK4ITiK7yjr2kNVM0wmnmypiiseFmYte X-Received: by 2002:a17:906:a294:: with SMTP id i20mr2960066ejz.330.1622791418765; Fri, 04 Jun 2021 00:23:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622791418; cv=none; d=google.com; s=arc-20160816; b=TSZmBNkufRjINRybGpYnlc2SZITqKGAOOSJfpH3/6RAbniIVcqRq0XHnY274HWU+yQ f0m9IqqvO+5sIdb0ZX3j4QO+4wgltmvpMRSAWEaQ20Su10KHOBM4tBI7a1XlnKeAjYam k1guGxXbT+Cs1xfRpjpyIaweXKhZdnSAY6YwH2yvHqpjhqPeGJVnAaizXdB2hXLIrlJw s66KzI27SZ/OSXSlYV/T3FE29Jqs2HbDho6tXxI8w86HCa01MJzesnB4C1jakmjBWGcT QrAvIoBQJkpiII4T/SDZuAfmCKI5xDHYqnCWoxaKYt0lhoB5Z5vqstaHIY+6eIwYYXAk 0EYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nCIk2b978NRaiPpxcs7JKBmxKvucKceuB6IoMZqIS40=; b=GDnWR2/N5Kr8HyLMzz6F6Qn8QXvDGnhSljuLafsnqIyH78JD8W1CcjqEwmWCZfCnZE Dpj27T8vILEI+oxr1cGB1aMn461UjvMFEtcC42hcLF1CpZjXAEhaKgDQFTSZjaJaW9z2 SEmm4TiXFz0TH+9HW8CivOVtP4dniIjfcQxipoM18DjDMTdV3XMbfC0vZREIjPD509yG +nvhVG6bT9jqtZUpF+5RfNZxPQPlh1qdyjKc8isXIX6R0xvYbh8TXKuxthTsFIzNkt8C Li9skAYwjtuzgh0kz0tEqb7TIYp5Bn5sHVooWEJxS/jpP+uQwktZ3hH5XZ+jdsimxAGL Ratg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZIGAtPQq; 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 o11si4162127eji.68.2021.06.04.00.23.14; Fri, 04 Jun 2021 00:23: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=pass header.i=@linaro.org header.s=google header.b=ZIGAtPQq; 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 S229947AbhFDHW4 (ORCPT + 99 others); Fri, 4 Jun 2021 03:22:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229555AbhFDHWz (ORCPT ); Fri, 4 Jun 2021 03:22:55 -0400 Received: from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com [IPv6:2607:f8b0:4864:20::e30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18BFBC06174A for ; Fri, 4 Jun 2021 00:21:10 -0700 (PDT) Received: by mail-vs1-xe30.google.com with SMTP id j15so4355593vsf.2 for ; Fri, 04 Jun 2021 00:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nCIk2b978NRaiPpxcs7JKBmxKvucKceuB6IoMZqIS40=; b=ZIGAtPQqaZj90ijBOhbtEN6UbSW6JDVTb3skQKkXyT7Sn8IvLOfzgadfZRY+oDP2ID ZMeBsOwwcqZcFugcOcHXtY5NNpDK+2mU546LBKww5h4NYDSyrNNNsPOhiKTevnFXHH7s 0U2yhPk1/rJWZJPYZfaMSj6RpkI4MmEGE0LNF+9212qjK96rXls7smV///j/yT19szGZ zV/+K4IkUhuy6teg8RCFhVj+4B8zaNhuuigYYBAHNSpRrklQVsDvjM18XvIWkDp3T7fB AWzPc5qfW0mv0KB9xl74Mu1d++YeHgt9Zxn09avq9zUdP4iqQWompMQewBjWqHT095AE 87+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nCIk2b978NRaiPpxcs7JKBmxKvucKceuB6IoMZqIS40=; b=VFsYVoq65u29JWApPy7NHTc/NyQUOAjOAhfu4fdnuxr3UE2jyV1e0910LB6jt7CTwq wJiRRTHd0z3+bQBt3x0ju+gMx81/22Jb3IoJO62/y6fpiqP1/nfDOCgmJOqrOlDuIuHN JdwykSPWAEaqOpZapN5qLM4HkdXaEb5py/PIPu3k6vNsI0HsnLYWVcTQAOxmsUilTGo2 62BnkP5lRTlyAgvEnpP2T3frvrDE2FsU3Q1vhtHPiPS4lsUYpSvdvjMJIBlKaON2zdAG jyWxdr86UwkqjZbcZ9ao7qlkXVOWThJLC09XAs4uhD2gJHlnxqNWsJPYs4THmlz/0hpq cRMA== X-Gm-Message-State: AOAM533cpxXNKW/dtYDUiIYygpjUcMcsjxbaBc5qU8W3KEGlsOJCliY9 NIRRKxdJ5kmXOACf8TZ380jmOBcKqI/wETZD3aKxKw== X-Received: by 2002:a67:1087:: with SMTP id 129mr1490364vsq.42.1622791269253; Fri, 04 Jun 2021 00:21:09 -0700 (PDT) MIME-Version: 1.0 References: <20210603093438.138705-1-ulf.hansson@linaro.org> <20210603093438.138705-4-ulf.hansson@linaro.org> <1f71868c-7274-b4f8-e66d-dfb47cf44731@gmail.com> In-Reply-To: <1f71868c-7274-b4f8-e66d-dfb47cf44731@gmail.com> From: Ulf Hansson Date: Fri, 4 Jun 2021 09:20:33 +0200 Message-ID: Subject: Re: [PATCH v2 3/4] PM: domains: Drop/restore performance state votes for devices at runtime PM To: Dmitry Osipenko Cc: "Rafael J . Wysocki" , Viresh Kumar , Linux PM , Jonathan Hunter , Thierry Reding , Rajendra Nayak , Stephan Gerhold , Roja Rani Yarubandi , Bjorn Andersson , Vincent Guittot , Stephen Boyd , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Jun 2021 at 21:08, Dmitry Osipenko wrote: > > 03.06.2021 22:02, Dmitry Osipenko =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > 03.06.2021 12:34, Ulf Hansson =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > >> A subsystem/driver that need to manage OPPs for its device, should > >> typically drop its vote for the OPP when the device becomes runtime > >> suspended. In this way, the corresponding aggregation of the performan= ce > >> state votes that is managed in genpd for the attached PM domain, may f= ind > >> that the aggregated vote can be decreased. Hence, it may allow genpd t= o set > >> the lower performance state for the PM domain, thus avoiding to waste > >> energy. > >> > >> To accomplish this, typically a subsystem/driver would need to call > >> dev_pm_opp_set_rate|opp() for its device from its ->runtime_suspend() > >> callback, to drop the vote for the OPP. Accordingly, it needs another = call > >> to dev_pm_opp_set_rate|opp() to restore the vote for the OPP from its > >> ->runtime_resume() callback. > >> > >> To avoid boilerplate code in subsystems/driver to deal with these thin= gs, > >> let's instead manage this internally in genpd. > >> > >> Signed-off-by: Ulf Hansson > >> --- > >> > >> Changes in v2: > >> - Rebased. > >> - A few minor cosmetic changes. > >> - Deal with the error path in genpd_runtime_resume(). > > > > I tested this on NVIDIA Tegra by removing the boilerplate code from > > drivers' RPM and haven't noticed any problems, the performance state is > > dropped/restored as expected. Thank you. > > > > Tested-by: Dmitry Osipenko Thanks a lot, much appreciated! Kind regards Uffe