public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mian Yousaf Kaukab <ykaukab@suse.de>
To: Bruno Thomsen <bruno.thomsen@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	linux-rtc@vger.kernel.org,
	open list <linux-kernel@vger.kernel.org>,
	biwen.li@nxp.com
Subject: Re: [PATCH v6] rtc: pcf2127: handle timestamp interrupts
Date: Mon, 5 Jul 2021 14:13:55 +0200	[thread overview]
Message-ID: <20210705121355.GA82146@suse.de> (raw)
In-Reply-To: <CAH+2xPAYD--=RWHTw8yuUGb7xKWUd+hGo7QHCsKzz8BNzNwUbA@mail.gmail.com>

On Wed, Jun 30, 2021 at 08:26:04PM +0200, Bruno Thomsen wrote:
> Den tir. 29. jun. 2021 kl. 17.06 skrev Mian Yousaf Kaukab <ykaukab@suse.de>:
> >
> > commit 03623b4b041c ("rtc: pcf2127: add tamper detection support")
> > added support for timestamp interrupts. However they are not being
> > handled in the irq handler. If a timestamp interrupt occurs it
> > results in kernel disabling the interrupt and displaying the call
> > trace:
> >
> > [  121.145580] irq 78: nobody cared (try booting with the "irqpoll" option)
> > ...
> > [  121.238087] [<00000000c4d69393>] irq_default_primary_handler threaded [<000000000a90d25b>] pcf2127_rtc_irq [rtc_pcf2127]
> > [  121.248971] Disabling IRQ #78
> >
> > Handle timestamp interrupts in pcf2127_rtc_irq(). Save time stamp
> > before clearing TSF1 and TSF2 flags so that it can't be overwritten.
> > Set a flag to mark if the timestamp is valid and only report to sysfs
> > if the flag is set. To mimic the hardware behavior, don’t save
> > another timestamp until the first one has been read by the userspace.
> >
> > However, if the alarm irq is not configured, keep the old way of
> > handling timestamp interrupt in the timestamp0 sysfs calls.
> >
> > Signed-off-by: Mian Yousaf Kaukab <ykaukab@suse.de>
> > ---
> > Sorry, once again compile tested only due to lack of hardware
> > availability. Hopefully, I will be able to do some real tests tomorrow.
> 
> Hi Yousaf,
> 
> I have tested patch version 6 on an imx7 board with the pcf2127
> chip using SPI interface and no alarm IRQ in the device tree.
> The same board that produced an oops earlier, and now it's working
> as expected. Both tamper events that occur when the device is
> powered on and when an event happens with the device powered off.
> 
> Reviewed-by: Bruno Thomsen <bruno.thomsen@gmail.com>
> Tested-by: Bruno Thomsen <bruno.thomsen@gmail.com>
Thank you for reviewing and testing the patch!
I have tested it with alarm irq configured and it works fine.

Alexandre, is it still possible to queue for v5.14?
> 
> /Bruno
> 
BR,
Yousaf

  reply	other threads:[~2021-07-05 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 15:06 [PATCH v6] rtc: pcf2127: handle timestamp interrupts Mian Yousaf Kaukab
2021-06-30 18:26 ` Bruno Thomsen
2021-07-05 12:13   ` Mian Yousaf Kaukab [this message]
2021-07-10  0:59 ` Alexandre Belloni

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=20210705121355.GA82146@suse.de \
    --to=ykaukab@suse.de \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=biwen.li@nxp.com \
    --cc=bruno.thomsen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox