2014-10-08 21:47:13

by Jeffrey Hugo

[permalink] [raw]
Subject: Re: [RFC 3/7] mfd: devicetree: bindings: Add Qualcomm SMD based RPM DT binding

On 9/30/2014 6:08 PM, Bjorn Andersson wrote:
> On Tue 30 Sep 16:16 PDT 2014, Jeffrey Hugo wrote:
>
>> On 9/30/2014 8:37 AM, Bjorn Andersson wrote:
>>> On Tue 30 Sep 06:46 PDT 2014, Kumar Gala wrote:
>>>
>>>>
>>>> On Sep 29, 2014, at 7:34 PM, Bjorn Andersson <[email protected]> wrote:
>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/mfd/qcom-rpm-smd.txt b/Documentation/devicetree/bindings/mfd/qcom-rpm-smd.txt
>>>>> new file mode 100644
>>>>> index 0000000..a846101
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/mfd/qcom-rpm-smd.txt
>>>>> @@ -0,0 +1,122 @@
>>>>> +Qualcomm Resource Power Manager (RPM) over SMD
>>>>> +
>>>>> +This driver is used to interface with the Resource Power Manager (RPM) found in
>>>>> +various Qualcomm platforms. The RPM allows each component in the system to vote
>>>>> +for state of the system resources, such as clocks, regulators and bus
>>>>> +frequencies.
>>>>> +
>>>>> +- compatible:
>>>>> + Usage: required
>>>>> + Value type: <string>
>>>>> + Definition: must be one of:
>>>>> + "qcom,rpm-msm8974?
>>>>
>>>> Why not ?qcom,rpm-smd?. I?d like to get Jeff H?s input on how
>>>> what we do here for compat and distinguish the A-family RPM support vs
>>>> B-family/RPM-SMD support.
>>>>
>>>
>>> I don't see anything indicating changes in the actual communication, but as
>>> this also encodes what resources are exposed we have to keep this specific.
>>>
>>> I'm not sure what you mean with distinguish the A and B family, they are
>>> completely different and there are no overlap in compatibles or implementation.
>>>
>>> The overlap is in how children are communicating with the rpm, but this is an
>>> implementation detail - and noted in that patch as a future improvement.
>>>
>>>
>>> I forgot to add Jeff, but did send him a separate email asking for his input on
>>> all this.
>>>
>>
>> Yep. I saw the series. Still doing a deep dive.
>>
>> The rpm-smd driver (and the A family equivalent) is outside of my area
>> of expertise, but I have some familiarity with it as it is a SMD client.
>> Internally we have a singular compat for all of B family, but I
>> haven't been able to figure out how that works to expose all of the
>> resources. I'll talk to my contact later in the week to see what the
>> differences are.
>>
>
> That's right, because you have these tables in devicetree in the caf version.
> You have to have this information somewhere!

True, it must exist somewhere. However since its information tied
directly to the hardware, it seems like its information that would fit
right in DT.

I talked to my contact, and it seems like the table attributes vary more
than I thought, target to target, so the single table design seems less
plausible. Its my understanding you've had an offline discussion with
him and some of our regulator guys to discuss the specifics of our
needs. I'll let them take over as the experts.

>
>> Is the per target compat the way to do this though? The way its
>> currently done means we'll have atleast a dozen tables in
>> qcom-smd-rpm.c, and I can't imagine they will have anything more than
>> minor differences from the msm8x74_resource_table that currently exists
>> in patch 6 of the series. Why wouldn't one table that is a superset of
>> all supported targets work?
>>
>
> It would work as long as e.g. QCOM_RPM_PM8941_MVS1 always is vsa number 4.
>
> But sure, it's a much better fit than the family a and this rpm would reject
> invalid resources, so it might work. But this works without us knowing about
> all possible platforms.
>
>
> But if the case is that multiple platforms expose the same table we can always
> tie the same table to multiple compatibles.
>
> Regards,
> Bjorn
>


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


2014-10-24 15:59:29

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [RFC 3/7] mfd: devicetree: bindings: Add Qualcomm SMD based RPM DT binding

On Wed 08 Oct 14:47 PDT 2014, Jeffrey Hugo wrote:

> On 9/30/2014 6:08 PM, Bjorn Andersson wrote:
> > On Tue 30 Sep 16:16 PDT 2014, Jeffrey Hugo wrote:
> >
> >> On 9/30/2014 8:37 AM, Bjorn Andersson wrote:
[..]
> >
> > That's right, because you have these tables in devicetree in the caf version.
> > You have to have this information somewhere!
>
> True, it must exist somewhere. However since its information tied
> directly to the hardware, it seems like its information that would fit
> right in DT.
>

For family B it would be reasonable to move this to device tree, replacing my
"reg" property with a "resource" property taking type and id for the resource
(e.g resource = <0x616f646c 17>; for ldo 17).

For family A this does not work thought, but maybe we should just skip the idea
of having a common look in favour of not having the tables.

> I talked to my contact, and it seems like the table attributes vary more
> than I thought, target to target, so the single table design seems less
> plausible. Its my understanding you've had an offline discussion with
> him and some of our regulator guys to discuss the specifics of our
> needs. I'll let them take over as the experts.
>

Yes, I met with Stephen, David and Mahesh to discuss the matter. The issues
that we discussed was:

1) It must be possible to set the active and sleep state of a resource
independently.

2) Deferring less important writes (e.g. writes to sleep state) to reduce
communication

3) With deferred writes, we need to flush the data when going to sleep and that
requires some special handling - so that we don't wake up again or crash the
rpm.

4) The scalability of the table


I'm working on figuring out how to do 1) in a sane way, as this is needed.

2) gives 3) which gives a bunch of implementation awkwardness and I'm still not
convinced that it is a problem beyond someones KPI, so I will have to do some
measurements. If nothing else it's "just" an optimization that we should be
able to add incrementally later.

I guess 4) is a matter of taste, with the table the client reference a
resource, with all the data in DT it also describes part of how the rpm works.

Regards,
Bjorn