From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12150C47082 for ; Thu, 3 Jun 2021 19:08:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA97C61009 for ; Thu, 3 Jun 2021 19:08:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229786AbhFCTKd (ORCPT ); Thu, 3 Jun 2021 15:10:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbhFCTKc (ORCPT ); Thu, 3 Jun 2021 15:10:32 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69949C06174A; Thu, 3 Jun 2021 12:08:47 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id c11so8481338ljd.6; Thu, 03 Jun 2021 12:08:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tSg8tzkQArywSk43mbgKRBHIz2Yfe5Of+oE/8zi9t+M=; b=JG/HwBkaJ55V8FyaTfwresS1WJPGo918x+rSkU/RebcMnjdEsBfpTwRL4BM9L07kV+ tjfFI0DnEFbVaAgk2uBRZUk9fVWCJrjU6wc2faqB83+GS+5jL62wjZwyOiI8u8DDMVRJ N+O4tuUwbg1NPBAqYAUl+Pfl9XKckm/N8ZKfHwQYFb3XGGKSnrVfdz3lRisd4Q2tGDIQ lLoob6FG5LWx7ALMFe6D5KjPlVg6P4G/bTrGhYrB7Mxtar1tsorADQTnl3PK/CgJpeNf fQZUFJXt+ZeEiMDPRKAkpWz+AfM3pLGoS+3l7DdSnCDpGKRtgfng/qvo70QLaNqgDEAb 0GqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tSg8tzkQArywSk43mbgKRBHIz2Yfe5Of+oE/8zi9t+M=; b=HxJBNaFcNRaYbiaY6joelkTTgC/B61ynPYx13iQWLONj5k7pg+cuFF2vXIo1Mwazat qi9nKT1CydTS2BnWFXWeufu947+akGFZuEkupivvFDZnvJntpk4ex/wSTjGTw27S9SxO cbMv6Ngo6CyAwEMsUJewpPI4vqhjq4Kj/nOAzlRgERURDjgHlWdfs+gd4B7DqKhv7yYh H93u5II0h5d7fWgxzWcDm/UYnvbqeMwIv4nj6ekfArIcA7ZP61Qc1kJUAVV91JD6p2Px Oi9w/4WZjw1+iKR7m6G3MJZPBxEaycbRhNSqZ7QhcG9djz83Y1UXELwx4i2PGgFrFFXK c+5w== X-Gm-Message-State: AOAM532LBiQI7hZsCHlAlt5jwI3hbHpD6zXwMnOZMPO0kZv/Ztl5jscY zStHiyGwIP7s/KZErEuqSNCnSSe8M74= X-Google-Smtp-Source: ABdhPJw3EI+7WIk7yuTpQPpGCBcBGAHcCTKZfUumUYF3Byn1/NF3wKOLTi0a7tcmGemaz7fF42KTRg== X-Received: by 2002:a2e:bf14:: with SMTP id c20mr602441ljr.57.1622747324663; Thu, 03 Jun 2021 12:08:44 -0700 (PDT) Received: from [192.168.2.145] (79-139-170-222.dynamic.spd-mgts.ru. [79.139.170.222]) by smtp.googlemail.com with ESMTPSA id o19sm396996lfd.22.2021.06.03.12.08.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 12:08:44 -0700 (PDT) Subject: Re: [PATCH v2 3/4] PM: domains: Drop/restore performance state votes for devices at runtime PM From: Dmitry Osipenko To: Ulf Hansson , "Rafael J . Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org Cc: Jonathan Hunter , Thierry Reding , Rajendra Nayak , Stephan Gerhold , Roja Rani Yarubandi , Bjorn Andersson , Vincent Guittot , Stephen Boyd , linux-kernel@vger.kernel.org References: <20210603093438.138705-1-ulf.hansson@linaro.org> <20210603093438.138705-4-ulf.hansson@linaro.org> Message-ID: <1f71868c-7274-b4f8-e66d-dfb47cf44731@gmail.com> Date: Thu, 3 Jun 2021 22:08:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 03.06.2021 22:02, Dmitry Osipenko пишет: > 03.06.2021 12:34, Ulf Hansson пишет: >> 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 performance >> state votes that is managed in genpd for the attached PM domain, may find >> that the aggregated vote can be decreased. Hence, it may allow genpd to 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 things, >> 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