"Gopinath, Thara" <[email protected]> writes:

>>>-----Original Message-----
>>>From: Kevin Hilman [mailto:[email protected]]
>>>Sent: Thursday, September 16, 2010 8:52 PM
>>>To: Gopinath, Thara
>>>Cc: [email protected]; [email protected]; Sripathy, Vishwanath; 
>>>Sawant, Anand; Cousson, Benoit
>>>Subject: Re: [PATCH 04/13] OMAP: Introduce API to return a device list 
>>>associated with a voltage
>>>domain
>>>
>>>"Gopinath, Thara" <[email protected]> writes:
>>>
>>>[...]
>>>
>>>>>>> +struct device **opp_init_voltage_params(struct voltagedomain *voltdm,
>>>>>>> +                                       int *dev_count)
>>>>>>> +{
>>>>>>> +       struct device_opp *dev_opp;
>>>>>>> +       struct device **dev_list;
>>>>>>> +       int count = 0, i = 0;
>>>>>>> +
>>>>>>> +       list_for_each_entry(dev_opp, &dev_opp_list, node) {
>>>>>>> +               if (!dev_opp->oh->vdd_name)
>>>>>>> +                       continue;
>>>>>>> +
>>>>>>> +               if (!strcmp(dev_opp->oh->vdd_name, voltdm->name)) {
>>>>>>> +                       dev_opp->oh->voltdm = voltdm;
>>>>>>
>>>>>>Couldn't we assign the voltdm at opp_add() time since you added it as
>>>>>>part of the hwmod?
>>>>
>>>> We cannot as the voltage layer is not initialized at the point of opp_add.
>>>> Having said this, today voltage layer is dependent on opp layer only to 
>>>> figure out
>>>> the current nominal voltage from the opp table. If that can be some how 
>>>> decoupled we
>>>> can initialize voltage layer early on and implement this.
>>>
>>>We could decouple the voltage init into and early init and late init to
>>>handle this.
>
> Hello Kevin,
>
> Yes we could. In fact I do not like the idea of voltage layer
> dependent on opp layer itself. So here is my proposal. Maintain a
> variable in the main per vdd structure omap_vdd_info curr_volt which
> will get updated each time a voltage scale is attempted.

OK

> Now the only issue is during boot up how does the voltage layer know
> what voltage each vdd should be put into ? A piece of code can be
> implemented in pm34xx.c/pm44xx.c init functions to read the clock rate
> associated with each vdd , call into the opp layer to get the
> corresponding voltage ( basically the sequence we do today everytime
> in voltage layer when the API to get nominal voltage is called) and
> call omap_voltage_scale_vdd with the corresponding voltage. This way
> we can fully decouple voltage laye from opp layer and make voltage
> init an early_initcall. We might still need a late_initcall to
> register debugfs entries though.  What is your take on this ?

Not sure I fully follow this suggestions, but why not just wait until 
both OPP and voltage late init are fully done before allowing any
voltage scaling?

Alternatively, I just did a quick experiment and the device_initcall in
pm.c (that initializes the MPU, IVA/DSP and L3 devices, as well as does
the OPP layer init) could be made a subsys_initcall, so that by the time
SR + voltage are init'd (using device_initcall), OPP layer is fully
initialized.

Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to