All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/2] backlight: pwm_bl: Configure pwm only once per backlight toggle
@ 2023-03-22  5:13 Aisheng Dong
  2023-03-22  7:03 ` Regression in deaeeda2051f ("backlight: pwm_bl: Don't rely on a disabled PWM emiting inactive state") Uwe Kleine-König
  0 siblings, 1 reply; 10+ messages in thread
From: Aisheng Dong @ 2023-03-22  5:13 UTC (permalink / raw)
  To: u.kleine-koenig
  Cc: daniel.thompson, linux-pm, Jingoo Han, deller, lee, linux-fbdev,
	dri-devel, thierry.reding, kernel

[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]

On Fri, Jan 20, 2023 at 01:00:18PM +0100, Uwe Kleine-König wrote:
> Most but not all PWMs drive the PWM pin to its inactive state when
> disabled. However if there is no enable_gpio and no regulator the PWM
> must drive the inactive state to actually disable the backlight.
>
> So keep the PWM on in this case.
>
> Note that to determine if there is a regulator some effort is required
> because it might happen that there isn't actually one but the regulator
> core gave us a dummy. (A nice side effect is that this makes the
> regulator actually optional even on fully constrained systems.)
>
> This fixes backlight disabling e.g. on i.MX6 when an inverted PWM is
> used.
>
> Hint for the future: If this change results in a regression, the bug is
> in the lowlevel PWM driver.
> Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de<mailto:u.kleine-koenig@pengutronix.de>

This patch broke imx7ulp suspend resume and got the following error:
Freezing remaining freezable tasks
Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
printk: Suspending console(s) (use no_console_suspend to debug)
asix 1-1:1.0 eth0: Link is Down
imx7ulp-tpm-pwm 40250000.pwm: PM: dpm_run_callback(): platform_pm_suspend+0x0/0x48 returns -16
imx7ulp-tpm-pwm 40250000.pwm: PM: failed to suspend: error -16
...

It seems this patch changed the behavior of pwm_backlight_suspend a little bit in
pwm_backlight_power_off() that pwm state keep unchanged during suspend.
Then pwm_imx_tpm_suspend() will return -Ebusy due to tpm->enable_count > 0.
Was this intended behavior? Should we fix pwm core or the driver?

Regards
Aisheng

[-- Attachment #2: Type: text/html, Size: 5796 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-26  8:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22  5:13 [PATCH v2 1/2] backlight: pwm_bl: Configure pwm only once per backlight toggle Aisheng Dong
2023-03-22  7:03 ` Regression in deaeeda2051f ("backlight: pwm_bl: Don't rely on a disabled PWM emiting inactive state") Uwe Kleine-König
2023-03-22  8:10   ` Aisheng Dong
2023-03-22  8:51     ` [PATCH] backlight: pwm_bl: Disable PWM on shutdown and suspend " Uwe Kleine-König
2023-03-22  9:14       ` Aisheng Dong
2023-03-22  9:14         ` Aisheng Dong
2023-09-26  7:17       ` Uwe Kleine-König
2023-09-26  7:17         ` Uwe Kleine-König
2023-09-26  8:30         ` Lee Jones
2023-09-26  8:31           ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.