Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-12 Thread Stephen Boyd
On 01/10, Viresh Kumar wrote:
> On 09-01-18, 18:54, Stephen Boyd wrote:
> > My read of Kevin's comments lead me to think he's saying that a
> > generic 'domain-performance-state' property is worse than putting
> > the numbers directly inside of the opp table with a comment above
> > it. Now that's all fine, but now that we have required-opps
> > binding we sort of have the domain-performance-state property
> > again, but it's a phandle instead of a raw state number.
> > 
> > So we have
> > 
> > required-opps = <_state>;
> > 
> > but what was proposed before was
> > 
> > domain-performance-state = <1>;
> > 
> > or Kevin's 
> > 
> > opp-table = <10 1>;
> 
> His concern was also on what will we do if "frequency" or other OPP
> properties aren't known tomorrow by the kernel but the firmware? In
> Qcom case, its just the voltage (corner) today, but it can very well
> be other properties tomorrow. Are we going to add more platform
> specific bindings then ?

Yes, we would add more bindings.

> And this is the main reason why I have been
> aligned towards using something like this patch.

Once we exceed the number of properties that can fit into the
existing voltage and frequency properties we'll only be able to
make it work by adding a platform specific property. That's one
concern, but it's a future concern so it's not a real problem
yet.

If you can clearly describe in the commit text why we shouldn't
use platform specific properties it would be helpful.

> 
> If we drop the magic-values idea and hence this patch, then we can
> either add a "domain-performance-state" property, which will only be
> used by the power domains or leave it for the platforms to add
> something like "qcom,corner".
> 
> All we are doing here is putting a voltage (corner) value, unknown to
> the kernel, in a new property instead of "opp-microvolt". But the
> above question still remains, what about other properties that may
> need magic values in future.
> 
> Honestly speaking, I am not sure what's the right thing to do here. I
> will do whatever you and Rob incline for.
> 

Hopefully Rob and Kevin can reply here.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-12 Thread Stephen Boyd
On 01/10, Viresh Kumar wrote:
> On 09-01-18, 18:54, Stephen Boyd wrote:
> > My read of Kevin's comments lead me to think he's saying that a
> > generic 'domain-performance-state' property is worse than putting
> > the numbers directly inside of the opp table with a comment above
> > it. Now that's all fine, but now that we have required-opps
> > binding we sort of have the domain-performance-state property
> > again, but it's a phandle instead of a raw state number.
> > 
> > So we have
> > 
> > required-opps = <_state>;
> > 
> > but what was proposed before was
> > 
> > domain-performance-state = <1>;
> > 
> > or Kevin's 
> > 
> > opp-table = <10 1>;
> 
> His concern was also on what will we do if "frequency" or other OPP
> properties aren't known tomorrow by the kernel but the firmware? In
> Qcom case, its just the voltage (corner) today, but it can very well
> be other properties tomorrow. Are we going to add more platform
> specific bindings then ?

Yes, we would add more bindings.

> And this is the main reason why I have been
> aligned towards using something like this patch.

Once we exceed the number of properties that can fit into the
existing voltage and frequency properties we'll only be able to
make it work by adding a platform specific property. That's one
concern, but it's a future concern so it's not a real problem
yet.

If you can clearly describe in the commit text why we shouldn't
use platform specific properties it would be helpful.

> 
> If we drop the magic-values idea and hence this patch, then we can
> either add a "domain-performance-state" property, which will only be
> used by the power domains or leave it for the platforms to add
> something like "qcom,corner".
> 
> All we are doing here is putting a voltage (corner) value, unknown to
> the kernel, in a new property instead of "opp-microvolt". But the
> above question still remains, what about other properties that may
> need magic values in future.
> 
> Honestly speaking, I am not sure what's the right thing to do here. I
> will do whatever you and Rob incline for.
> 

Hopefully Rob and Kevin can reply here.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-09 Thread Viresh Kumar
On 09-01-18, 18:54, Stephen Boyd wrote:
> My read of Kevin's comments lead me to think he's saying that a
> generic 'domain-performance-state' property is worse than putting
> the numbers directly inside of the opp table with a comment above
> it. Now that's all fine, but now that we have required-opps
> binding we sort of have the domain-performance-state property
> again, but it's a phandle instead of a raw state number.
> 
> So we have
> 
>   required-opps = <_state>;
> 
> but what was proposed before was
> 
>   domain-performance-state = <1>;
> 
> or Kevin's 
> 
>   opp-table = <10 1>;

His concern was also on what will we do if "frequency" or other OPP
properties aren't known tomorrow by the kernel but the firmware? In
Qcom case, its just the voltage (corner) today, but it can very well
be other properties tomorrow. Are we going to add more platform
specific bindings then ? And this is the main reason why I have been
aligned towards using something like this patch.

If we drop the magic-values idea and hence this patch, then we can
either add a "domain-performance-state" property, which will only be
used by the power domains or leave it for the platforms to add
something like "qcom,corner".

All we are doing here is putting a voltage (corner) value, unknown to
the kernel, in a new property instead of "opp-microvolt". But the
above question still remains, what about other properties that may
need magic values in future.

Honestly speaking, I am not sure what's the right thing to do here. I
will do whatever you and Rob incline for.

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-09 Thread Viresh Kumar
On 09-01-18, 18:54, Stephen Boyd wrote:
> My read of Kevin's comments lead me to think he's saying that a
> generic 'domain-performance-state' property is worse than putting
> the numbers directly inside of the opp table with a comment above
> it. Now that's all fine, but now that we have required-opps
> binding we sort of have the domain-performance-state property
> again, but it's a phandle instead of a raw state number.
> 
> So we have
> 
>   required-opps = <_state>;
> 
> but what was proposed before was
> 
>   domain-performance-state = <1>;
> 
> or Kevin's 
> 
>   opp-table = <10 1>;

His concern was also on what will we do if "frequency" or other OPP
properties aren't known tomorrow by the kernel but the firmware? In
Qcom case, its just the voltage (corner) today, but it can very well
be other properties tomorrow. Are we going to add more platform
specific bindings then ? And this is the main reason why I have been
aligned towards using something like this patch.

If we drop the magic-values idea and hence this patch, then we can
either add a "domain-performance-state" property, which will only be
used by the power domains or leave it for the platforms to add
something like "qcom,corner".

All we are doing here is putting a voltage (corner) value, unknown to
the kernel, in a new property instead of "opp-microvolt". But the
above question still remains, what about other properties that may
need magic values in future.

Honestly speaking, I am not sure what's the right thing to do here. I
will do whatever you and Rob incline for.

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-09 Thread Stephen Boyd
On 01/08, Viresh Kumar wrote:
> On 05-01-18, 14:19, Stephen Boyd wrote:
> > On 12/29, Viresh Kumar wrote:
> 
> > Could you please point to Kevin's comments and also include the
> 
> https://lkml.kernel.org/r/m2r30i4w35@baylibre.com

Ok. That thread was months ago. Shocked I can't remember!

My read of Kevin's comments lead me to think he's saying that a
generic 'domain-performance-state' property is worse than putting
the numbers directly inside of the opp table with a comment above
it. Now that's all fine, but now that we have required-opps
binding we sort of have the domain-performance-state property
again, but it's a phandle instead of a raw state number.

So we have

required-opps = <_state>;

but what was proposed before was

domain-performance-state = <1>;

or Kevin's 

opp-table = <10 1>;

>From what I can tell, the domain-performance-state proposal was
at the same abstraction level as the OPP itself, but now that's
moved to be inside of the power domain OPPs. So now we're talking
about describing some power domains performance levels with the
OPP binding, for a power domain, not describing a performance
state for some unknown power domain that's associated with a
device's OPP table.

The power domain is not running at any sort of frequency for us.
It's using some particular voltage, but we may or may not know
what that voltage is depending on the platform. This makes me see
it as 

power_domain_opp {

low: point0 {
opp-microvolt = <95>
};

medium: point1 {
opp-microvolt = <975000>
};

high: point2 {
opp-microvolt = <100>
};
};

for some sort of power domain that deals with voltages. This
makes perfect sense. The power domain needs to be at some voltage
and the binding says that. Honestly, the whole required-opps
thing works great here and it's all wonderful, and it looks like
can even be used for other OPP linking in the future, like
connecting frequencies between CPUs and caches.

