public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] pwm: stm32: Always program polarity
@ 2026-01-08 12:45 Sean Nyekjaer
  2026-01-08 16:01 ` Uwe Kleine-König
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sean Nyekjaer @ 2026-01-08 12:45 UTC (permalink / raw)
  To: Fabrice Gasnier, Uwe Kleine-König, Maxime Coquelin,
	Alexandre Torgue
  Cc: Uwe Kleine-König, linux-pwm, linux-stm32, linux-arm-kernel,
	linux-kernel, stable, Sean Nyekjaer

Commit 7346e7a058a2 ("pwm: stm32: Always do lazy disabling") triggered a
regression where PWM polarity changes could be ignored.

stm32_pwm_set_polarity() was skipped due to a mismatch between the
cached pwm->state.polarity and the actual hardware state, leaving the
hardware polarity unchanged.

Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
Cc: stable@vger.kernel.org # <= 6.12
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
Co-developed-by: Uwe Kleine-König <ukleinek@kernel.org>
---
This patch is only applicable for stable tree's <= 6.12
---
Changes in v2:
- Taken patch improvements for Uwe
- Link to v1: https://lore.kernel.org/r/20260106-stm32-pwm-v1-1-33e9e8a9fc33@geanix.com
---
 drivers/pwm/pwm-stm32.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
index eb24054f9729734da21eb96f2e37af03339e3440..86e6eb7396f67990249509dd347cb5a60c9ccf16 100644
--- a/drivers/pwm/pwm-stm32.c
+++ b/drivers/pwm/pwm-stm32.c
@@ -458,8 +458,7 @@ static int stm32_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
 		return 0;
 	}
 
-	if (state->polarity != pwm->state.polarity)
-		stm32_pwm_set_polarity(priv, pwm->hwpwm, state->polarity);
+	stm32_pwm_set_polarity(priv, pwm->hwpwm, state->polarity);
 
 	ret = stm32_pwm_config(priv, pwm->hwpwm,
 			       state->duty_cycle, state->period);

---
base-commit: eb18504ca5cf1e6a76a752b73daf0ef51de3551b
change-id: 20260105-stm32-pwm-91cb843680f4

Best regards,
-- 
Sean Nyekjaer <sean@geanix.com>



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

end of thread, other threads:[~2026-01-09 10:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 12:45 [PATCH v2] pwm: stm32: Always program polarity Sean Nyekjaer
2026-01-08 16:01 ` Uwe Kleine-König
2026-01-09 10:24 ` Patch "pwm: stm32: Always program polarity" has been added to the 5.10-stable tree gregkh
2026-01-09 10:24 ` Patch "pwm: stm32: Always program polarity" has been added to the 5.15-stable tree gregkh
2026-01-09 10:24 ` Patch "pwm: stm32: Always program polarity" has been added to the 6.1-stable tree gregkh
2026-01-09 10:24 ` Patch "pwm: stm32: Always program polarity" has been added to the 6.6-stable tree gregkh
2026-01-09 10:24 ` Patch "pwm: stm32: Always program polarity" has been added to the 6.12-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox