mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: a.zummo@towertech.it
Subject: [PATCH 17/17] RTC interrupt handling cleanups
Date: Sun, 21 Oct 2007 03:52:56 -0400 (EDT)	[thread overview]
Message-ID: <20071021075256.0975B19041E@havoc.gtf.org> (raw)
In-Reply-To: <lkjvxcz09835mnsdfv0983q4m1234m@havoc.gtf.org>

commit f94d41db30d6430bc6d3e53602258d3933f93103
Author: Jeff Garzik <jeff@garzik.org>
Date:   Sun Oct 21 01:51:50 2007 -0400

    RTC interrupt handling cleanups
    
    arm/mach-integrator/time: arm_rtc_interrupt() never uses its arguments,
    so pass NULL to make this explicit and potentially reduce future
    confusion.
    
    hpet.c and rtc.c: pass rtc_int_flag through the standard data-passing
    mechanism, dev_id (2nd arg).
    
    rtc-at32ap700x, rtc-m48t59.c: delete pointless cast from void*
    
    rtc-bfin: calling spin_lock_irq() in interrupt handler marked
    IRQF_DISABLED is unwise.  Use safer spin_lock_irqsave() instead.
    
    Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

 arch/arm/mach-integrator/time.c |    2 +-
 arch/x86/kernel/hpet.c          |    4 ++--
 drivers/char/rtc.c              |    7 ++++---
 drivers/rtc/rtc-at32ap700x.c    |    2 +-
 drivers/rtc/rtc-bfin.c          |    5 +++--
 drivers/rtc/rtc-m48t59.c        |    2 +-
 6 files changed, 12 insertions(+), 10 deletions(-)

f94d41db30d6430bc6d3e53602258d3933f93103
diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c
index 5278f58..5235f64 100644
--- a/arch/arm/mach-integrator/time.c
+++ b/arch/arm/mach-integrator/time.c
@@ -125,7 +125,7 @@ static int rtc_probe(struct amba_device *dev, void *id)
 	xtime.tv_sec = __raw_readl(rtc_base + RTC_DR);
 
 	ret = request_irq(dev->irq[0], arm_rtc_interrupt, IRQF_DISABLED,
-			  "rtc-pl030", dev);
+			  "rtc-pl030", NULL);
 	if (ret)
 		goto map_out;
 
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 53303f2..7c07653 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -621,7 +621,7 @@ static void hpet_rtc_timer_reinit(void)
 	}
 }
 
-irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
+irqreturn_t hpet_rtc_interrupt(int dummy, void *dev_id)
 {
 	struct rtc_time curr_time;
 	unsigned long rtc_int_flag = 0;
@@ -651,7 +651,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
 
 	if (rtc_int_flag) {
 		rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
-		rtc_interrupt(rtc_int_flag, dev_id);
+		rtc_interrupt(-1, (void *) rtc_int_flag);
 	}
 	return IRQ_HANDLED;
 }
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index ec6b65e..533328b 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -233,7 +233,7 @@ static inline unsigned char rtc_is_updating(void)
  *	(See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
  */
 
-irqreturn_t rtc_interrupt(int irq, void *dev_id)
+irqreturn_t rtc_interrupt(int dummy, void *dev_id)
 {
 	/*
 	 *	Can be an alarm interrupt, update complete interrupt,
@@ -246,12 +246,13 @@ irqreturn_t rtc_interrupt(int irq, void *dev_id)
 	rtc_irq_data += 0x100;
 	rtc_irq_data &= ~0xff;
 	if (is_hpet_enabled()) {
+		unsigned long val = (unsigned long) dev_id;
 		/*
 		 * In this case it is HPET RTC interrupt handler
 		 * calling us, with the interrupt information
-		 * passed as arg1, instead of irq.
+		 * passed as arg2 (dev_id)
 		 */
-		rtc_irq_data |= (unsigned long)irq & 0xF0;
+		rtc_irq_data |= val & 0xF0;
 	} else {
 		rtc_irq_data |= (CMOS_READ(RTC_INTR_FLAGS) & 0xF0);
 	}
diff --git a/drivers/rtc/rtc-at32ap700x.c b/drivers/rtc/rtc-at32ap700x.c
index 2999214..2c1890f 100644
--- a/drivers/rtc/rtc-at32ap700x.c
+++ b/drivers/rtc/rtc-at32ap700x.c
@@ -167,7 +167,7 @@ static int at32_rtc_ioctl(struct device *dev, unsigned int cmd,
 
 static irqreturn_t at32_rtc_interrupt(int irq, void *dev_id)
 {
-	struct rtc_at32ap700x *rtc = (struct rtc_at32ap700x *)dev_id;
+	struct rtc_at32ap700x *rtc = dev_id;
 	unsigned long isr = rtc_readl(rtc, ISR);
 	unsigned long events = 0;
 	int ret = IRQ_NONE;
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c
index 1aa709d..5afd24c 100644
--- a/drivers/rtc/rtc-bfin.c
+++ b/drivers/rtc/rtc-bfin.c
@@ -143,10 +143,11 @@ static irqreturn_t bfin_rtc_interrupt(int irq, void *dev_id)
 	struct bfin_rtc *rtc = platform_get_drvdata(pdev);
 	unsigned long events = 0;
 	u16 rtc_istat;
+	unsigned long flags;
 
 	stampit();
 
-	spin_lock_irq(&rtc->lock);
+	spin_lock_irqsave(&rtc->lock, flags);
 
 	rtc_istat = bfin_read_RTC_ISTAT();
 
@@ -168,7 +169,7 @@ static irqreturn_t bfin_rtc_interrupt(int irq, void *dev_id)
 
 	rtc_update_irq(rtc->rtc_dev, 1, events);
 
-	spin_unlock_irq(&rtc->lock);
+	spin_unlock_irqrestore(&rtc->lock, flags);
 
 	return IRQ_HANDLED;
 }
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index bf60d35..934405d 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -283,7 +283,7 @@ static int m48t59_rtc_proc(struct device *dev, struct seq_file *seq)
  */
 static irqreturn_t m48t59_rtc_interrupt(int irq, void *dev_id)
 {
-	struct device *dev = (struct device *)dev_id;
+	struct device *dev = dev_id;
 	struct platform_device *pdev = to_platform_device(dev);
 	struct m48t59_plat_data *pdata = pdev->dev.platform_data;
 	struct m48t59_private *m48t59 = platform_get_drvdata(pdev);

  parent reply	other threads:[~2007-10-21  7:57 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-21  7:52 [PATCH 0/17] various irq handler cleanups Jeff Garzik
2007-10-21  7:52 ` [PATCH 1/17] " Jeff Garzik
2007-10-21  7:52 ` [PATCH 2/17] drivers/char/ip2: split out irq core logic into separate function Jeff Garzik
2007-10-21  7:52 ` [PATCH 3/17] drivers/char/ip2: separate polling and irq-driven work entry points Jeff Garzik
2007-10-21  7:52 ` [PATCH 4/17] char/pcmcia/synclink_cs: trim trailing whitespace Jeff Garzik
2007-10-21  7:52 ` [PATCH 5/17] drivers/char/pcmcia/synclink_cs.c: irq handler cleanups Jeff Garzik
2007-10-21  7:52 ` [PATCH 6/17] drivers/char/riscom8: " Jeff Garzik
2007-10-21  9:01   ` Jiri Slaby
2007-10-21  9:06     ` Jeff Garzik
2007-10-21  7:52 ` [PATCH 7/17] drivers/char/{rio,specialix,sx}: " Jeff Garzik
2007-10-21  7:52 ` [PATCH 8/17] arch/x86/kernel/vm86_32.c: irq handler cleanup Jeff Garzik
2007-10-21  9:21   ` Thomas Gleixner
2007-10-21  7:52 ` [PATCH 9/17] drivers/char/{synclink,tpm}: irq handler cleanups Jeff Garzik
2007-10-21  7:52 ` [PATCH 10/17] drivers/input/serio/i8042.c: irq handler clean Jeff Garzik
2007-10-21 17:57   ` Dmitry Torokhov
2007-10-30 12:36     ` Jeff Garzik
2007-10-21  7:52 ` [PATCH 11/17] isdn/act2000: fix major bug. clean irq handler Jeff Garzik
2007-10-21  7:52 ` [PATCH 12/17] isdn/sc: irq handler clean Jeff Garzik
2007-10-21  7:52 ` [PATCH 13/17] netdrvr irq handler cleanups Jeff Garzik
2007-10-21  7:52 ` [PATCH 14/17] pcmcia/i82365: " Jeff Garzik
2007-10-21  7:52 ` [PATCH 15/17] serial, rtc/ds1374: " Jeff Garzik
2007-10-21  7:52 ` [PATCH 16/17] SCSI: driver " Jeff Garzik
2007-10-21  7:52 ` Jeff Garzik [this message]
2007-10-21 16:40   ` [PATCH 17/17] RTC interrupt handling cleanups Mike Frysinger

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=20071021075256.0975B19041E@havoc.gtf.org \
    --to=jeff@garzik.org \
    --cc=a.zummo@towertech.it \
    --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 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®