[PATCH v2 0/2] gpio: sim: lock simulated GPIOs as interrupts

Bartosz Golaszewski posted 2 patches 1 year, 5 months ago
drivers/gpio/gpio-sim.c | 25 ++++++++++++++++-
include/linux/irq_sim.h | 17 ++++++++++++
kernel/irq/irq_sim.c    | 60 ++++++++++++++++++++++++++++++++++++++---
3 files changed, 98 insertions(+), 4 deletions(-)
[PATCH v2 0/2] gpio: sim: lock simulated GPIOs as interrupts
Posted by Bartosz Golaszewski 1 year, 5 months ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

I realized that the gpio-sim module doesn't lock the GPIOs as interrupts
when they are requested from the irq_sim. This leads to users being able
to change the direction of GPIOs that should remain as inputs to output.
This series extends the irq_sim interface and allows users to supply
callbacks that will be executed to inform users about interrupts being
requested and released so that they can act accordingly. The gpio-sim is
made to use this new API and lock GPIOs as interrupts when needed.

Thomas: if this is fine with you, can you Ack it so that I can take it
through the GPIO tree for the next merge window?

Changes since v1:
- drop the notifier in favor of specific callbacks

Bartosz Golaszewski (2):
  genirq/irq_sim: add an extended irq_sim initializer
  gpio: sim: lock GPIOs as interrupts when they are requested

 drivers/gpio/gpio-sim.c | 25 ++++++++++++++++-
 include/linux/irq_sim.h | 17 ++++++++++++
 kernel/irq/irq_sim.c    | 60 ++++++++++++++++++++++++++++++++++++++---
 3 files changed, 98 insertions(+), 4 deletions(-)

-- 
2.43.0
Re: [PATCH v2 0/2] gpio: sim: lock simulated GPIOs as interrupts
Posted by Bartosz Golaszewski 1 year, 5 months ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Mon, 24 Jun 2024 11:39:31 +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> I realized that the gpio-sim module doesn't lock the GPIOs as interrupts
> when they are requested from the irq_sim. This leads to users being able
> to change the direction of GPIOs that should remain as inputs to output.
> This series extends the irq_sim interface and allows users to supply
> callbacks that will be executed to inform users about interrupts being
> requested and released so that they can act accordingly. The gpio-sim is
> made to use this new API and lock GPIOs as interrupts when needed.
> 
> [...]

Applied, thanks!

[1/2] genirq/irq_sim: add an extended irq_sim initializer
      commit: 011f583781fa46699f1d4c4e9c39ad68f05ced2d
[2/2] gpio: sim: lock GPIOs as interrupts when they are requested
      commit: 9d9c1796a6ae70290c2e013fe4d79e99039a1015

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Re: [PATCH v2 0/2] gpio: sim: lock simulated GPIOs as interrupts
Posted by Linus Walleij 1 year, 5 months ago
On Mon, Jun 24, 2024 at 11:39 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> I realized that the gpio-sim module doesn't lock the GPIOs as interrupts
> when they are requested from the irq_sim. This leads to users being able
> to change the direction of GPIOs that should remain as inputs to output.
> This series extends the irq_sim interface and allows users to supply
> callbacks that will be executed to inform users about interrupts being
> requested and released so that they can act accordingly. The gpio-sim is
> made to use this new API and lock GPIOs as interrupts when needed.
>
> Thomas: if this is fine with you, can you Ack it so that I can take it
> through the GPIO tree for the next merge window?
>
> Changes since v1:
> - drop the notifier in favor of specific callbacks

Acked-by: Linus Walleij <linus.walleij@linaro.org>

It sure seems consistent to me and in line with how I once
thought about locking lines for IRQ.

Yours,
Linus Walleij
Re: [PATCH v2 0/2] gpio: sim: lock simulated GPIOs as interrupts
Posted by Bartosz Golaszewski 1 year, 5 months ago
On Mon, Jun 24, 2024 at 11:39 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> I realized that the gpio-sim module doesn't lock the GPIOs as interrupts
> when they are requested from the irq_sim. This leads to users being able
> to change the direction of GPIOs that should remain as inputs to output.
> This series extends the irq_sim interface and allows users to supply
> callbacks that will be executed to inform users about interrupts being
> requested and released so that they can act accordingly. The gpio-sim is
> made to use this new API and lock GPIOs as interrupts when needed.
>
> Thomas: if this is fine with you, can you Ack it so that I can take it
> through the GPIO tree for the next merge window?
>
> Changes since v1:
> - drop the notifier in favor of specific callbacks
>
> Bartosz Golaszewski (2):
>   genirq/irq_sim: add an extended irq_sim initializer
>   gpio: sim: lock GPIOs as interrupts when they are requested
>
>  drivers/gpio/gpio-sim.c | 25 ++++++++++++++++-
>  include/linux/irq_sim.h | 17 ++++++++++++
>  kernel/irq/irq_sim.c    | 60 ++++++++++++++++++++++++++++++++++++++---
>  3 files changed, 98 insertions(+), 4 deletions(-)
>
> --
> 2.43.0
>

Without any objections, I'd like to take it through the GPIO tree by
the end of this week.

Bart