[rtc-linux] Re: [PATCH v3 7/8] rtc: ds3232-core: fix issue when irq is shared several devices
From: Akinobu Mita <akinobu.mita@gmail.com>
Date: 2016-03-03 14:10:36
2016-03-01 0:13 GMT+09:00 Akinobu Mita [off-list ref]:
quoted hunk ↗ jump to hunk
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 <redacted> Cc: Alexandre Belloni <redacted> Cc: Dennis Aberilla <redacted> --- * 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. -- -- 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.