Re: [PATCH] regulator: core: if voltage scaling fails, restore original

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 12 Dec 2012, Paolo Pisati wrote:

> but inside regulator_set_voltage(), we save the new regulator voltage before
> actually ramping up:
> 
> core.c::regulator_set_voltage():
> 	...
>     regulator->min_uV = min_uV;
>     regulator->max_uV = max_uV;
> 
>     ret = regulator_check_consumers(rdev, &min_uV, &max_uV);
>     if (ret < 0)
>         goto out2;
> 
>     ret = _regulator_do_set_voltage(rdev, min_uV, max_uV);  <-- ERROR!!!
>     if (ret < 0)
>         goto out2;
> 	...

I'm not too familiar with this code.  But isn't this where the bug is, 
rather than in that optimization commit you mentioned?  Seems to me, 
naïvely, that in the above code, regulator->min_uV and regulator->max_uV 
should be set only after _regulator_do_set_voltage() succeeds?


- Paul

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux