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=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 78D24C4320A for ; Wed, 18 Aug 2021 06:27:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6091660F11 for ; Wed, 18 Aug 2021 06:27:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238117AbhHRG2I (ORCPT ); Wed, 18 Aug 2021 02:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238418AbhHRG2A (ORCPT ); Wed, 18 Aug 2021 02:28:00 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D4B9C061796 for ; Tue, 17 Aug 2021 23:27:26 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id w8so1192821pgf.5 for ; Tue, 17 Aug 2021 23:27:26 -0700 (PDT) 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:content-transfer-encoding:in-reply-to :user-agent; bh=ynpJGQ+aoMGoVR3/TzuLa6jhj83G7NCnezbFysKyDck=; b=rkMxRzllxsu72p9VoE+F1Y2uNFqfHroY89seElO0F/IF9+njGBhH+JhTjiV6p10xBW RZkVVmBoHTbmBO5qy0Cu5P7Yjfpn+Q0pDbpgd//DyVd9iIE8FToCC+snGEMZelh3paY/ +hPtSq0td+yzw80H6HXZomYGW6ujPphQgl+LDlsExLGmraR/J0ZHNe7yOVInyCFXmT/P 91wgqIKeFsyocJA7qECcUweDwMNTMng3I+m8yWPcUOWHp3ukJGcj7wwvK4fm1T2uIjDm QM2rYu2cAoeXaM+8hLCXU5bhhQmCXVpZaudJg93f24DbqOKNah/15WaZUn/RqJ/MrtRh mNtg== 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:content-transfer-encoding :in-reply-to:user-agent; bh=ynpJGQ+aoMGoVR3/TzuLa6jhj83G7NCnezbFysKyDck=; b=By/4Aq0ZWi4tDw7/3jtdjM6ieMYKCgG0MJ8PeqxCl20LU1chpT7HKw4FKCH0QOlMZ4 /FT7xR5nrSBEYzlApDjbnRnztlenK48swY4wlgiSoEWHZahk9wfm2Jizz1eu4maK7e4J x0NGtNK1hEXKSWFCKiM/21wgRmriNnOEH6+b1yuYZGByc3BCMpqRkXa+MGrSyJK7+SAI QUzKFLCXY0sVD/ze8FyTUFMMuODDMuYNqXNdGn1OHxS5EoVMFMkcxJ2p3rZVwDoeKLVj 2uMzyq7PPH2MTy+pnA6pipUnUELesQon5GaQwlWvTOtY7x6e+CnnyccIYh3aNc2sU8Cp frHQ== X-Gm-Message-State: AOAM53131o+KWBtYsAbPjdQ0AkcX6Y+dZFqG+cLzuajZ7Dl6P81f/6l1 2XmARblujAqd5PFkCNdlvrzbCwTMKVbmlg== X-Google-Smtp-Source: ABdhPJyUhfdCbjMBESEOiqAS08eZgxAs7V5/0XRqW4UZTe3K4OmwyniXAPYZlVBrx4vmpFlW5lQzVA== X-Received: by 2002:a62:ea0f:0:b029:319:8eef:5ff1 with SMTP id t15-20020a62ea0f0000b02903198eef5ff1mr7706167pfh.74.1629268045601; Tue, 17 Aug 2021 23:27:25 -0700 (PDT) Received: from localhost ([122.172.201.85]) by smtp.gmail.com with ESMTPSA id l12sm4457595pff.182.2021.08.17.23.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 23:27:24 -0700 (PDT) Date: Wed, 18 Aug 2021 11:57:23 +0530 From: Viresh Kumar To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Ulf Hansson , Viresh Kumar , Stephen Boyd , Peter De Schrijver , Mikko Perttunen , Peter Chen , Mark Brown , Lee Jones , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Nishanth Menon , Vignesh Raghavendra , Richard Weinberger , Miquel Raynal , Lucas Stach , Stefan Agner , Adrian Hunter , Mauro Carvalho Chehab , Rob Herring , Michael Turquette , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, linux-spi@vger.kernel.org, linux-pwm@vger.kernel.org, linux-mtd@lists.infradead.org, linux-mmc@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v8 01/34] opp: Add dev_pm_opp_sync() helper Message-ID: <20210818062723.dqamssfkf7lf7cf7@vireshk-i7> References: <20210817075515.vyyv7z37e6jcrhsl@vireshk-i7> <710261d9-7ae3-5155-c0a2-f8aed2408d0b@gmail.com> <20210818035533.ieqkexltfvvf2p4n@vireshk-i7> <5b2a80c1-9743-e633-6257-ede94c8a274c@gmail.com> <20210818043131.7klajx6drvvkftoc@vireshk-i7> <20210818045307.4brb6cafkh3adjth@vireshk-i7> <080469b3-612b-3a34-86e5-7037a64de2fe@gmail.com> <20210818055849.ybfajzu75ecpdrbn@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18-08-21, 09:22, Dmitry Osipenko wrote: > 18.08.2021 08:58, Viresh Kumar пишет: > > What about calling dev_pm_opp_set_rate(dev, clk_get_rate(dev)) here > > instead ? That will work, right ? The advantage is it works without > > any special routine to do so. > > It will work, but a dedicated helper is nicer. > > > I also wonder looking at your gr3d.c changes, you set a set-opp > > helper, but the driver doesn't call set_opp_rate at all. Who calls it > > ? > > dev_pm_opp_sync() calls it from _set_opp(). Okay, please use dev_pm_opp_set_rate() instead then. New helper just adds to the confusion and isn't doing anything special apart from doing clk_get_rate() for you. > > And if it is all about just syncing the genpd core, then can the genpd > > core do something like what clk framework does? i.e. allow a new > > optional genpd callback, get_performance_state() (just like > > set_performance_state()), which can be called initially by the core to > > get the performance to something other than zero. opp-set-rate is > > there to set the performance state and enable the stuff as well. > > That's why it looks incorrect in your case, where the function was > > only required to be called once, and you are ending up calling it on > > each resume. Limiting that with another local variable is bad as well. > > We discussed variant with get_performance_state() previously and Ulf > didn't like it either since it still requires to touch 'internals' of GENPD. Hmm, I wonder if that would be a problem since only genpd core is going to call that routine anyway. -- viresh