Re: [PATCH] hibernation:stop resume screen during hibernation

From: Greg KH
Date: Tue Jun 22 2021 - 09:19:52 EST


On Tue, Jun 22, 2021 at 08:45:47PM +0800, pingshuo wrote:
> The display will be woken up during hibernation.
> if the computer equipment is poor, it will cause the screen to flicker.
> Skip to reusme the display devices in "thaw".
>
> Signed-off-by: pingshuo <pingshuo@xxxxxxxxxxxxx>
> ---
> drivers/base/power/main.c | 43 +++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index f893c3c5af07..f3e92ac7b4b3 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -35,11 +35,14 @@
> #include <linux/cpuidle.h>
> #include <linux/devfreq.h>
> #include <linux/timer.h>
> +#include <linux/pci.h>

That right there is a clue that perhaps this is not the place to be
making this change.

Please do this in the driver for the specific device, you do not want to
do this in the driver core for every individual device type.

Also be more careful, your change here:

> @@ -737,6 +778,8 @@ static void dpm_noirq_resume_devices(pm_message_t state)
> trace_suspend_resume(TPS("dpm_resume_noirq"), state.event, false);
> }
>
> +
> +
> /**
> * dpm_resume_noirq - Execute "noirq resume" callbacks for all devices.
> * @state: PM transition of the system being carried out.

Was not needed at all.

thanks,

greg k-h