Skip to content

irq/irq_sim: improve the API

Bartosz Golaszewski linux-gpio linux-iio lkml 5 versions – Applied

Status from this message: The following commit has been merged into the irq/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest2 patches 0 repliesApplied
  2. v42 patches 5 repliesSuperseded
  3. v32 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v26 patches9 repliesSuperseded
v12 patches4 repliesSuperseded

Changes in v5 from the cover letter

- add the review tags from Linus
- use the irq_set_irqchip_state interface and drop irq_sim_fire() entirely as suggested by Marc

Patches in v5 Applied

#Subject and filesSizeRepliesApplied
1/2irq: make irq_domain_reset_irq_data() available even for non-V2 usersinclude/linux/irqdomain.h kernel/irq/irqdomain.c+13 -130 replies
2/2irq/irq_sim: simplify the APIdrivers/gpio/gpio-mockup.c drivers/iio/dummy/iio_dummy_evgen.c include/linux/irq_sim.h +2 more+237 -1510 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchLinus WalleijJonathan Cameron
1/2R-b
2/2R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/2] irq/irq_sim: improve the API

From: Bartosz Golaszewski <[email protected]>

The interrupt simulator API exposes a lot of custom data structures and functions and doesn't reuse the interfaces already exposed by the irq subsystem. This series tries to address it.

First, we make irq_domain_reset_irq_data() available to non-V2 domain API users - that'll be used in the subsequent patch. Next we overhaul the public interfaces - we hide all specific data structures and instead rely on the irq_domain struct and virtual interrupt numberspace.

The end effect is that we limit the interrupt simulator API to two functions (plus one device managed variant) and zero new structures.

v1: https://lkml.org/lkml/2019/8/12/558

v1 -> v2:
- instead of just making the new data structures opaque for users, remove them entirely in favor of irq_domain
- call irq_set_handler() & irq_domain_reset_irq_data() when unmapping the simulated interrupt
- fix a memory leak in error path
- make it possible to use irq_find_matching_fwnode() with the simulator domain
- correctly use irq_create_mapping() and irq_find_mapping(): only use the former at init-time and the latter at interrupt-time

v2 -> v3:
- drop the controverial changes to irq_domain code and only leave the changes to irq_sim and its users with the plan to revisit the former at a later time

v3 -> v4:
- add the Ack from Jonathan
- remove redundant parts of patch 1/2

v4 -> v5:
- add the review tags from Linus
- use the irq_set_irqchip_state interface and drop irq_sim_fire() entirely as suggested by Marc

Bartosz Golaszewski (2):
irq: make irq_domain_reset_irq_data() available even for non-V2 users irq/irq_sim: simplify the API

 drivers/gpio/gpio-mockup.c          |  53 ++++--
 drivers/iio/dummy/iio_dummy_evgen.c |  34 ++--
 include/linux/irq_sim.h             |  33 +---
 include/linux/irqdomain.h           |   2 +-
 kernel/irq/Kconfig                  |   1 +
 kernel/irq/irq_sim.c                | 267 +++++++++++++++++-----------
 kernel/irq/irqdomain.c              |  24 +--
 7 files changed, 250 insertions(+), 164 deletions(-)
Signature · 1 line
2.25.0