All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Gerhold <stephan@gerhold.net>
To: Viresh Kumar <vireshk@kernel.org>
Cc: Nishanth Menon <nm@ti.com>, Stephen Boyd <sboyd@kernel.org>,
	linux-pm@vger.kernel.org, Dmitry Osipenko <digetx@gmail.com>
Subject: opp: How to use multiple opp-supported-hw versions properly?
Date: Tue, 25 Aug 2020 09:44:52 +0200	[thread overview]
Message-ID: <20200825074452.GA1322@gerhold.net> (raw)

Hi Viresh,

(an unrelated questions while I investigate the device links ;) )

I'm a bit confused about how to use "opp-supported-hw" properly
when you have multiple versions defined.

In my case I have two version numbers from 0-7, so theoretically up to
64 versions. This does not fit into a single version mask so I added
them as separate versions to the OPP table.

Now let's say I want to limit an OPP to v0.1, v1.0 and v1.1, but not
v0.0. With a single "opp-supported-hw" I think I can only say:

	opp-supported-hw = <0x3 0x3>;

but that does also include v0.0...
I think to exclude that I would need multiple version ranges, e.g.

	opp-supported-hw = <0x1 0x2>, <0x2 0x3>;

This does not seem to be supported, though.

I believe a similar situation exists in tegra20-cpu-opp.dtsi:
The way it was solved there is to duplicate many of the OPP nodes
and set them with different "opp-supported-hw" properties. e.g.

	opp@1000000000,1000 {
		clock-latency-ns = <400000>;
		opp-supported-hw = <0x02 0x0006>; // v1.1 or v1.2
		opp-hz = /bits/ 64 <1000000000>;
	};

	opp@1000000000,1000,0,2 {
		clock-latency-ns = <400000>;
		opp-supported-hw = <0x01 0x0004>; // v0.2
		opp-hz = /bits/ 64 <1000000000>;
	};

I think this is supposed to say v1.1, v1.2 or v0.2, but not v0.1.

I suppose duplicating the OPP node would also work in my case, but
personally I think this just makes the OPP table unnecessarily hard
to understand - especially when there are many more properties like
interconnects, other required-opps, ...

Wouldn't it be much cleaner to allow setting multiple version ranges
for a single "opp-supported-hw" property? The above could then become:

	opp@1000000000,1000 {
		clock-latency-ns = <400000>;
		opp-supported-hw = <0x02 0x0006>, <0x01 0x004>; // v1.1, v1.2 or v0.2
		opp-hz = /bits/ 64 <1000000000>;
	};

Or is there some other option that I'm missing?

Thanks!
Stephan

             reply	other threads:[~2020-08-25  7:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25  7:44 Stephan Gerhold [this message]
2020-08-25  8:16 ` opp: How to use multiple opp-supported-hw versions properly? Viresh Kumar
2020-08-25  8:57   ` Stephan Gerhold
2020-08-25  9:56     ` Viresh Kumar
2020-08-25 10:35       ` Stephan Gerhold
2020-08-26 11:51         ` Viresh Kumar
2020-08-25 10:59   ` Dmitry Osipenko

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=20200825074452.GA1322@gerhold.net \
    --to=stephan@gerhold.net \
    --cc=digetx@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=sboyd@kernel.org \
    --cc=vireshk@kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.