All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] gpio: mvebu: resume, PREEMPT_RT and PWM fixes
@ 2026-12-05  3:11 Rosen Penev
  2026-12-05  3:11 ` [PATCH v2 1/5] gpio: mvebu: use a raw-locked regmap on Armada 7K/8K too Rosen Penev
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Rosen Penev @ 2026-12-05  3:11 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Sebastian Andrzej Siewior,
	Clark Williams, Steven Rostedt, Gregory CLEMENT, Rosen Penev,
	Rob Herring, Thierry Reding, Ralph Sennhauser, Andrew Lunn
  Cc: Bartosz Golaszewski, linux-gpio, linux-rt-devel

Fixes for the irq mask restore on resume and for the PWM code.

Patch 1 extends commit
42269cdb3d3b ("gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask()")
to Armada 7K/8K. There the
driver used the parent's syscon regmap, which has an ordinary spinlock,
so the mask/unmask callbacks still slept under the raw gc->lock on
PREEMPT_RT. The driver now maps the parent's range and uses its own
raw-locked regmap.

Patch 2 closes a race in resume. The mask registers were rebuilt from a
snapshot of the irqchip mask cache taken under gc->lock, but written
after the lock was dropped. A mask or unmask in between was lost.

Patch 3 stops the restore from masking a line that was masked at
suspend time but unmasked again before the GPIO driver resumed, for
example by enable_irq() in another driver's resume_noirq callback.

Patch 4 stops requesting the PWM's GPIO line under a spinlock, which
can sleep. Patch 5 makes the PWM state report only its own line's
enable bit.

The series is based on gpio/for-current, which has commit d8e27d042747
("gpio: mvebu: fix Armada XP per-CPU mask register save/restore").

Each patch builds with W=1 for arm (mvebu_v7_defconfig + PWM +
PREEMPT_RT + PROVE_LOCKING). None of them has been tested on hardware
yet.

Changes in v2:
- Move the Armada 7K/8K regmap patch first, so the resume patch no
  longer takes the syscon regmap's lock under gc->lock at any point in
  the series (review).
- New patch 3: keep lines unmasked during early resume unmasked
  (review).
- New patches 4 and 5: PWM fixes.
- v1: https://lore.kernel.org/linux-gpio/20261203225820.83277-1-rosenp@gmail.com/

Rosen Penev (5):
  gpio: mvebu: use a raw-locked regmap on Armada 7K/8K too
  gpio: mvebu: restore suspend-time irq masks under gc->lock
  gpio: mvebu: don't re-mask irqs unmasked during early resume
  gpio: mvebu: don't request the PWM GPIO under a spinlock
  gpio: mvebu: report the PWM line's own enable bit

 drivers/gpio/gpio-mvebu.c | 178 +++++++++++++++++++++++---------------
 1 file changed, 107 insertions(+), 71 deletions(-)


base-commit: f4379936003e4a233ed8d7b8ab299630bae85fec
-- 
2.56.1


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

end of thread, other threads:[~2026-12-05 21:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  3:11 [PATCH v2 0/5] gpio: mvebu: resume, PREEMPT_RT and PWM fixes Rosen Penev
2026-12-05  3:11 ` [PATCH v2 1/5] gpio: mvebu: use a raw-locked regmap on Armada 7K/8K too Rosen Penev
2026-12-05 21:14   ` Linus Walleij
2026-12-05  3:11 ` [PATCH v2 2/5] gpio: mvebu: restore suspend-time irq masks under gc->lock Rosen Penev
2026-12-05 21:14   ` Linus Walleij
2026-12-05  3:11 ` [PATCH v2 3/5] gpio: mvebu: don't re-mask irqs unmasked during early resume Rosen Penev
2026-12-05  3:25   ` sashiko-bot
2026-12-05 21:15   ` Linus Walleij
2026-12-05  3:11 ` [PATCH v2 4/5] gpio: mvebu: don't request the PWM GPIO under a spinlock Rosen Penev
2026-12-05 21:15   ` Linus Walleij
2026-12-05  3:11 ` [PATCH v2 5/5] gpio: mvebu: report the PWM line's own enable bit Rosen Penev
2026-12-05 21:16   ` Linus Walleij

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.