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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29CA5C433EF for ; Fri, 1 Oct 2021 12:51:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E3F961AA8 for ; Fri, 1 Oct 2021 12:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353559AbhJAMwr (ORCPT ); Fri, 1 Oct 2021 08:52:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353253AbhJAMwr (ORCPT ); Fri, 1 Oct 2021 08:52:47 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA161C06177C for ; Fri, 1 Oct 2021 05:51:02 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id b20so38668951lfv.3 for ; Fri, 01 Oct 2021 05:51:02 -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; bh=U3g3FVHcAfq2CjS/tDBEgPrTjvgAlik1UmRsepWrO/M=; b=AzjhIKsGc5F00nF8gT49XgOerH2kylziofl1fTWdcLRpswV4wNz8DKK5xJ7On0pP/7 FUfZ1Wgbt1/fuaxVdMYCvvgTtIGVXfv0UoK33+IzBB+zOi+jh2jn6j2wyaLjswS/IOzw SQjTg3BAouTPEqyD9JFdD9cYzi69CQhCoGH5fKvFHMMepL7XM0KGl/OrspTiy4mR9WhP foe5FrlQSoXx4OG2RW+Mn3fWJuth6XGpzQJ4ILLPGQ/0+fTYG3YwXfmnYk9SirlbmFbB VWqNGRy6BMbC7o4y9fE4zK6CBmWtNh3bv3/HT2LLpsFmdOSr7meyX9U8IJw0f7EYsu6v RPYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=U3g3FVHcAfq2CjS/tDBEgPrTjvgAlik1UmRsepWrO/M=; b=xRkvWlhu6KhL/p1GoXASclRt7VlVL52FiNekCat8ZSkvUUZxk4b4s/glRQcy6uG1kB tQBcBtI7LltL//m+G3EcWhy1p5KtkYBCt68NU4/Oz2dOtKuOj8hrFMfLkGtVcS0FQT3G X8/lmq3JikyQSaZ6J+aXmkXCx6Hzly7hS0WSx2DowxVcOwYcr2mDL0l+vRZ2QYnZO/Sd XxooXiNYAs2IAHO0J+KwfHlNRP+K5FPM/cerPAIVMdwavNqKh54w1M9cHBrpr2u2Xkkc ANxJtSR9ivgttnWFG1x1QKYae9fJfWHOHtYHG34gE93xlG6ut9j3vL+sp5QCzoURqt49 fpdA== X-Gm-Message-State: AOAM532gDDRoJmDLGh1+F5qVDaZauV1Tu15ibFKbjQA3ZhBu3z9pUnM+ AdtUrHpn1DI9AMTlJJQnG+X2N2vESJ7PeYxNtIBbDA== X-Google-Smtp-Source: ABdhPJwqqw8e12Oj8Mbs+ZBogohxgciqSKBUNXiyR2zo3nKqwCJ61Gsrw5pb7r1VVcKkZcvnXQuH+1x0Dzep9YUsgPg= X-Received: by 2002:a19:5f4b:: with SMTP id a11mr5158365lfj.373.1633092661107; Fri, 01 Oct 2021 05:51:01 -0700 (PDT) MIME-Version: 1.0 References: <20210926224058.1252-1-digetx@gmail.com> <20210926224058.1252-3-digetx@gmail.com> In-Reply-To: <20210926224058.1252-3-digetx@gmail.com> From: Ulf Hansson Date: Fri, 1 Oct 2021 14:50:25 +0200 Message-ID: Subject: Re: [PATCH v13 02/35] soc/tegra: Add devm_tegra_core_dev_init_opp_table_common() To: Dmitry Osipenko , Viresh Kumar Cc: Thierry Reding , Jonathan Hunter , Stephen Boyd , Peter De Schrijver , Mikko Perttunen , Peter Chen , Lee Jones , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Nishanth Menon , Adrian Hunter , Michael Turquette , Linux Kernel Mailing List , linux-tegra , Linux PM , Linux USB List , linux-staging@lists.linux.dev, linux-pwm@vger.kernel.org, linux-mmc , dri-devel , DTML , linux-clk , Mark Brown , Vignesh Raghavendra , Richard Weinberger , Miquel Raynal , Lucas Stach , Stefan Agner , Mauro Carvalho Chehab , David Heidelberg Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, 27 Sept 2021 at 00:42, Dmitry Osipenko wrote: > > Only couple drivers need to get the -ENODEV error code and majority of > drivers need to explicitly initialize the performance state. Add new > common helper which sets up OPP table for these drivers. > > Signed-off-by: Dmitry Osipenko > --- > include/soc/tegra/common.h | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/include/soc/tegra/common.h b/include/soc/tegra/common.h > index af41ad80ec21..5b4a042f60fb 100644 > --- a/include/soc/tegra/common.h > +++ b/include/soc/tegra/common.h > @@ -39,4 +39,28 @@ devm_tegra_core_dev_init_opp_table(struct device *dev, > } > #endif > > +/* > + * This function should be invoked with the enabled runtime PM of the device > + * in order to initialize performance state properly. Most of Tegra devices > + * are assumed to be suspended at a probe time and GENPD require RPM to be > + * enabled to set up the rpm-resume state, otherwise device is active and > + * performance state is applied immediately. Note that it will initialize > + * OPP bandwidth if it's wired in a device-tree for this device, which is > + * undesirable for a suspended device. > + */ > +static inline int > +devm_tegra_core_dev_init_opp_table_common(struct device *dev) > +{ > + struct tegra_core_opp_params opp_params = {}; > + int err; > + > + opp_params.init_state = true; > + > + err = devm_tegra_core_dev_init_opp_table(dev, &opp_params); > + if (err != -ENODEV) > + return err; > + > + return 0; > +} Just want to share a few thoughts around these functions. So, I assume it's fine to call devm_tegra_core_dev_init_opp_table_common() or devm_tegra_core_dev_init_opp_table() from consumer drivers during ->probe(), as long as those drivers are tegra specific, which I assume all are in the series!? My point is, a cross SoC consumer driver that needs to initiate OPP tables can get rather messy, if it would need to make one specific function call per SoC. That said, I hope we can tackle this as a separate/future problem, so the series can get merged as is. > + > #endif /* __SOC_TEGRA_COMMON_H__ */ > -- > 2.32.0 > Kind regards Uffe