backlight: ktd253: Stabilize backlight
authorLinus Walleij <linus.walleij@linaro.org>
Thu, 15 Jul 2021 11:36:36 +0000 (13:36 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 21 Jul 2021 16:27:27 +0000 (17:27 +0100)
commitdaa37361518bf2d1f591bbdaa7c68b2a43d7af48
tree5dd17614e616ccb40851b49841f0755530093c0a
parente73f0f0ee7541171d89f2e2491130c7771ba58d3
backlight: ktd253: Stabilize backlight

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>
drivers/video/backlight/ktd253-backlight.c