]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: lpc32xx: Don't modify HW state in .probe() after the PWM chip was registered
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 7 Jul 2021 16:27:49 +0000 (18:27 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 2 Sep 2021 19:38:35 +0000 (21:38 +0200)
commit1505908034a360e4c7e5ce601ddce90fe7a3bedb
tree544c623e58ce87cb16eed27a489195309909dd79
parent5e5fcd17396576a773331ea18c48ac49298416bf
pwm: lpc32xx: Don't modify HW state in .probe() after the PWM chip was registered

This fixes a race condition: After pwmchip_add() is called there might
already be a consumer and then modifying the hardware behind the
consumer's back is bad. So set the default before.

(Side-note: I don't know what this register setting actually does, if
this modifies the polarity there is an inconsistency because the
inversed polarity isn't considered if the PWM is already running during
.probe().)

Fixes: 427915645951 ("pwm: lpc32xx: Set PWM_PIN_LEVEL bit to default value")
Cc: Sylvain Lemieux <slemieux@tycoint.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpc32xx.c