Re: [PATCH] devfreq: Suspend all devices on system shutdown

From: Chanwoo Choi
Date: Wed Mar 06 2019 - 20:27:14 EST


Hi Pavel,

On 19. 3. 7. ìì 8:10, Pavel Machek wrote:
> On Fri 2019-01-25 14:54:03, Marek Szyprowski wrote:
>> This way devfreq core ensures that all its devices will be set to safe
>> operation points before reboot operation. There are board on which some
>> aggressive power saving operation points are behind the capabilities of
>> the bootloader to properly reset the hardware and boot the board. This
>> way one can avoid board crash early after reboot.
>>
>> Similar pattern is used in CPUfreq subsystem.
>
> This looks somehow dangerous to me. I guess this will break someone's
> shutdown, and on battery-powered devices, that's quite bad thing to
> do.

This patch executes the devfreq_suspend() for all devfreq devices.
The devfreq_suspend() does the following:
1. (mandatory) stop the polling of governor.
2. (optional) If devfreq device specifies the 'opp-suspend'
property in DT, the devfreq changes the frequency by using
the devfreq->suspend_freq.

If the user of devfreq device doesn't want to change the frequency
during the system shutdown, just don't add the 'opp-suspend' property
in DT. And the devfreq_suspend() will just stop the polling for governor.

Even if on battery-powered devices, I think it is not problem
to stop the polling of governor during the system shutdown.

In my case, I don't know what is dangerous.
Could you explain it more detailed.

>
> Could we explicitely do it only for devices that need it?
> Pavel
>
>


--
Best Regards,
Chanwoo Choi
Samsung Electronics