mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
To: Alessandro Zummo <a.zummo@towertech.it>
Cc: rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org
Subject: [PATCH] rtc-ds1553: Drop IRQF_DISABLED
Date: Tue,  7 Apr 2009 01:50:32 +0900	[thread overview]
Message-ID: <1239036633-10032-2-git-send-email-anemo@mba.ocn.ne.jp> (raw)

IRQF_DISABLED should be be used with IRQF_SHARED.  Drop IRQF_DISABLED
and add spin_lock_irqsave/spin_unlock_irqrestore to the interrupt
handler.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
 drivers/rtc/rtc-ds1553.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-ds1553.c b/drivers/rtc/rtc-ds1553.c
index 38d472b..395f01b 100644
--- a/drivers/rtc/rtc-ds1553.c
+++ b/drivers/rtc/rtc-ds1553.c
@@ -195,14 +195,19 @@ static irqreturn_t ds1553_rtc_interrupt(int irq, void *dev_id)
 	struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 	void __iomem *ioaddr = pdata->ioaddr;
 	unsigned long events = RTC_IRQF;
+	unsigned long flags;
 
+	spin_lock_irqsave(&pdata->rtc->irq_lock, flags);
 	/* read and clear interrupt */
-	if (!(readb(ioaddr + RTC_FLAGS) & RTC_FLAGS_AF))
+	if (!(readb(ioaddr + RTC_FLAGS) & RTC_FLAGS_AF)) {
+		spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags);
 		return IRQ_NONE;
+	}
 	if (readb(ioaddr + RTC_SECONDS_ALARM) & 0x80)
 		events |= RTC_UF;
 	else
 		events |= RTC_AF;
+	spin_unlock_irqrestore(&pdata->rtc->irq_lock, flags);
 	rtc_update_irq(pdata->rtc, 1, events);
 	return IRQ_HANDLED;
 }
@@ -329,7 +334,7 @@ static int __devinit ds1553_rtc_probe(struct platform_device *pdev)
 	if (pdata->irq > 0) {
 		writeb(0, ioaddr + RTC_INTERRUPTS);
 		if (request_irq(pdata->irq, ds1553_rtc_interrupt,
-				IRQF_DISABLED | IRQF_SHARED,
+				IRQF_SHARED,
 				pdev->name, pdev) < 0) {
 			dev_warn(&pdev->dev, "interrupt not available.\n");
 			pdata->irq = 0;
-- 
1.5.6.3


             reply	other threads:[~2009-04-06 16:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 16:50 Atsushi Nemoto [this message]
2009-04-06 19:33 ` Peter Zijlstra
2009-04-07 12:49   ` Atsushi Nemoto

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=1239036633-10032-2-git-send-email-anemo@mba.ocn.ne.jp \
    --to=anemo@mba.ocn.ne.jp \
    --cc=a.zummo@towertech.it \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®