linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Linus Walleij <linus.walleij@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH 2/2] gpio: mockup: use irq_sim_fire_edge()
Date: Tue, 11 Dec 2018 16:38:54 +0100	[thread overview]
Message-ID: <CAMRc=MepmF4phnh_cSE5sFDMYcYEtyh0KGeBot_tu1jnq1276A@mail.gmail.com> (raw)
In-Reply-To: <20181211141509.6x74jlzipj6o2exh@pengutronix.de>

wt., 11 gru 2018 o 15:15 Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> napisał(a):
>
> Hello Bartosz,
>
> On Mon, Dec 03, 2018 at 12:09:16PM +0100, Uwe Kleine-König wrote:
> > On Tue, Nov 20, 2018 at 02:40:32PM +0100, Bartosz Golaszewski wrote:
> > > @@ -213,7 +213,8 @@ static ssize_t gpio_mockup_event_write(struct file *file,
> > >     chip = priv->chip;
> > >
> > >     gpiod_set_value_cansleep(desc, val);
> > > -   irq_sim_fire(&chip->irqsim, priv->offset);
> > > +   edge = val == 0 ? IRQ_TYPE_EDGE_FALLING : IRQ_TYPE_EDGE_RISING;
> > > +   irq_sim_fire_edge(&chip->irqsim, priv->offset, edge);
> >
> > If I write 0 twice into the debugfs file, does it fire two irqs or only
> > one? I think it fires two but only one would be the right behaviour?!
>
> If you still think that patch 1 of this series is the way to go, I think
> this objection is still valid. Then you need to check the state of the
> line by at least calling (something like) .get_value to determine if the
> previous value was different.
>

Hi Uwe,

I've already started working on a series improving the entire concept.
I've taken some of your suggestions into account.

Since we're already at rc-6 I'd like to get those upstream despite
there being some disagreements to keep the userspace intact.

For now it will generate two falling edge interrupts when you write 0 twice.

Bart

      reply	other threads:[~2018-12-11 15:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 13:40 [PATCH 0/2] irq/irq_sim: provide a specialized variant of irq_sim_fire() Bartosz Golaszewski
2018-11-20 13:40 ` [PATCH 1/2] irq/irq_sim: provide irq_sim_fire_edge() Bartosz Golaszewski
2018-11-20 17:17   ` Uwe Kleine-König
2018-11-21 16:34     ` Bartosz Golaszewski
2018-11-21 19:15       ` Uwe Kleine-König
2018-11-23 15:59         ` Bartosz Golaszewski
2018-11-25 21:18           ` Uwe Kleine-König
2018-11-29 18:14             ` Bartosz Golaszewski
2018-11-30 22:26               ` Linus Walleij
2018-12-02 12:29                 ` Marc Zyngier
2018-12-02 17:00                   ` Bartosz Golaszewski
2018-12-02 21:56               ` Uwe Kleine-König
2018-12-02 22:20                 ` Bartosz Golaszewski
2018-12-03 10:23                   ` Bartosz Golaszewski
2018-12-03 10:49                     ` Uwe Kleine-König
2018-12-03 10:57                       ` Bartosz Golaszewski
2018-12-03 11:06                         ` Uwe Kleine-König
2018-12-05 12:19                           ` Linus Walleij
2018-12-05 12:38                             ` Bartosz Golaszewski
2018-12-05 12:55                               ` Linus Walleij
2018-12-17 10:32                               ` Bartosz Golaszewski
2018-12-17 12:59                                 ` Uwe Kleine-König
2018-12-17 13:59                                   ` Bartosz Golaszewski
2018-12-05 13:20                             ` Uwe Kleine-König
2018-12-14 14:07                               ` Linus Walleij
2018-12-17 11:19                                 ` Uwe Kleine-König
2018-11-20 13:40 ` [PATCH 2/2] gpio: mockup: use irq_sim_fire_edge() Bartosz Golaszewski
2018-12-03 11:09   ` Uwe Kleine-König
2018-12-11 14:15     ` Uwe Kleine-König
2018-12-11 15:38       ` Bartosz Golaszewski [this message]

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='CAMRc=MepmF4phnh_cSE5sFDMYcYEtyh0KGeBot_tu1jnq1276A@mail.gmail.com' \
    --to=brgl@bgdev.pl \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=u.kleine-koenig@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).