LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	Rajendra Nayak <rnayak@codeaurora.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
	Linux PM <linux-pm@vger.kernel.org>,
	DTML <devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm-msm <linux-arm-msm@vger.kernel.org>,
	Stephen Boyd <swboyd@chromium.org>,
	Roja Rani Yarubandi <rojay@codeaurora.org>,
	Stephan Gerhold <stephan@gerhold.net>
Subject: Re: [PATCH v6 1/2] PM / Domains: Add support for 'required-opps' to set default perf state
Date: Wed, 11 Aug 2021 12:52:08 +0200	[thread overview]
Message-ID: <CAPDyKFp3xmx1r_2SCbrVcT-CcyUkTUoNgiUMWoyuWw5jE6WLrA@mail.gmail.com> (raw)
In-Reply-To: <20210811100749.kwg6435m7xj7ulwa@vireshk-i7>

On Wed, 11 Aug 2021 at 12:07, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>
> On 11-08-21, 15:30, Rajendra Nayak wrote:
> > In my case I don't want to error out if the property is missing, I want to error out
> > only when the property exists but can't be translated into a performance state.
> >
> > So currently I check if the property exists and *only then* try to translate it, Ulf asked
> > me to skip the check. If I do that and I call of_get_required_opp_performance_state()
> > unconditionally, and if it errors out I will need to put in additional logic (check for
> > return value of ENODEV) to distinguish between the property-does-not-exist vs
> > property-exists-but-cannot-be-translated case.
> > It just seems more straight-forward to call this only when the property exists, Ulf?
>
> The same check will be done by OPP core as well, so it is better to
> optimize for the success case here. I will say, don't error out on
> ENODEV, rest you know well.

This should work, while I generally favor not having to parse for
specific return codes.

Another option is to add a new OPP OF helperfunction that just informs
the caller whether the required-opps property exists (instead of
open-coding that part), and if so, the caller can continue with
of_get_required_opp_performance_state() and then expect it to succeed.

I have no strong opinion though! Whatever works for me.

Kind regards
Uffe

  reply	other threads:[~2021-08-11 10:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 10:58 [PATCH v6 0/2] " Rajendra Nayak
2021-08-04 10:58 ` [PATCH v6 1/2] " Rajendra Nayak
2021-08-06  9:32   ` Ulf Hansson
2021-08-09 11:08     ` Rajendra Nayak
2021-08-10  2:43       ` Viresh Kumar
2021-08-11 10:00         ` Rajendra Nayak
2021-08-11 10:07           ` Viresh Kumar
2021-08-11 10:52             ` Ulf Hansson [this message]
2021-08-11 11:19               ` Viresh Kumar
2021-08-09 22:26   ` Dmitry Osipenko
2021-08-09 22:44     ` Dmitry Osipenko
2021-08-09 23:46       ` Dmitry Osipenko
2021-08-10  0:37         ` Dmitry Osipenko
2021-08-11  9:45         ` Rajendra Nayak
2021-08-11 19:48           ` Dmitry Osipenko
2021-08-12  2:28             ` Dmitry Osipenko
2021-08-04 10:58 ` [PATCH v6 2/2] arm64: dts: sc7180: Add required-opps for i2c Rajendra Nayak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPDyKFp3xmx1r_2SCbrVcT-CcyUkTUoNgiUMWoyuWw5jE6WLrA@mail.gmail.com \
    --to=ulf.hansson@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rnayak@codeaurora.org \
    --cc=rojay@codeaurora.org \
    --cc=stephan@gerhold.net \
    --cc=swboyd@chromium.org \
    --cc=viresh.kumar@linaro.org \
    --subject='Re: [PATCH v6 1/2] PM / Domains: Add support for '\''required-opps'\'' to set default perf state' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).