backlight: ktd253: Stabilize backlight
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Jul 2021 11:36:36 +0000 (13:36 +0200)
committerDom Cobley <popcornmix@gmail.com>
Thu, 14 Oct 2021 11:32:58 +0000 (12:32 +0100)
commit2b07778fed3781fcd184d13465dcc27eed8ed444
tree79ea643939cc64c96226d4c534f0f19983b3e387
parent29b472a914c27034475b9dffd54d8a5917bb769b
backlight: ktd253: Stabilize backlight

[ Upstream commit daa37361518bf2d1f591bbdaa7c68b2a43d7af48 ]

Remove interrupt disablement during backlight setting. It is
way to dangerous and makes platforms instable by having it
miss vblank IRQs leading to the graphics derailing.

The code is using ndelay() which is not available on
platforms such as ARM and will result in 32 * udelay(1)
which is substantial.

Add some code to detect if an interrupt occurs during the
tight loop and in that case just redo it from the top.

Fixes: 5317f37e48b9 ("backlight: Add Kinetic KTD253 backlight driver")
Cc: Stephan Gerhold <stephan@gerhold.net>
Reported-by: newbyte@disroot.org
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/backlight/ktd253-backlight.c