All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Subject: Re: [PATCH] gpiolib: fix line event timestamps for nested irqs
Date: Fri, 11 Jan 2019 14:45:08 +0100	[thread overview]
Message-ID: <CAMRc=Md_8MBbc7RSwyPNMGYnJyQqvSgoyHYhEgQf5C4ac_K9eA@mail.gmail.com> (raw)
In-Reply-To: <CACRpkdacXeBEh2UMmigSo+zYQCj3yMyNRfxHjqhu_kiZ2JMXbg@mail.gmail.com>

pt., 11 sty 2019 o 13:19 Linus Walleij <linus.walleij@linaro.org> napisał(a):
>
> On Fri, Jan 4, 2019 at 11:32 AM Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> >
> > Nested interrupts run inside the calling thread's context and the top
> > half handler is never called which means that we never read the
> > timestamp.
> >
> > This issue came up when trying to read line events from a gpiochip
> > using regmap_irq_chip for interrupts.
> >
> > Fix it by reading the timestamp from the irq thread function if it's
> > still 0 by the time the second handler is called.
> >
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
>
> Oh that's right. Should this not have Fixes: and Cc: stable?
>
> > +       /*
> > +        * We may be running from a nested threaded interrupt in which case
> > +        * we didn't get the timestamp from lineevent_irq_handler().
> > +        */
> > +       if (!le->timestamp)
> > +               le->timestamp = ktime_get_real_ns();
> > +
> >         ge.timestamp = le->timestamp;
>
> I would merge these:
>
> if (!le->timestamp)
>     ge.timestamp = ktime_get_real_ns();
> else
>     ge.timestamp = le->timestamp;
>
> Yours,
> Linus Walleij

I'll fix both issues and resend.

Bart

      reply	other threads:[~2019-01-11 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-04 10:32 [PATCH] gpiolib: fix line event timestamps for nested irqs Bartosz Golaszewski
2019-01-11 12:19 ` Linus Walleij
2019-01-11 13:45   ` 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=Md_8MBbc7RSwyPNMGYnJyQqvSgoyHYhEgQf5C4ac_K9eA@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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.