From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: rtc-linux@googlegroups.com,
Alessandro Zummo <a.zummo@towertech.it>,
Dennis Aberilla <denzzzhome@yahoo.com>
Subject: [rtc-linux] Re: [PATCH v3 7/8] rtc: ds3232-core: fix issue when irq is shared several devices
Date: Thu, 3 Mar 2016 23:57:56 +0100 [thread overview]
Message-ID: <20160303225756.GA2587@piout.net> (raw)
In-Reply-To: <CAC5umygNbz=nnPU6oTDsmrwWRKLFJE3Hq2ei1mPQ425CvfVE9Q@mail.gmail.com>
On 03/03/2016 at 23:10:35 +0900, Akinobu Mita wrote :
> 2016-03-01 0:13 GMT+09:00 Akinobu Mita <akinobu.mita@gmail.com>:
> > ds3232-core requests irq with IRQF_SHARED, so irq can be shared by
> > several devices. But the irq handler for ds3232 unconditionally
> > disables the irq at first and the irq is re-enabled only when the
> > interrupt source was the ds3232's alarm. This behaviour breaks the
> > devices sharing the same irq in the various scenarios.
> >
> > Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> > Cc: Alessandro Zummo <a.zummo@towertech.it>
> > Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> > Cc: Dennis Aberilla <denzzzhome@yahoo.com>
> > ---
> > * New patch from this version
> >
> > drivers/rtc/rtc-ds3232-core.c | 14 ++------------
> > 1 file changed, 2 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/rtc/rtc-ds3232-core.c b/drivers/rtc/rtc-ds3232-core.c
> > index be8dfe0..6489380 100644
> > --- a/drivers/rtc/rtc-ds3232-core.c
> > +++ b/drivers/rtc/rtc-ds3232-core.c
> > @@ -59,7 +59,6 @@ struct ds3232 {
> > */
> > struct mutex mutex;
> > bool suspended;
> > - int exiting;
> > };
> >
> > static int ds3232_check_rtc_status(struct device *dev)
> > @@ -314,8 +313,6 @@ static irqreturn_t ds3232_irq(int irq, void *dev_id)
> > struct device *dev = dev_id;
> > struct ds3232 *ds3232 = dev_get_drvdata(dev);
> >
> > - disable_irq_nosync(irq);
> > -
> > /*
> > * If rtc as a wakeup source, can't schedule the work
> > * at system resume flow, because at this time the i2c bus
>
> I found that this patch is not correct because interrupt is re-enabled
> after this hardirq handler finished without clearing Alarm Flag or
> Alarm Interrupt Enable in RTC register.
>
> Maybe we should drop IRQF_SHARED flag.
I think the best is to completely reworke the irq handling. It dates
from many many year ago and can be replace by a simple threaded irq.
This will solve your issue.
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
next prev parent reply other threads:[~2016-03-03 22:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-29 15:13 [rtc-linux] [PATCH v3 1/8] rtc: ds3232: rename rtc-ds3232.c to rtc-ds3232-core.c for preparation Akinobu Mita
2016-02-29 15:13 ` [rtc-linux] [PATCH v3 2/8] rtc: ds3232: split into core module and i2c driver Akinobu Mita
2016-02-29 15:13 ` [rtc-linux] [PATCH v3 3/8] rtc: ds3234: use rtc-ds3232 core and support alarm Akinobu Mita
2016-02-29 15:13 ` [rtc-linux] [PATCH v3 4/8] rtc: ds3232-core: fix read on /dev/rtc after RTC_AIE_ON Akinobu Mita
2016-02-29 15:13 ` [rtc-linux] [PATCH v3 5/8] rtc: ds3232-core: add register access error checks Akinobu Mita
2016-02-29 15:13 ` [rtc-linux] [PATCH v3 6/8] rtc: ds3232-core: remove unused UIE code Akinobu Mita
2016-02-29 15:13 ` [rtc-linux] [PATCH v3 7/8] rtc: ds3232-core: fix issue when irq is shared several devices Akinobu Mita
2016-03-03 14:10 ` [rtc-linux] " Akinobu Mita
2016-03-03 22:57 ` Alexandre Belloni [this message]
2016-03-04 13:56 ` Akinobu Mita
2016-03-04 14:16 ` Alexandre Belloni
2016-02-29 15:13 ` [rtc-linux] [PATCH v3 8/8] rtc: use rtc->ops_lock to protect alarm operations Akinobu Mita
2016-03-03 23:08 ` [rtc-linux] Re: [PATCH v3 1/8] rtc: ds3232: rename rtc-ds3232.c to rtc-ds3232-core.c for preparation Alexandre Belloni
2016-03-04 13:54 ` Akinobu Mita
2016-03-04 14:26 ` 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=20160303225756.GA2587@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=a.zummo@towertech.it \
--cc=akinobu.mita@gmail.com \
--cc=denzzzhome@yahoo.com \
--cc=rtc-linux@googlegroups.com \
/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.