Where it starts to break down is when the voltage isn't known to
the user, just some number that we've agreed means "low",
"medium", "high" or whatever. Again, the binding looks similar:


power_domain_opp {
low: point0 {
qcom,corner = <0>;
};

medium: point1 {
qcom,corner = <10>;
};

high: point2 {
qcom,corner = <250>;
};
};

but now the number is only meaningful to the power domain driver.
What we really care about is associating some firmware specific
information via the phandle to some frequency that a device is
using. Behind the scenes of the firmware, that number is really
being translated into some voltage, like opp-microvolt =
<95>, but we don't know what that is and it could vary at
runtime.

It all feels really close, and it totally works for the non-magic
value parts that we have to deal with, but I'm not convinced that
we should stick the firmware specific information into some
generic OPP property just so we don't have to review the binding
again. Hopefully there's some other reason why we shouldn't come
up with a firmware specific binding for this piece of
information.

> > >  * If we choose to use platform-specific bindings instead of 
> > > opp-hz,
> > >  * then only this routine requires to change to read the DT and 
> > > provide
> > >  * the value from platform specific binding.
> > 
> > If we wanted to change this function to do a platform specific
> > thing, will we somehow get a way to access the DT node of the opp
> > passed into this function?
> 
> Yes, we can do that. The OPP core already stores pointer to the node
> in the OPP structure, we will just need another API to expose that.

Great!

> 
> > Also, I don't see how the foo_get_performance function will use
> > the genpd pointer passed here. Maybe that's never used?
> 
> It depends actually and I think its better to pass it anyway. What if
> a single driver is handling multiple genpds and wants to do things
> differently for them? It should know which genpd it is called for,
> looks like  basic requirement to me.

Ok, fair enough.

> 
> > Finally, I would think that a "getter" like this function would
> > be informing the framework about what the current performance
> > state is, not translating an OPP into a performance state. So the
> > whole thing looks like a misnomer, and probably should be called
> > something like xlate_opp_performance.
> 
> Sure, I can name it anything.

Alright. Sounds like my read of the code is correct.

> 
> So the question still stands, are we all okay for using magic values
> or we want platform specific properties ?
> 

Kevin?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-09 Thread Stephen Boyd
On 01/08, Viresh Kumar wrote:
> On 05-01-18, 14:19, Stephen Boyd wrote:
> > On 12/29, Viresh Kumar wrote:
> 
> > Could you please point to Kevin's comments and also include the
> 
> https://lkml.kernel.org/r/m2r30i4w35@baylibre.com

Ok. That thread was months ago. Shocked I can't remember!

My read of Kevin's comments lead me to think he's saying that a
generic 'domain-performance-state' property is worse than putting
the numbers directly inside of the opp table with a comment above
it. Now that's all fine, but now that we have required-opps
binding we sort of have the domain-performance-state property
again, but it's a phandle instead of a raw state number.

So we have

required-opps = <_state>;

but what was proposed before was

domain-performance-state = <1>;

or Kevin's 

opp-table = <10 1>;

>From what I can tell, the domain-performance-state proposal was
at the same abstraction level as the OPP itself, but now that's
moved to be inside of the power domain OPPs. So now we're talking
about describing some power domains performance levels with the
OPP binding, for a power domain, not describing a performance
state for some unknown power domain that's associated with a
device's OPP table.

The power domain is not running at any sort of frequency for us.
It's using some particular voltage, but we may or may not know
what that voltage is depending on the platform. This makes me see
it as 

power_domain_opp {

low: point0 {
opp-microvolt = <95>
};

medium: point1 {
opp-microvolt = <975000>
};

high: point2 {
opp-microvolt = <100>
};
};

for some sort of power domain that deals with voltages. This
makes perfect sense. The power domain needs to be at some voltage
and the binding says that. Honestly, the whole required-opps
thing works great here and it's all wonderful, and it looks like
can even be used for other OPP linking in the future, like
connecting frequencies between CPUs and caches.

Where it starts to break down is when the voltage isn't known to
the user, just some number that we've agreed means "low",
"medium", "high" or whatever. Again, the binding looks similar:


power_domain_opp {
low: point0 {
qcom,corner = <0>;
};

medium: point1 {
qcom,corner = <10>;
};

high: point2 {
qcom,corner = <250>;
};
};

but now the number is only meaningful to the power domain driver.
What we really care about is associating some firmware specific
information via the phandle to some frequency that a device is
using. Behind the scenes of the firmware, that number is really
being translated into some voltage, like opp-microvolt =
<95>, but we don't know what that is and it could vary at
runtime.

It all feels really close, and it totally works for the non-magic
value parts that we have to deal with, but I'm not convinced that
we should stick the firmware specific information into some
generic OPP property just so we don't have to review the binding
again. Hopefully there's some other reason why we shouldn't come
up with a firmware specific binding for this piece of
information.

> > >  * If we choose to use platform-specific bindings instead of 
> > > opp-hz,
> > >  * then only this routine requires to change to read the DT and 
> > > provide
> > >  * the value from platform specific binding.
> > 
> > If we wanted to change this function to do a platform specific
> > thing, will we somehow get a way to access the DT node of the opp
> > passed into this function?
> 
> Yes, we can do that. The OPP core already stores pointer to the node
> in the OPP structure, we will just need another API to expose that.

Great!

> 
> > Also, I don't see how the foo_get_performance function will use
> > the genpd pointer passed here. Maybe that's never used?
> 
> It depends actually and I think its better to pass it anyway. What if
> a single driver is handling multiple genpds and wants to do things
> differently for them? It should know which genpd it is called for,
> looks like  basic requirement to me.

Ok, fair enough.

> 
> > Finally, I would think that a "getter" like this function would
> > be informing the framework about what the current performance
> > state is, not translating an OPP into a performance state. So the
> > whole thing looks like a misnomer, and probably should be called
> > something like xlate_opp_performance.
> 
> Sure, I can name it anything.

Alright. Sounds like my read of the code is correct.

> 
> So the question still stands, are we all okay for using magic values
> or we want platform specific properties ?
> 

Kevin?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-07 Thread Viresh Kumar
On 05-01-18, 14:19, Stephen Boyd wrote:
> On 12/29, Viresh Kumar wrote:

> Could you please point to Kevin's comments and also include the

https://lkml.kernel.org/r/m2r30i4w35@baylibre.com

> reasoning behind magic values in the commit text for the patch?
> It would be very helpful to know why something is done a certain
> way. The two to three line commit text in this patch is not
> helpful right now.

Sure.

> > https://github.com/rrnayak/linux/commits/genpd-performance-state
> 
> Thanks for the pointer. That whole matching devices with
> of_match_device() is not looking good.

Yeah, I agree, but that was done because we didn't had these bindings
then. Once these bindings are in place, we wouldn't require the
of_match_device() thingy.

> I don't see how we're going to convince each driver to move to
> using the OPP framework to set a performance state + clk
> frequency when they're going to want/need to have certain clks
> and regulators in hand to do something besides set the frequency
> or voltage. Probably we're going to have a hybrid approach, where
> some drivers can just set rate and voltage through OPP because
> it's fairly well fixed (think CPU or GPU frequency scaling),
> while other drivers are going to set frequency and
> voltage/performance state based on some calculation of their
> required frequency (think of display panels or even the uart baud
> rate or i2c bus frequency requirements).

The OPP framework doesn't (and shouldn't) force drivers to move to the
dev_pm_opp_set_rate() API. That is optional and is provided to make
user code simpler.

So, if a driver wants to handle everything by itself, it will just use
the OPP core as "provider" for the data it needs and do everything by
itself.

> For these other drivers, I don't really want to see the OPP
> framework proxy all the clk and regulator calls into the
> appropriate framework by wrapping clk_round_rate(),
> regulator_set_load(), etc. with opp_*() APIs. This becomes
> especially annoying if OPP framework is grabbing and holding
> these clk and regulator references in the core, instead of
> letting the driver figure that out and tell the OPP framework
> what resources it should operate on.

Sure.

> So really, I'm hoping that OPP framework "stays away" and acts as
> a data hole, sometimes, where we can look up the performance
> state for a particular frequency, but also have it do everything
> to set some particular performance state and frequency, etc. if
> the user wants that.

That's how I see it as well.

> And also OPP framework hopefully doesn't
> force a rigid set of frequencies that a particular clk can be set
> to, so that we can calculate frequencies for things like display
> panels based on height and width of the panel, or uart baud rate
> which is entirely use-case driven, and then ask OPP framework to
> tell us what the performance state of a particular domain would
> be if we are within some frequency range. Because sometimes we
> really can't determine every possible frequency that a clk can be
> running at, but we can figure out the maximum frequency that a
> clk can be running at for a particular voltage/performance state
> to support it.

That makes sense to me. We can do that once we have someone who wants
to use OPP core for such devices.

> I'm not asking for test code. A git tree pointer in cover letter
> is sufficient, with the full and complete solution to the
> problem. Then only a few patches out of the tree sent to the list
> is fine if you want to chunk it up into sub-topics. That way the
> list and reviewers aren't overloaded, but if someone wants to
> review the full picture they can do that easily.

That's fine.

> > mmc_opp_table: mmc-opp-table {
> > compatible = "operating-points-v2";
> > opp-shared;
> > 
> > opp00 {
> > opp-hz = /bits/ 64 <20800>;
> > required-opp = <_opp_1>;
> 
> It can have multiple phandles though, right? Makes me think it
> should have been called 'required-opps' instead.

Okay.

> > static unsigned int foo_get_performance(struct generic_pm_domain *genpd,
> > struct dev_pm_opp *opp)
> > {
> > /*
> >  * Simply return freq value as we passed the state in opp-hz.
> >  *
> >  * If we choose to use platform-specific bindings instead of opp-hz,
> >  * then only this routine requires to change to read the DT and 
> > provide
> >  * the value from platform specific binding.
> 
> If we wanted to change this function to do a platform specific
> thing, will we somehow get a way to access the DT node of the opp
> passed into this function?

Yes, we can do that. The OPP core already stores pointer to the node
in the OPP structure, we will just need another API to expose that.

> Also, I don't see how the foo_get_performance function will use
> the genpd pointer 

Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-07 Thread Viresh Kumar
On 05-01-18, 14:19, Stephen Boyd wrote:
> On 12/29, Viresh Kumar wrote:

> Could you please point to Kevin's comments and also include the

https://lkml.kernel.org/r/m2r30i4w35@baylibre.com

> reasoning behind magic values in the commit text for the patch?
> It would be very helpful to know why something is done a certain
> way. The two to three line commit text in this patch is not
> helpful right now.

Sure.

> > https://github.com/rrnayak/linux/commits/genpd-performance-state
> 
> Thanks for the pointer. That whole matching devices with
> of_match_device() is not looking good.

Yeah, I agree, but that was done because we didn't had these bindings
then. Once these bindings are in place, we wouldn't require the
of_match_device() thingy.

> I don't see how we're going to convince each driver to move to
> using the OPP framework to set a performance state + clk
> frequency when they're going to want/need to have certain clks
> and regulators in hand to do something besides set the frequency
> or voltage. Probably we're going to have a hybrid approach, where
> some drivers can just set rate and voltage through OPP because
> it's fairly well fixed (think CPU or GPU frequency scaling),
> while other drivers are going to set frequency and
> voltage/performance state based on some calculation of their
> required frequency (think of display panels or even the uart baud
> rate or i2c bus frequency requirements).

The OPP framework doesn't (and shouldn't) force drivers to move to the
dev_pm_opp_set_rate() API. That is optional and is provided to make
user code simpler.

So, if a driver wants to handle everything by itself, it will just use
the OPP core as "provider" for the data it needs and do everything by
itself.

> For these other drivers, I don't really want to see the OPP
> framework proxy all the clk and regulator calls into the
> appropriate framework by wrapping clk_round_rate(),
> regulator_set_load(), etc. with opp_*() APIs. This becomes
> especially annoying if OPP framework is grabbing and holding
> these clk and regulator references in the core, instead of
> letting the driver figure that out and tell the OPP framework
> what resources it should operate on.

Sure.

> So really, I'm hoping that OPP framework "stays away" and acts as
> a data hole, sometimes, where we can look up the performance
> state for a particular frequency, but also have it do everything
> to set some particular performance state and frequency, etc. if
> the user wants that.

That's how I see it as well.

> And also OPP framework hopefully doesn't
> force a rigid set of frequencies that a particular clk can be set
> to, so that we can calculate frequencies for things like display
> panels based on height and width of the panel, or uart baud rate
> which is entirely use-case driven, and then ask OPP framework to
> tell us what the performance state of a particular domain would
> be if we are within some frequency range. Because sometimes we
> really can't determine every possible frequency that a clk can be
> running at, but we can figure out the maximum frequency that a
> clk can be running at for a particular voltage/performance state
> to support it.

That makes sense to me. We can do that once we have someone who wants
to use OPP core for such devices.

> I'm not asking for test code. A git tree pointer in cover letter
> is sufficient, with the full and complete solution to the
> problem. Then only a few patches out of the tree sent to the list
> is fine if you want to chunk it up into sub-topics. That way the
> list and reviewers aren't overloaded, but if someone wants to
> review the full picture they can do that easily.

That's fine.

> > mmc_opp_table: mmc-opp-table {
> > compatible = "operating-points-v2";
> > opp-shared;
> > 
> > opp00 {
> > opp-hz = /bits/ 64 <20800>;
> > required-opp = <_opp_1>;
> 
> It can have multiple phandles though, right? Makes me think it
> should have been called 'required-opps' instead.

Okay.

> > static unsigned int foo_get_performance(struct generic_pm_domain *genpd,
> > struct dev_pm_opp *opp)
> > {
> > /*
> >  * Simply return freq value as we passed the state in opp-hz.
> >  *
> >  * If we choose to use platform-specific bindings instead of opp-hz,
> >  * then only this routine requires to change to read the DT and 
> > provide
> >  * the value from platform specific binding.
> 
> If we wanted to change this function to do a platform specific
> thing, will we somehow get a way to access the DT node of the opp
> passed into this function?

Yes, we can do that. The OPP core already stores pointer to the node
in the OPP structure, we will just need another API to expose that.

> Also, I don't see how the foo_get_performance function will use
> the genpd pointer 

Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-05 Thread Stephen Boyd
On 12/29, Viresh Kumar wrote:
> On 28-12-17, 16:32, Stephen Boyd wrote:
> > On 12/28, Viresh Kumar wrote:
> 
> > > So what we need now is:
> > > 
> > > - Stephen to start responding and clarify all the doubts he had as being 
> > > silent
> > >   isn't helping.
> > 
> > What can I reply to specifically?
> 
> I explained in detail how this stuff is going to get used last time you 
> replied.
> Did you get a chance to look at that ? What am I supposed to do when you don't
> reply back to the clarifications I provide ?
> 
> https://marc.info/?l=linux-kernel=151202516128980=2
> 
> > From what I can tell, the
> > patches have changed to this 'opp-required' thing in the past
> > week and the position of 'generic OPP layer interprets magic
> > values' doesn't look to have changed. Is that the summary? I can
> > look deeply at the patches tomorrow.
> 
> Kind of yeah, because you didn't reply to my explanation on how the magic 
> values
> are going to get used and so they never changed. Again, I don't have problems
> adding new property for performance-state thing or leave it for the platform,
> but I was sticking around the magic values because Kevin was strongly in favor
> of that earlier.

Could you please point to Kevin's comments and also include the
reasoning behind magic values in the commit text for the patch?
It would be very helpful to know why something is done a certain
way. The two to three line commit text in this patch is not
helpful right now.

> 
> > > - Or Rajendra to post patches which can prove that this is usable. The 
> > > last time
> > >   I had a chat with him, he confirmed that he will post patches after 
> > > 4.15-rc1
> > >   and he should have posted them by now, but he didn't :(
> > > 
> > 
> > I'd prefer either that, or some tree here that we can look at.
> 
> I am quite sure Rajendra can help here, he had been testing this stuff on 
> *real*
> hardware for ages now with me. This is what he shared with me earlier, based 
> on
> what we have merged in the kernel today..
> 
> https://github.com/rrnayak/linux/commits/genpd-performance-state

Thanks for the pointer. That whole matching devices with
of_match_device() is not looking good.

I don't see how we're going to convince each driver to move to
using the OPP framework to set a performance state + clk
frequency when they're going to want/need to have certain clks
and regulators in hand to do something besides set the frequency
or voltage. Probably we're going to have a hybrid approach, where
some drivers can just set rate and voltage through OPP because
it's fairly well fixed (think CPU or GPU frequency scaling),
while other drivers are going to set frequency and
voltage/performance state based on some calculation of their
required frequency (think of display panels or even the uart baud
rate or i2c bus frequency requirements).

For these other drivers, I don't really want to see the OPP
framework proxy all the clk and regulator calls into the
appropriate framework by wrapping clk_round_rate(),
regulator_set_load(), etc. with opp_*() APIs. This becomes
especially annoying if OPP framework is grabbing and holding
these clk and regulator references in the core, instead of
letting the driver figure that out and tell the OPP framework
what resources it should operate on.

So really, I'm hoping that OPP framework "stays away" and acts as
a data hole, sometimes, where we can look up the performance
state for a particular frequency, but also have it do everything
to set some particular performance state and frequency, etc. if
the user wants that. And also OPP framework hopefully doesn't
force a rigid set of frequencies that a particular clk can be set
to, so that we can calculate frequencies for things like display
panels based on height and width of the panel, or uart baud rate
which is entirely use-case driven, and then ask OPP framework to
tell us what the performance state of a particular domain would
be if we are within some frequency range. Because sometimes we
really can't determine every possible frequency that a clk can be
running at, but we can figure out the maximum frequency that a
clk can be running at for a particular voltage/performance state
to support it.

> 
> > I said this last time, I'm having a really hard time seeing how
> > everything is going to work. The little drip of code, then DT
> > binding, then maybe a small change in dts files, then maybe some
> > code that uses the new APIs, etc. is pretty annoying. From my
> > perspective you've chopped the problem up into pieces that don't
> > stand on their own and then started sending patches for some
> > parts without showing the overall result. It's like we're being
> > taken on a ride in your development workflow, and we don't get to
> > see what's coming around the corner, and the only assumption I
> > can make is that you don't know either.
> > 
> > I'm actually confused how any of the code is even tested or used.
> > It looks like things are getting merged without 

Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-05 Thread Stephen Boyd
On 12/29, Viresh Kumar wrote:
> On 28-12-17, 16:32, Stephen Boyd wrote:
> > On 12/28, Viresh Kumar wrote:
> 
> > > So what we need now is:
> > > 
> > > - Stephen to start responding and clarify all the doubts he had as being 
> > > silent
> > >   isn't helping.
> > 
> > What can I reply to specifically?
> 
> I explained in detail how this stuff is going to get used last time you 
> replied.
> Did you get a chance to look at that ? What am I supposed to do when you don't
> reply back to the clarifications I provide ?
> 
> https://marc.info/?l=linux-kernel=151202516128980=2
> 
> > From what I can tell, the
> > patches have changed to this 'opp-required' thing in the past
> > week and the position of 'generic OPP layer interprets magic
> > values' doesn't look to have changed. Is that the summary? I can
> > look deeply at the patches tomorrow.
> 
> Kind of yeah, because you didn't reply to my explanation on how the magic 
> values
> are going to get used and so they never changed. Again, I don't have problems
> adding new property for performance-state thing or leave it for the platform,
> but I was sticking around the magic values because Kevin was strongly in favor
> of that earlier.

Could you please point to Kevin's comments and also include the
reasoning behind magic values in the commit text for the patch?
It would be very helpful to know why something is done a certain
way. The two to three line commit text in this patch is not
helpful right now.

> 
> > > - Or Rajendra to post patches which can prove that this is usable. The 
> > > last time
> > >   I had a chat with him, he confirmed that he will post patches after 
> > > 4.15-rc1
> > >   and he should have posted them by now, but he didn't :(
> > > 
> > 
> > I'd prefer either that, or some tree here that we can look at.
> 
> I am quite sure Rajendra can help here, he had been testing this stuff on 
> *real*
> hardware for ages now with me. This is what he shared with me earlier, based 
> on
> what we have merged in the kernel today..
> 
> https://github.com/rrnayak/linux/commits/genpd-performance-state

Thanks for the pointer. That whole matching devices with
of_match_device() is not looking good.

I don't see how we're going to convince each driver to move to
using the OPP framework to set a performance state + clk
frequency when they're going to want/need to have certain clks
and regulators in hand to do something besides set the frequency
or voltage. Probably we're going to have a hybrid approach, where
some drivers can just set rate and voltage through OPP because
it's fairly well fixed (think CPU or GPU frequency scaling),
while other drivers are going to set frequency and
voltage/performance state based on some calculation of their
required frequency (think of display panels or even the uart baud
rate or i2c bus frequency requirements).

For these other drivers, I don't really want to see the OPP
framework proxy all the clk and regulator calls into the
appropriate framework by wrapping clk_round_rate(),
regulator_set_load(), etc. with opp_*() APIs. This becomes
especially annoying if OPP framework is grabbing and holding
these clk and regulator references in the core, instead of
letting the driver figure that out and tell the OPP framework
what resources it should operate on.

So really, I'm hoping that OPP framework "stays away" and acts as
a data hole, sometimes, where we can look up the performance
state for a particular frequency, but also have it do everything
to set some particular performance state and frequency, etc. if
the user wants that. And also OPP framework hopefully doesn't
force a rigid set of frequencies that a particular clk can be set
to, so that we can calculate frequencies for things like display
panels based on height and width of the panel, or uart baud rate
which is entirely use-case driven, and then ask OPP framework to
tell us what the performance state of a particular domain would
be if we are within some frequency range. Because sometimes we
really can't determine every possible frequency that a clk can be
running at, but we can figure out the maximum frequency that a
clk can be running at for a particular voltage/performance state
to support it.

> 
> > I said this last time, I'm having a really hard time seeing how
> > everything is going to work. The little drip of code, then DT
> > binding, then maybe a small change in dts files, then maybe some
> > code that uses the new APIs, etc. is pretty annoying. From my
> > perspective you've chopped the problem up into pieces that don't
> > stand on their own and then started sending patches for some
> > parts without showing the overall result. It's like we're being
> > taken on a ride in your development workflow, and we don't get to
> > see what's coming around the corner, and the only assumption I
> > can make is that you don't know either.
> > 
> > I'm actually confused how any of the code is even tested or used.
> > It looks like things are getting merged without 

Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-01 Thread Viresh Kumar
On 02-01-18, 11:35, Rajendra Nayak wrote:
> I would want to reiterate what I have been saying for a while, that for these 
> patches
> to be usable on any qualcomm platform completely we need support to associate
> multiple power-domains to a single device which is missing today.

Sure, but I had the understanding based on our last communication that
you are going to go with partial support for now and multiple domain
thing will be done later on.

> What I have been testing with these patches is to move a single user (MMC, 
> which BTW does not
> have to put requests on multiple powerdomains) to use this solution on a 
> db820c (msm8996) device.

Right.

> Getting this merged now can open up issues for other devices (which can't 
> move to this solution)
> since MMC alone would put requests to pull a *common* rail up/down while 
> others can't.

Even on that I thought that you will artificially vote for a high
requirement for those devices from some platform code initially, and
remove that code once all the device drivers (you need) are updated to
post their own requirements.

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-01 Thread Viresh Kumar
On 02-01-18, 11:35, Rajendra Nayak wrote:
> I would want to reiterate what I have been saying for a while, that for these 
> patches
> to be usable on any qualcomm platform completely we need support to associate
> multiple power-domains to a single device which is missing today.

Sure, but I had the understanding based on our last communication that
you are going to go with partial support for now and multiple domain
thing will be done later on.

> What I have been testing with these patches is to move a single user (MMC, 
> which BTW does not
> have to put requests on multiple powerdomains) to use this solution on a 
> db820c (msm8996) device.

Right.

> Getting this merged now can open up issues for other devices (which can't 
> move to this solution)
> since MMC alone would put requests to pull a *common* rail up/down while 
> others can't.

Even on that I thought that you will artificially vote for a high
requirement for those devices from some platform code initially, and
remove that code once all the device drivers (you need) are updated to
post their own requirements.

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-01 Thread Rajendra Nayak


On 12/28/2017 10:07 AM, Viresh Kumar wrote:
> On 27-12-17, 15:54, Rob Herring wrote:
>> On Wed, Dec 27, 2017 at 2:56 AM, Viresh Kumar  
>> wrote:
>>> On 26-12-17, 14:29, Rob Herring wrote:
 On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
>>>
> +On some platforms the exact frequency or voltage may be hidden from the 
> OS by
> +the firmware and the "opp-hz" or the "opp-microvolt" properties may 
> contain
> +magic values that represent the frequency or voltage in a firmware 
> dependent
> +way, for example an index of an array in the firmware.

 I'm still not convinced this is a good idea.
>>>
>>> You were kind-of a few days back :)
>>>
>>> lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com
>>
>> Yeah, well that was before Stephen said anything.
>>
>>> So here is the deal:
>>>
>>> - I proposed "domain-performance-state" property for this stuff
>>>   initially.
>>> - But Kevin didn't like that and proposed reusing "opp-hz" and
>>>   "opp-microvolt", which we all agreed to multiple times..
>>> - And we are back to the same discussion now and its painful and time
>>>   killing for all of us.
>>
>> There's bigger issues than where we put magic values as I raised in
>> the other patch.
>>
>>> TBH, I don't have too strong preferences about any of the suggestions
>>> you guys have and I need you guys to tell me what binding changes to
>>> do here and I will do that.
>>>
 If you have firmware
 partially managing things, then I think we should have platform specific
 bindings or drivers.
>>>
>>> What about the initial idea then, like "performance-state" for the
>>> power domains ? All platforms will anyway replicate that binding only.
>>
>> I don't really know. I don't really care either. I'll probably go
>> along with what everyone agrees to, but the only one I see any
>> agreement from is Ulf. Also, it is pretty vague as to what platforms
>> will use this. You claimed you can support QCom scenarios, but there's
>> really no evidence that that is true.
> 
> Well, I sent out the code few days back based on these bindings and everyone 
> can
> see how these bindings will get used now.
> 
>> What I don't want to see is this
>> merged and then we need something more yet again in a few months for
>> another platform.
> 
> Sure, I get your concerns.
> 
> So what we need now is:
> 
> - Stephen to start responding and clarify all the doubts he had as being 
> silent
>   isn't helping.
> 
> - Or Rajendra to post patches which can prove that this is usable. The last 
> time
>   I had a chat with him, he confirmed that he will post patches after 4.15-rc1
>   and he should have posted them by now, but he didn't :(

I would want to reiterate what I have been saying for a while, that for these 
patches
to be usable on any qualcomm platform completely we need support to associate
multiple power-domains to a single device which is missing today.

The last time this came up during a discussion at connect, I believe the 
understanding
was to get this (performance state support) merged *after* we decide how to 
support
multiple powerdomains per device.

What I have been testing with these patches is to move a single user (MMC, 
which BTW does not
have to put requests on multiple powerdomains) to use this solution on a db820c 
(msm8996) device.
Getting this merged now can open up issues for other devices (which can't move 
to this solution)
since MMC alone would put requests to pull a *common* rail up/down while others 
can't.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2018-01-01 Thread Rajendra Nayak


On 12/28/2017 10:07 AM, Viresh Kumar wrote:
> On 27-12-17, 15:54, Rob Herring wrote:
>> On Wed, Dec 27, 2017 at 2:56 AM, Viresh Kumar  
>> wrote:
>>> On 26-12-17, 14:29, Rob Herring wrote:
 On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
>>>
> +On some platforms the exact frequency or voltage may be hidden from the 
> OS by
> +the firmware and the "opp-hz" or the "opp-microvolt" properties may 
> contain
> +magic values that represent the frequency or voltage in a firmware 
> dependent
> +way, for example an index of an array in the firmware.

 I'm still not convinced this is a good idea.
>>>
>>> You were kind-of a few days back :)
>>>
>>> lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com
>>
>> Yeah, well that was before Stephen said anything.
>>
>>> So here is the deal:
>>>
>>> - I proposed "domain-performance-state" property for this stuff
>>>   initially.
>>> - But Kevin didn't like that and proposed reusing "opp-hz" and
>>>   "opp-microvolt", which we all agreed to multiple times..
>>> - And we are back to the same discussion now and its painful and time
>>>   killing for all of us.
>>
>> There's bigger issues than where we put magic values as I raised in
>> the other patch.
>>
>>> TBH, I don't have too strong preferences about any of the suggestions
>>> you guys have and I need you guys to tell me what binding changes to
>>> do here and I will do that.
>>>
 If you have firmware
 partially managing things, then I think we should have platform specific
 bindings or drivers.
>>>
>>> What about the initial idea then, like "performance-state" for the
>>> power domains ? All platforms will anyway replicate that binding only.
>>
>> I don't really know. I don't really care either. I'll probably go
>> along with what everyone agrees to, but the only one I see any
>> agreement from is Ulf. Also, it is pretty vague as to what platforms
>> will use this. You claimed you can support QCom scenarios, but there's
>> really no evidence that that is true.
> 
> Well, I sent out the code few days back based on these bindings and everyone 
> can
> see how these bindings will get used now.
> 
>> What I don't want to see is this
>> merged and then we need something more yet again in a few months for
>> another platform.
> 
> Sure, I get your concerns.
> 
> So what we need now is:
> 
> - Stephen to start responding and clarify all the doubts he had as being 
> silent
>   isn't helping.
> 
> - Or Rajendra to post patches which can prove that this is usable. The last 
> time
>   I had a chat with him, he confirmed that he will post patches after 4.15-rc1
>   and he should have posted them by now, but he didn't :(

I would want to reiterate what I have been saying for a while, that for these 
patches
to be usable on any qualcomm platform completely we need support to associate
multiple power-domains to a single device which is missing today.

The last time this came up during a discussion at connect, I believe the 
understanding
was to get this (performance state support) merged *after* we decide how to 
support
multiple powerdomains per device.

What I have been testing with these patches is to move a single user (MMC, 
which BTW does not
have to put requests on multiple powerdomains) to use this solution on a db820c 
(msm8996) device.
Getting this merged now can open up issues for other devices (which can't move 
to this solution)
since MMC alone would put requests to pull a *common* rail up/down while others 
can't.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-28 Thread Viresh Kumar
On 28-12-17, 16:32, Stephen Boyd wrote:
> On 12/28, Viresh Kumar wrote:

> > So what we need now is:
> > 
> > - Stephen to start responding and clarify all the doubts he had as being 
> > silent
> >   isn't helping.
> 
> What can I reply to specifically?

I explained in detail how this stuff is going to get used last time you replied.
Did you get a chance to look at that ? What am I supposed to do when you don't
reply back to the clarifications I provide ?

https://marc.info/?l=linux-kernel=151202516128980=2

> From what I can tell, the
> patches have changed to this 'opp-required' thing in the past
> week and the position of 'generic OPP layer interprets magic
> values' doesn't look to have changed. Is that the summary? I can
> look deeply at the patches tomorrow.

Kind of yeah, because you didn't reply to my explanation on how the magic values
are going to get used and so they never changed. Again, I don't have problems
adding new property for performance-state thing or leave it for the platform,
but I was sticking around the magic values because Kevin was strongly in favor
of that earlier.

> > - Or Rajendra to post patches which can prove that this is usable. The last 
> > time
> >   I had a chat with him, he confirmed that he will post patches after 
> > 4.15-rc1
> >   and he should have posted them by now, but he didn't :(
> > 
> 
> I'd prefer either that, or some tree here that we can look at.

I am quite sure Rajendra can help here, he had been testing this stuff on *real*
hardware for ages now with me. This is what he shared with me earlier, based on
what we have merged in the kernel today..

https://github.com/rrnayak/linux/commits/genpd-performance-state

> I said this last time, I'm having a really hard time seeing how
> everything is going to work. The little drip of code, then DT
> binding, then maybe a small change in dts files, then maybe some
> code that uses the new APIs, etc. is pretty annoying. From my
> perspective you've chopped the problem up into pieces that don't
> stand on their own and then started sending patches for some
> parts without showing the overall result. It's like we're being
> taken on a ride in your development workflow, and we don't get to
> see what's coming around the corner, and the only assumption I
> can make is that you don't know either.
> 
> I'm actually confused how any of the code is even tested or used.
> It looks like things are getting merged without any users, for
> what exactly I'm not sure. Please, please, get an end-to-end
> solution going and actually use the code from day one on a real
> device that can use it.

There is just too much code, specially Qcom specific, and I can't fit all that
in a single series really. Its going to be more annoying for people to see that.
I used to keep some Qcom test code in the earlier series which got merged and
was told by Rajendra that the Qcom stuff will get posted after 4.15-rc1, but
that didn't happen. I can't post final code for that as it touches lots of
things and its Qcom who needs to upstream it. Now how much test code can I keep
supplying every time ?

I have already posted the code that will use these bindings few days back:

https://lkml.kernel.org/r/cover.1513926033.git.viresh.ku...@linaro.org

The only missing part left now (after bindings and above series) is, again,
platform specific Qcom code to use it. Below is some dummy code to complete the
story for you:

DT changes that shows two devices, mmc and dsp, using the performances states of
domain:

foo: foo-power-domain@0900 {
compatible = "foo,genpd";
#power-domain-cells = <0>;
operating-points-v2 = <_opp_table>;
};

domain_opp_table: domain_opp_table {
compatible = "operating-points-v2";

domain_opp_1: opp00 {
opp-hz = /bits/ 64 <1>; //This is performances 
state
};
domain_opp_2: opp01 {
opp-hz = /bits/ 64 <2>;
};
domain_opp_3: opp02 {
opp-hz = /bits/ 64 <3>;
};
};

mmc@f7112000 {
compatible = "***";

***


power-domains = <>;
operating-points-v2 = <_opp_table>;
};


mmc_opp_table: mmc-opp-table {
compatible = "operating-points-v2";
opp-shared;

opp00 {
opp-hz = /bits/ 64 <20800>;
required-opp = <_opp_1>;
};
opp01 {
opp-hz = /bits/ 64 <43200>;

Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-28 Thread Viresh Kumar
On 28-12-17, 16:32, Stephen Boyd wrote:
> On 12/28, Viresh Kumar wrote:

> > So what we need now is:
> > 
> > - Stephen to start responding and clarify all the doubts he had as being 
> > silent
> >   isn't helping.
> 
> What can I reply to specifically?

I explained in detail how this stuff is going to get used last time you replied.
Did you get a chance to look at that ? What am I supposed to do when you don't
reply back to the clarifications I provide ?

https://marc.info/?l=linux-kernel=151202516128980=2

> From what I can tell, the
> patches have changed to this 'opp-required' thing in the past
> week and the position of 'generic OPP layer interprets magic
> values' doesn't look to have changed. Is that the summary? I can
> look deeply at the patches tomorrow.

Kind of yeah, because you didn't reply to my explanation on how the magic values
are going to get used and so they never changed. Again, I don't have problems
adding new property for performance-state thing or leave it for the platform,
but I was sticking around the magic values because Kevin was strongly in favor
of that earlier.

> > - Or Rajendra to post patches which can prove that this is usable. The last 
> > time
> >   I had a chat with him, he confirmed that he will post patches after 
> > 4.15-rc1
> >   and he should have posted them by now, but he didn't :(
> > 
> 
> I'd prefer either that, or some tree here that we can look at.

I am quite sure Rajendra can help here, he had been testing this stuff on *real*
hardware for ages now with me. This is what he shared with me earlier, based on
what we have merged in the kernel today..

https://github.com/rrnayak/linux/commits/genpd-performance-state

> I said this last time, I'm having a really hard time seeing how
> everything is going to work. The little drip of code, then DT
> binding, then maybe a small change in dts files, then maybe some
> code that uses the new APIs, etc. is pretty annoying. From my
> perspective you've chopped the problem up into pieces that don't
> stand on their own and then started sending patches for some
> parts without showing the overall result. It's like we're being
> taken on a ride in your development workflow, and we don't get to
> see what's coming around the corner, and the only assumption I
> can make is that you don't know either.
> 
> I'm actually confused how any of the code is even tested or used.
> It looks like things are getting merged without any users, for
> what exactly I'm not sure. Please, please, get an end-to-end
> solution going and actually use the code from day one on a real
> device that can use it.

There is just too much code, specially Qcom specific, and I can't fit all that
in a single series really. Its going to be more annoying for people to see that.
I used to keep some Qcom test code in the earlier series which got merged and
was told by Rajendra that the Qcom stuff will get posted after 4.15-rc1, but
that didn't happen. I can't post final code for that as it touches lots of
things and its Qcom who needs to upstream it. Now how much test code can I keep
supplying every time ?

I have already posted the code that will use these bindings few days back:

https://lkml.kernel.org/r/cover.1513926033.git.viresh.ku...@linaro.org

The only missing part left now (after bindings and above series) is, again,
platform specific Qcom code to use it. Below is some dummy code to complete the
story for you:

DT changes that shows two devices, mmc and dsp, using the performances states of
domain:

foo: foo-power-domain@0900 {
compatible = "foo,genpd";
#power-domain-cells = <0>;
operating-points-v2 = <_opp_table>;
};

domain_opp_table: domain_opp_table {
compatible = "operating-points-v2";

domain_opp_1: opp00 {
opp-hz = /bits/ 64 <1>; //This is performances 
state
};
domain_opp_2: opp01 {
opp-hz = /bits/ 64 <2>;
};
domain_opp_3: opp02 {
opp-hz = /bits/ 64 <3>;
};
};

mmc@f7112000 {
compatible = "***";

***


power-domains = <>;
operating-points-v2 = <_opp_table>;
};


mmc_opp_table: mmc-opp-table {
compatible = "operating-points-v2";
opp-shared;

opp00 {
opp-hz = /bits/ 64 <20800>;
required-opp = <_opp_1>;
};
opp01 {
opp-hz = /bits/ 64 <43200>;

Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-28 Thread Stephen Boyd
On 12/28, Viresh Kumar wrote:
> On 27-12-17, 15:54, Rob Herring wrote:
> > 
> > I don't really know. I don't really care either. I'll probably go
> > along with what everyone agrees to, but the only one I see any
> > agreement from is Ulf. Also, it is pretty vague as to what platforms
> > will use this. You claimed you can support QCom scenarios, but there's
> > really no evidence that that is true.
> 
> Well, I sent out the code few days back based on these bindings and everyone 
> can
> see how these bindings will get used now.
> 
> > What I don't want to see is this
> > merged and then we need something more yet again in a few months for
> > another platform.
> 
> Sure, I get your concerns.
> 
> So what we need now is:
> 
> - Stephen to start responding and clarify all the doubts he had as being 
> silent
>   isn't helping.

What can I reply to specifically? From what I can tell, the
patches have changed to this 'opp-required' thing in the past
week and the position of 'generic OPP layer interprets magic
values' doesn't look to have changed. Is that the summary? I can
look deeply at the patches tomorrow.

> 
> - Or Rajendra to post patches which can prove that this is usable. The last 
> time
>   I had a chat with him, he confirmed that he will post patches after 4.15-rc1
>   and he should have posted them by now, but he didn't :(
> 

I'd prefer either that, or some tree here that we can look at. I
said this last time, I'm having a really hard time seeing how
everything is going to work. The little drip of code, then DT
binding, then maybe a small change in dts files, then maybe some
code that uses the new APIs, etc. is pretty annoying. From my
perspective you've chopped the problem up into pieces that don't
stand on their own and then started sending patches for some
parts without showing the overall result. It's like we're being
taken on a ride in your development workflow, and we don't get to
see what's coming around the corner, and the only assumption I
can make is that you don't know either.

I'm actually confused how any of the code is even tested or used.
It looks like things are getting merged without any users, for
what exactly I'm not sure. Please, please, get an end-to-end
solution going and actually use the code from day one on a real
device that can use it.

Sorry for the rant, but my inbox keeps filling with patches for
this series and I have no idea what's going on.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-28 Thread Stephen Boyd
On 12/28, Viresh Kumar wrote:
> On 27-12-17, 15:54, Rob Herring wrote:
> > 
> > I don't really know. I don't really care either. I'll probably go
> > along with what everyone agrees to, but the only one I see any
> > agreement from is Ulf. Also, it is pretty vague as to what platforms
> > will use this. You claimed you can support QCom scenarios, but there's
> > really no evidence that that is true.
> 
> Well, I sent out the code few days back based on these bindings and everyone 
> can
> see how these bindings will get used now.
> 
> > What I don't want to see is this
> > merged and then we need something more yet again in a few months for
> > another platform.
> 
> Sure, I get your concerns.
> 
> So what we need now is:
> 
> - Stephen to start responding and clarify all the doubts he had as being 
> silent
>   isn't helping.

What can I reply to specifically? From what I can tell, the
patches have changed to this 'opp-required' thing in the past
week and the position of 'generic OPP layer interprets magic
values' doesn't look to have changed. Is that the summary? I can
look deeply at the patches tomorrow.

> 
> - Or Rajendra to post patches which can prove that this is usable. The last 
> time
>   I had a chat with him, he confirmed that he will post patches after 4.15-rc1
>   and he should have posted them by now, but he didn't :(
> 

I'd prefer either that, or some tree here that we can look at. I
said this last time, I'm having a really hard time seeing how
everything is going to work. The little drip of code, then DT
binding, then maybe a small change in dts files, then maybe some
code that uses the new APIs, etc. is pretty annoying. From my
perspective you've chopped the problem up into pieces that don't
stand on their own and then started sending patches for some
parts without showing the overall result. It's like we're being
taken on a ride in your development workflow, and we don't get to
see what's coming around the corner, and the only assumption I
can make is that you don't know either.

I'm actually confused how any of the code is even tested or used.
It looks like things are getting merged without any users, for
what exactly I'm not sure. Please, please, get an end-to-end
solution going and actually use the code from day one on a real
device that can use it.

Sorry for the rant, but my inbox keeps filling with patches for
this series and I have no idea what's going on.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-27 Thread Viresh Kumar
On 27-12-17, 15:54, Rob Herring wrote:
> On Wed, Dec 27, 2017 at 2:56 AM, Viresh Kumar  wrote:
> > On 26-12-17, 14:29, Rob Herring wrote:
> >> On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
> >
> >> > +On some platforms the exact frequency or voltage may be hidden from the 
> >> > OS by
> >> > +the firmware and the "opp-hz" or the "opp-microvolt" properties may 
> >> > contain
> >> > +magic values that represent the frequency or voltage in a firmware 
> >> > dependent
> >> > +way, for example an index of an array in the firmware.
> >>
> >> I'm still not convinced this is a good idea.
> >
> > You were kind-of a few days back :)
> >
> > lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com
> 
> Yeah, well that was before Stephen said anything.
> 
> > So here is the deal:
> >
> > - I proposed "domain-performance-state" property for this stuff
> >   initially.
> > - But Kevin didn't like that and proposed reusing "opp-hz" and
> >   "opp-microvolt", which we all agreed to multiple times..
> > - And we are back to the same discussion now and its painful and time
> >   killing for all of us.
> 
> There's bigger issues than where we put magic values as I raised in
> the other patch.
> 
> > TBH, I don't have too strong preferences about any of the suggestions
> > you guys have and I need you guys to tell me what binding changes to
> > do here and I will do that.
> >
> >> If you have firmware
> >> partially managing things, then I think we should have platform specific
> >> bindings or drivers.
> >
> > What about the initial idea then, like "performance-state" for the
> > power domains ? All platforms will anyway replicate that binding only.
> 
> I don't really know. I don't really care either. I'll probably go
> along with what everyone agrees to, but the only one I see any
> agreement from is Ulf. Also, it is pretty vague as to what platforms
> will use this. You claimed you can support QCom scenarios, but there's
> really no evidence that that is true.

Well, I sent out the code few days back based on these bindings and everyone can
see how these bindings will get used now.

> What I don't want to see is this
> merged and then we need something more yet again in a few months for
> another platform.

Sure, I get your concerns.

So what we need now is:

- Stephen to start responding and clarify all the doubts he had as being silent
  isn't helping.

- Or Rajendra to post patches which can prove that this is usable. The last time
  I had a chat with him, he confirmed that he will post patches after 4.15-rc1
  and he should have posted them by now, but he didn't :(

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-27 Thread Viresh Kumar
On 27-12-17, 15:54, Rob Herring wrote:
> On Wed, Dec 27, 2017 at 2:56 AM, Viresh Kumar  wrote:
> > On 26-12-17, 14:29, Rob Herring wrote:
> >> On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
> >
> >> > +On some platforms the exact frequency or voltage may be hidden from the 
> >> > OS by
> >> > +the firmware and the "opp-hz" or the "opp-microvolt" properties may 
> >> > contain
> >> > +magic values that represent the frequency or voltage in a firmware 
> >> > dependent
> >> > +way, for example an index of an array in the firmware.
> >>
> >> I'm still not convinced this is a good idea.
> >
> > You were kind-of a few days back :)
> >
> > lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com
> 
> Yeah, well that was before Stephen said anything.
> 
> > So here is the deal:
> >
> > - I proposed "domain-performance-state" property for this stuff
> >   initially.
> > - But Kevin didn't like that and proposed reusing "opp-hz" and
> >   "opp-microvolt", which we all agreed to multiple times..
> > - And we are back to the same discussion now and its painful and time
> >   killing for all of us.
> 
> There's bigger issues than where we put magic values as I raised in
> the other patch.
> 
> > TBH, I don't have too strong preferences about any of the suggestions
> > you guys have and I need you guys to tell me what binding changes to
> > do here and I will do that.
> >
> >> If you have firmware
> >> partially managing things, then I think we should have platform specific
> >> bindings or drivers.
> >
> > What about the initial idea then, like "performance-state" for the
> > power domains ? All platforms will anyway replicate that binding only.
> 
> I don't really know. I don't really care either. I'll probably go
> along with what everyone agrees to, but the only one I see any
> agreement from is Ulf. Also, it is pretty vague as to what platforms
> will use this. You claimed you can support QCom scenarios, but there's
> really no evidence that that is true.

Well, I sent out the code few days back based on these bindings and everyone can
see how these bindings will get used now.

> What I don't want to see is this
> merged and then we need something more yet again in a few months for
> another platform.

Sure, I get your concerns.

So what we need now is:

- Stephen to start responding and clarify all the doubts he had as being silent
  isn't helping.

- Or Rajendra to post patches which can prove that this is usable. The last time
  I had a chat with him, he confirmed that he will post patches after 4.15-rc1
  and he should have posted them by now, but he didn't :(

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-27 Thread Rob Herring
On Wed, Dec 27, 2017 at 2:56 AM, Viresh Kumar  wrote:
> On 26-12-17, 14:29, Rob Herring wrote:
>> On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
>
>> > +On some platforms the exact frequency or voltage may be hidden from the 
>> > OS by
>> > +the firmware and the "opp-hz" or the "opp-microvolt" properties may 
>> > contain
>> > +magic values that represent the frequency or voltage in a firmware 
>> > dependent
>> > +way, for example an index of an array in the firmware.
>>
>> I'm still not convinced this is a good idea.
>
> You were kind-of a few days back :)
>
> lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com

Yeah, well that was before Stephen said anything.

> So here is the deal:
>
> - I proposed "domain-performance-state" property for this stuff
>   initially.
> - But Kevin didn't like that and proposed reusing "opp-hz" and
>   "opp-microvolt", which we all agreed to multiple times..
> - And we are back to the same discussion now and its painful and time
>   killing for all of us.

There's bigger issues than where we put magic values as I raised in
the other patch.

> TBH, I don't have too strong preferences about any of the suggestions
> you guys have and I need you guys to tell me what binding changes to
> do here and I will do that.
>
>> If you have firmware
>> partially managing things, then I think we should have platform specific
>> bindings or drivers.
>
> What about the initial idea then, like "performance-state" for the
> power domains ? All platforms will anyway replicate that binding only.

I don't really know. I don't really care either. I'll probably go
along with what everyone agrees to, but the only one I see any
agreement from is Ulf. Also, it is pretty vague as to what platforms
will use this. You claimed you can support QCom scenarios, but there's
really no evidence that that is true. What I don't want to see is this
merged and then we need something more yet again in a few months for
another platform.

Rob


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-27 Thread Rob Herring
On Wed, Dec 27, 2017 at 2:56 AM, Viresh Kumar  wrote:
> On 26-12-17, 14:29, Rob Herring wrote:
>> On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
>
>> > +On some platforms the exact frequency or voltage may be hidden from the 
>> > OS by
>> > +the firmware and the "opp-hz" or the "opp-microvolt" properties may 
>> > contain
>> > +magic values that represent the frequency or voltage in a firmware 
>> > dependent
>> > +way, for example an index of an array in the firmware.
>>
>> I'm still not convinced this is a good idea.
>
> You were kind-of a few days back :)
>
> lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com

Yeah, well that was before Stephen said anything.

> So here is the deal:
>
> - I proposed "domain-performance-state" property for this stuff
>   initially.
> - But Kevin didn't like that and proposed reusing "opp-hz" and
>   "opp-microvolt", which we all agreed to multiple times..
> - And we are back to the same discussion now and its painful and time
>   killing for all of us.

There's bigger issues than where we put magic values as I raised in
the other patch.

> TBH, I don't have too strong preferences about any of the suggestions
> you guys have and I need you guys to tell me what binding changes to
> do here and I will do that.
>
>> If you have firmware
>> partially managing things, then I think we should have platform specific
>> bindings or drivers.
>
> What about the initial idea then, like "performance-state" for the
> power domains ? All platforms will anyway replicate that binding only.

I don't really know. I don't really care either. I'll probably go
along with what everyone agrees to, but the only one I see any
agreement from is Ulf. Also, it is pretty vague as to what platforms
will use this. You claimed you can support QCom scenarios, but there's
really no evidence that that is true. What I don't want to see is this
merged and then we need something more yet again in a few months for
another platform.

Rob


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-27 Thread Viresh Kumar
On 26-12-17, 14:29, Rob Herring wrote:
> On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:

> > +On some platforms the exact frequency or voltage may be hidden from the OS 
> > by
> > +the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
> > +magic values that represent the frequency or voltage in a firmware 
> > dependent
> > +way, for example an index of an array in the firmware.
> 
> I'm still not convinced this is a good idea.

You were kind-of a few days back :)

lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com

So here is the deal:

- I proposed "domain-performance-state" property for this stuff
  initially.
- But Kevin didn't like that and proposed reusing "opp-hz" and
  "opp-microvolt", which we all agreed to multiple times..
- And we are back to the same discussion now and its painful and time
  killing for all of us.

TBH, I don't have too strong preferences about any of the suggestions
you guys have and I need you guys to tell me what binding changes to
do here and I will do that.

> If you have firmware 
> partially managing things, then I think we should have platform specific 
> bindings or drivers. 

What about the initial idea then, like "performance-state" for the
power domains ? All platforms will anyway replicate that binding only.

> This is complex enough I'm not taking silence from Stephen as an okay.

Sure, but I am not sure how to make him speak :)

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-27 Thread Viresh Kumar
On 26-12-17, 14:29, Rob Herring wrote:
> On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:

> > +On some platforms the exact frequency or voltage may be hidden from the OS 
> > by
> > +the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
> > +magic values that represent the frequency or voltage in a firmware 
> > dependent
> > +way, for example an index of an array in the firmware.
> 
> I'm still not convinced this is a good idea.

You were kind-of a few days back :)

lkml.kernel.org/r/CAL_JsqK-qtAaM_Ou5NtxcWR3F_q=8rmpjum-vqgtkhbtwe5...@mail.gmail.com

So here is the deal:

- I proposed "domain-performance-state" property for this stuff
  initially.
- But Kevin didn't like that and proposed reusing "opp-hz" and
  "opp-microvolt", which we all agreed to multiple times..
- And we are back to the same discussion now and its painful and time
  killing for all of us.

TBH, I don't have too strong preferences about any of the suggestions
you guys have and I need you guys to tell me what binding changes to
do here and I will do that.

> If you have firmware 
> partially managing things, then I think we should have platform specific 
> bindings or drivers. 

What about the initial idea then, like "performance-state" for the
power domains ? All platforms will anyway replicate that binding only.

> This is complex enough I'm not taking silence from Stephen as an okay.

Sure, but I am not sure how to make him speak :)

-- 
viresh


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-26 Thread Rob Herring
On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
> On some platforms the exact frequency or voltage may be hidden from the
> OS by the firmware. Allow such configurations to pass magic values in
> the "opp-hz" or the "opp-microvolt" properties, which should be
> interpreted in a platform dependent way.
> 
> Reviewed-by: Ulf Hansson 
> Signed-off-by: Viresh Kumar 
> ---
>  Documentation/devicetree/bindings/opp/opp.txt | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/opp/opp.txt 
> b/Documentation/devicetree/bindings/opp/opp.txt
> index 4e4f30288c8b..00a3bdbd0f1f 100644
> --- a/Documentation/devicetree/bindings/opp/opp.txt
> +++ b/Documentation/devicetree/bindings/opp/opp.txt
> @@ -167,6 +167,12 @@ properties.
>functioning of the current device at the current OPP (where this property 
> is
>present).
>  
> +
> +On some platforms the exact frequency or voltage may be hidden from the OS by
> +the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
> +magic values that represent the frequency or voltage in a firmware dependent
> +way, for example an index of an array in the firmware.

I'm still not convinced this is a good idea. If you have firmware 
partially managing things, then I think we should have platform specific 
bindings or drivers. 

This is complex enough I'm not taking silence from Stephen as an okay.

Rob


Re: [PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-26 Thread Rob Herring
On Mon, Dec 18, 2017 at 03:51:30PM +0530, Viresh Kumar wrote:
> On some platforms the exact frequency or voltage may be hidden from the
> OS by the firmware. Allow such configurations to pass magic values in
> the "opp-hz" or the "opp-microvolt" properties, which should be
> interpreted in a platform dependent way.
> 
> Reviewed-by: Ulf Hansson 
> Signed-off-by: Viresh Kumar 
> ---
>  Documentation/devicetree/bindings/opp/opp.txt | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/opp/opp.txt 
> b/Documentation/devicetree/bindings/opp/opp.txt
> index 4e4f30288c8b..00a3bdbd0f1f 100644
> --- a/Documentation/devicetree/bindings/opp/opp.txt
> +++ b/Documentation/devicetree/bindings/opp/opp.txt
> @@ -167,6 +167,12 @@ properties.
>functioning of the current device at the current OPP (where this property 
> is
>present).
>  
> +
> +On some platforms the exact frequency or voltage may be hidden from the OS by
> +the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
> +magic values that represent the frequency or voltage in a firmware dependent
> +way, for example an index of an array in the firmware.

I'm still not convinced this is a good idea. If you have firmware 
partially managing things, then I think we should have platform specific 
bindings or drivers. 

This is complex enough I'm not taking silence from Stephen as an okay.

Rob


[PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-18 Thread Viresh Kumar
On some platforms the exact frequency or voltage may be hidden from the
OS by the firmware. Allow such configurations to pass magic values in
the "opp-hz" or the "opp-microvolt" properties, which should be
interpreted in a platform dependent way.

Reviewed-by: Ulf Hansson 
Signed-off-by: Viresh Kumar 
---
 Documentation/devicetree/bindings/opp/opp.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/opp/opp.txt 
b/Documentation/devicetree/bindings/opp/opp.txt
index 4e4f30288c8b..00a3bdbd0f1f 100644
--- a/Documentation/devicetree/bindings/opp/opp.txt
+++ b/Documentation/devicetree/bindings/opp/opp.txt
@@ -167,6 +167,12 @@ properties.
   functioning of the current device at the current OPP (where this property is
   present).
 
+
+On some platforms the exact frequency or voltage may be hidden from the OS by
+the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
+magic values that represent the frequency or voltage in a firmware dependent
+way, for example an index of an array in the firmware.
+
 Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
 
 / {
-- 
2.15.0.194.g9af6a3dea062



[PATCH V8 3/3] OPP: Allow "opp-hz" and "opp-microvolt" to contain magic values

2017-12-18 Thread Viresh Kumar
On some platforms the exact frequency or voltage may be hidden from the
OS by the firmware. Allow such configurations to pass magic values in
the "opp-hz" or the "opp-microvolt" properties, which should be
interpreted in a platform dependent way.

Reviewed-by: Ulf Hansson 
Signed-off-by: Viresh Kumar 
---
 Documentation/devicetree/bindings/opp/opp.txt | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/opp/opp.txt 
b/Documentation/devicetree/bindings/opp/opp.txt
index 4e4f30288c8b..00a3bdbd0f1f 100644
--- a/Documentation/devicetree/bindings/opp/opp.txt
+++ b/Documentation/devicetree/bindings/opp/opp.txt
@@ -167,6 +167,12 @@ properties.
   functioning of the current device at the current OPP (where this property is
   present).
 
+
+On some platforms the exact frequency or voltage may be hidden from the OS by
+the firmware and the "opp-hz" or the "opp-microvolt" properties may contain
+magic values that represent the frequency or voltage in a firmware dependent
+way, for example an index of an array in the firmware.
+
 Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.
 
 / {
-- 
2.15.0.194.g9af6a3dea062