Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] gpiolib: GPIO line irq_set_affinity helper
@ 2026-10-23 15:11 Liang Hao
  2026-10-23 15:11 ` [PATCH 1/2] gpiolib: Add irq_set_affinity helper for GPIO line IRQs Liang Hao
  2026-10-23 15:11 ` [PATCH 2/2] gpio: dwapb: Use gpiolib irq_set_affinity helper Liang Hao
  0 siblings, 2 replies; 7+ messages in thread
From: Liang Hao @ 2026-10-23 15:11 UTC (permalink / raw)
  To: linux-gpio; +Cc: Liang Hao

Hi,

Several GPIO irqchips omit irq_chip->irq_set_affinity on line IRQs, so
user writes to /proc/irq/<gpio-line>/smp_affinity* fail. The helper
covers hierarchical domains with parent_data and chained gpio_irq_chips
that use parent_handler and parent virqs without parent_data on the line.

This series adds a shared helper so drivers can expose affinity on GPIO
line IRQs: the mask is applied on the parent interrupt, and the line
IRQ reflects the result for proc and validation. Product init or resume
scripts that restore per-line affinity depend on a line-level callback;
without it those writes never reach the parent.

Patch 1 adds gpiochip_irq_set_affinity() and GPIOCHIP_IRQ_AFFINITY_HELPERS:
hierarchical lines use irq_chip_set_affinity_parent(); chained lines
resolve the parent virq from gpio_irq_chip and call the parent
irq_chip->irq_set_affinity() directly. Unknown parent: -EINVAL.

Patch 2 enables the macro on gpio-dwapb (snps,dw-apb-gpio, DT chained).

Tested on arm64: sysfs GPIO export + edge, write child gpiolib virq
smp_affinity_list/smp_affinity — fails without the series, succeeds
and reads back with it.

Thanks,
Liang Hao

Liang Hao (2):
  gpiolib: Add irq_set_affinity helper for GPIO line IRQs
  gpio: dwapb: Use gpiolib irq_set_affinity helper

 drivers/gpio/gpio-dwapb.c   |  1 +
 drivers/gpio/gpiolib.c      | 79 +++++++++++++++++++++++++++++++++++++
 include/linux/gpio/driver.h |  5 +++
 3 files changed, 85 insertions(+)

-- 
2.54.0 (Apple Git-157)


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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-23 15:11 [PATCH 0/2] gpiolib: GPIO line irq_set_affinity helper Liang Hao
2026-10-23 15:11 ` [PATCH 1/2] gpiolib: Add irq_set_affinity helper for GPIO line IRQs Liang Hao
2026-10-23 15:35   ` sashiko-bot
2026-10-24  1:52   ` kernel test robot
2026-10-24  2:58   ` kernel test robot
2026-10-23 15:11 ` [PATCH 2/2] gpio: dwapb: Use gpiolib irq_set_affinity helper Liang Hao
2026-10-23 15:30   ` sashiko-bot

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