Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Clark Williams <clrkwllms@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Gregory CLEMENT <gregory.clement@bootlin.com>,
	Rosen Penev <rosenp@gmail.com>, Rob Herring <robh@kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>,
	Ralph Sennhauser <ralph.sennhauser@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
	linux-gpio@vger.kernel.org, linux-rt-devel@lists.linux.dev
Subject: [PATCH v2 0/5] gpio: mvebu: resume, PREEMPT_RT and PWM fixes
Date: Fri,  4 Dec 2026 19:11:06 -0800	[thread overview]
Message-ID: <20261205031111.12306-1-rosenp@gmail.com> (raw)

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


             reply	other threads:[~2026-12-05  3:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  3:11 Rosen Penev [this message]
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  3:11 ` [PATCH v2 2/5] gpio: mvebu: restore suspend-time irq masks under gc->lock Rosen Penev
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  3:11 ` [PATCH v2 4/5] gpio: mvebu: don't request the PWM GPIO under a spinlock Rosen Penev
2026-12-05  3:11 ` [PATCH v2 5/5] gpio: mvebu: report the PWM line's own enable bit Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261205031111.12306-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=bigeasy@linutronix.de \
    --cc=brgl@kernel.org \
    --cc=clrkwllms@kernel.org \
    --cc=gregory.clement@bootlin.com \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=ralph.sennhauser@gmail.com \
    --cc=robh@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox