* [PATCH 01/15] ARM minor irq handler cleanups
@ 2008-04-18 23:22 Jeff Garzik
2008-04-18 23:22 ` [PATCH 02/15] [SPARC] " Jeff Garzik
` (16 more replies)
0 siblings, 17 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: rmk, linux-arm-kernel, kernel; +Cc: Andrew Morton, LKML
Avoid confusion by /not/ passing an unused pointer to
arm_rtc_interrupt()
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/arm/mach-integrator/time.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
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;
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 02/15] [SPARC] minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-18 23:33 ` David Miller
2008-04-18 23:22 ` [PATCH 03/15] [BLACKFIN] " Jeff Garzik
` (15 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: davem; +Cc: Andrew Morton, LKML
- mark timer_interrupt() static
- sparc_floppy_request_irq() prototype should use irq_handler_t
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/sparc/kernel/time.c | 2 +-
include/asm-sparc/floppy.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index cfaf22c..53caacb 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -105,7 +105,7 @@ __volatile__ unsigned int *master_l10_limit;
#define TICK_SIZE (tick_nsec / 1000)
-irqreturn_t timer_interrupt(int irq, void *dev_id)
+static irqreturn_t timer_interrupt(int dummy, void *dev_id)
{
/* last time the cmos clock got updated */
static long last_rtc_update;
diff --git a/include/asm-sparc/floppy.h b/include/asm-sparc/floppy.h
index dbe7a58..d3978e0 100644
--- a/include/asm-sparc/floppy.h
+++ b/include/asm-sparc/floppy.h
@@ -280,7 +280,7 @@ static inline void sun_fd_enable_dma(void)
/* Our low-level entry point in arch/sparc/kernel/entry.S */
extern int sparc_floppy_request_irq(int irq, unsigned long flags,
- irqreturn_t (*irq_handler)(int irq, void *));
+ irq_handler_t irq_handler);
static int sun_fd_request_irq(void)
{
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 03/15] [BLACKFIN] minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
2008-04-18 23:22 ` [PATCH 02/15] [SPARC] " Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-22 3:27 ` Bryan Wu
2008-04-18 23:22 ` [PATCH 04/15] [PPC] " Jeff Garzik
` (14 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: cooloney; +Cc: Andrew Morton, LKML
- time_sched_init() should use standard irq_handler_t
- sys_timer0_int_handler() should not take 'regs' third argument
- remove pointless cast from void*
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/blackfin/kernel/time.c | 5 ++---
arch/blackfin/oprofile/timer_int.c | 5 ++---
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c
index 9bdc8f9..715b394 100644
--- a/arch/blackfin/kernel/time.c
+++ b/arch/blackfin/kernel/time.c
@@ -39,8 +39,7 @@
/* This is an NTP setting */
#define TICK_SIZE (tick_nsec / 1000)
-static void time_sched_init(irqreturn_t(*timer_routine)
- (int, void *));
+static void time_sched_init(irq_handler_t timer_routine);
static unsigned long gettimeoffset(void);
static struct irqaction bfin_timer_irq = {
@@ -64,7 +63,7 @@ static struct irqaction bfin_timer_irq = {
#define TIME_SCALE 1
static void
-time_sched_init(irqreturn_t(*timer_routine) (int, void *))
+time_sched_init(irq_handler_t timer_routine)
{
u32 tcount;
diff --git a/arch/blackfin/oprofile/timer_int.c b/arch/blackfin/oprofile/timer_int.c
index 6c6f860..e2c825a 100644
--- a/arch/blackfin/oprofile/timer_int.c
+++ b/arch/blackfin/oprofile/timer_int.c
@@ -40,10 +40,9 @@ static void disable_sys_timer0()
{
}
-static irqreturn_t sys_timer0_int_handler(int irq, void *dev_id,
- struct pt_regs *regs)
+static irqreturn_t sys_timer0_int_handler(int irq, void *dev_id)
{
- oprofile_add_sample(regs, 0);
+ oprofile_add_sample(get_irq_regs(), 0);
return IRQ_HANDLED;
}
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 04/15] [PPC] minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
2008-04-18 23:22 ` [PATCH 02/15] [SPARC] " Jeff Garzik
2008-04-18 23:22 ` [PATCH 03/15] [BLACKFIN] " Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-19 14:57 ` Kumar Gala
2008-04-18 23:22 ` [PATCH 05/15] drivers/char: " Jeff Garzik
` (13 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: vitb, linuxppc-dev; +Cc: Andrew Morton, LKML
- whitespace cleanups
- remove pointless prototype (uses always follow func implementation)
- 'irq' argument is often used purely as a local variable. rename
argument to 'dummy' and define 'irq' as local to make this plain.
- remove pointless casts from void*
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/ppc/8xx_io/fec.c | 3 +--
arch/ppc/platforms/sbc82xx.c | 4 +++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/ppc/8xx_io/fec.c b/arch/ppc/8xx_io/fec.c
index 11b0aa6..d7b7ba9 100644
--- a/arch/ppc/8xx_io/fec.c
+++ b/arch/ppc/8xx_io/fec.c
@@ -199,7 +199,6 @@ static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev);
#ifdef CONFIG_USE_MDIO
static void fec_enet_mii(struct net_device *dev);
#endif /* CONFIG_USE_MDIO */
-static irqreturn_t fec_enet_interrupt(int irq, void * dev_id);
#ifdef CONFIG_FEC_PACKETHOOK
static void fec_enet_tx(struct net_device *dev, __u32 regval);
static void fec_enet_rx(struct net_device *dev, __u32 regval);
@@ -472,7 +471,7 @@ fec_timeout(struct net_device *dev)
* This is called from the MPC core interrupt.
*/
static irqreturn_t
-fec_enet_interrupt(int irq, void * dev_id)
+fec_enet_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
volatile fec_t *fecp;
diff --git a/arch/ppc/platforms/sbc82xx.c b/arch/ppc/platforms/sbc82xx.c
index cc0935c..0df6aac 100644
--- a/arch/ppc/platforms/sbc82xx.c
+++ b/arch/ppc/platforms/sbc82xx.c
@@ -121,8 +121,10 @@ struct hw_interrupt_type sbc82xx_i8259_ic = {
.end = sbc82xx_i8259_end_irq,
};
-static irqreturn_t sbc82xx_i8259_demux(int irq, void *dev_id)
+static irqreturn_t sbc82xx_i8259_demux(int dummy, void *dev_id)
{
+ int irq;
+
spin_lock(&sbc82xx_i8259_lock);
sbc82xx_i8259_map[0] = 0x0c; /* OCW3: Read IR register on RD# pulse */
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 05/15] drivers/char: minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (2 preceding siblings ...)
2008-04-18 23:22 ` [PATCH 04/15] [PPC] " Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-19 6:00 ` Rogier Wolff
2008-04-19 16:16 ` Alan Cox
2008-04-18 23:22 ` [PATCH 06/15] [SCSI] " Jeff Garzik
` (12 subsequent siblings)
16 siblings, 2 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: alan, R.E.Wolff; +Cc: Andrew Morton, LKML
- remove always-false tests
- don't overload 'irq' argument, pass data properly via dev_id
- remove pointless casts from void*
- make polled uses of irq handling (where code calls irq handler
directly) more plain, by splitting polled and non-polled irq handling
work. This quite often results in a more-efficient irq handler.
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
drivers/char/cyclades.c | 17 +----------------
drivers/char/mwave/tp3780i.c | 14 ++++++++++----
drivers/char/pcmcia/synclink_cs.c | 10 ++++------
drivers/char/rio/rio_linux.c | 23 +++++++++++++----------
drivers/char/specialix.c | 10 ++++------
drivers/char/stallion.c | 2 +-
drivers/char/sx.c | 22 ++++++++++++++--------
drivers/char/synclink.c | 21 +++++++++------------
drivers/char/synclink_gt.c | 13 ++++---------
drivers/char/synclinkmp.c | 22 +++++++++-------------
drivers/char/tpm/tpm_tis.c | 2 +-
11 files changed, 70 insertions(+), 86 deletions(-)
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c
index e4f579c..823e169 100644
--- a/drivers/char/cyclades.c
+++ b/drivers/char/cyclades.c
@@ -1318,13 +1318,6 @@ static irqreturn_t cyy_interrupt(int irq, void *dev_id)
unsigned int chip, too_many, had_work;
int index;
- if (unlikely(cinfo == NULL)) {
-#ifdef CY_DEBUG_INTERRUPTS
- printk(KERN_DEBUG "cyy_interrupt: spurious interrupt %d\n",irq);
-#endif
- return IRQ_NONE; /* spurious interrupt */
- }
-
card_base_addr = cinfo->base_addr;
index = cinfo->bus_index;
@@ -1730,17 +1723,9 @@ static irqreturn_t cyz_interrupt(int irq, void *dev_id)
{
struct cyclades_card *cinfo = dev_id;
- if (unlikely(cinfo == NULL)) {
-#ifdef CY_DEBUG_INTERRUPTS
- printk(KERN_DEBUG "cyz_interrupt: spurious interrupt %d\n",irq);
-#endif
- return IRQ_NONE; /* spurious interrupt */
- }
-
if (unlikely(!ISZLOADED(*cinfo))) {
#ifdef CY_DEBUG_INTERRUPTS
- printk(KERN_DEBUG "cyz_interrupt: board not yet loaded "
- "(IRQ%d).\n", irq);
+ printk(KERN_DEBUG "cyz_interrupt: board not yet loaded\n");
#endif
return IRQ_NONE;
}
diff --git a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c
index f282976..37fe80d 100644
--- a/drivers/char/mwave/tp3780i.c
+++ b/drivers/char/mwave/tp3780i.c
@@ -97,20 +97,24 @@ static void EnableSRAM(THINKPAD_BD_DATA * pBDData)
static irqreturn_t UartInterrupt(int irq, void *dev_id)
{
+ int irqno = (int)(unsigned long) dev_id;
+
PRINTK_3(TRACE_TP3780I,
- "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irq, dev_id);
+ "tp3780i::UartInterrupt entry irq %x dev_id %p\n", irqno, dev_id);
return IRQ_HANDLED;
}
static irqreturn_t DspInterrupt(int irq, void *dev_id)
{
+ int irqno = (int)(unsigned long) dev_id;
+
pMWAVE_DEVICE_DATA pDrvData = &mwave_s_mdd;
DSP_3780I_CONFIG_SETTINGS *pSettings = &pDrvData->rBDData.rDspSettings;
unsigned short usDspBaseIO = pSettings->usDspBaseIO;
unsigned short usIPCSource = 0, usIsolationMask, usPCNum;
PRINTK_3(TRACE_TP3780I,
- "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irq, dev_id);
+ "tp3780i::DspInterrupt entry irq %x dev_id %p\n", irqno, dev_id);
if (dsp3780I_GetIPCSource(usDspBaseIO, &usIPCSource) == 0) {
PRINTK_2(TRACE_TP3780I,
@@ -361,14 +365,16 @@ int tp3780I_EnableDSP(THINKPAD_BD_DATA * pBDData)
pSettings->bPllBypass = TP_CFG_PllBypass;
pSettings->usChipletEnable = TP_CFG_ChipletEnable;
- if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart", NULL)) {
+ if (request_irq(pSettings->usUartIrq, &UartInterrupt, 0, "mwave_uart",
+ (void *)(unsigned long) pSettings->usUartIrq)) {
PRINTK_ERROR(KERN_ERR_MWAVE "tp3780i::tp3780I_EnableDSP: Error: Could not get UART IRQ %x\n", pSettings->usUartIrq);
goto exit_cleanup;
} else { /* no conflict just release */
free_irq(pSettings->usUartIrq, NULL);
}
- if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i", NULL)) {
+ if (request_irq(pSettings->usDspIrq, &DspInterrupt, 0, "mwave_3780i",
+ (void *)(unsigned long) pSettings->usDspIrq)) {
PRINTK_ERROR("tp3780i::tp3780I_EnableDSP: Error: Could not get 3780i IRQ %x\n", pSettings->usDspIrq);
goto exit_cleanup;
} else {
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 279ff50..4e84d23 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1225,17 +1225,15 @@ static void ri_change(MGSLPC_INFO *info)
* irq interrupt number that caused interrupt
* dev_id device ID supplied during interrupt registration
*/
-static irqreturn_t mgslpc_isr(int irq, void *dev_id)
+static irqreturn_t mgslpc_isr(int dummy, void *dev_id)
{
- MGSLPC_INFO * info = (MGSLPC_INFO *)dev_id;
+ MGSLPC_INFO *info = dev_id;
unsigned short isr;
unsigned char gis, pis;
int count=0;
if (debug_level >= DEBUG_LEVEL_ISR)
- printk("mgslpc_isr(%d) entry.\n", irq);
- if (!info)
- return IRQ_NONE;
+ printk("mgslpc_isr(%d) entry.\n", info->irq_level);
if (!(info->p_dev->_locked))
return IRQ_HANDLED;
@@ -1327,7 +1325,7 @@ static irqreturn_t mgslpc_isr(int irq, void *dev_id)
if (debug_level >= DEBUG_LEVEL_ISR)
printk("%s(%d):mgslpc_isr(%d)exit.\n",
- __FILE__,__LINE__,irq);
+ __FILE__, __LINE__, info->irq_level);
return IRQ_HANDLED;
}
diff --git a/drivers/char/rio/rio_linux.c b/drivers/char/rio/rio_linux.c
index 0ce9667..fb06665 100644
--- a/drivers/char/rio/rio_linux.c
+++ b/drivers/char/rio/rio_linux.c
@@ -362,14 +362,11 @@ static void rio_reset_interrupt(struct Host *HostP)
func_exit();
}
-
-static irqreturn_t rio_interrupt(int irq, void *ptr)
+static irqreturn_t __rio_interrupt(struct Host *HostP, bool polled)
{
- struct Host *HostP;
func_enter();
- HostP = ptr; /* &p->RIOHosts[(long)ptr]; */
- rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n", irq, HostP->Ivec);
+ rio_dprintk(RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d)\n", HostP->Ivec);
/* AAargh! The order in which to do these things is essential and
not trivial.
@@ -389,7 +386,7 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
*/
rio_dprintk(RIO_DEBUG_IFLOW, "rio: We've have noticed the interrupt\n");
- if (HostP->Ivec == irq) {
+ if (!polled) {
/* Tell the card we've noticed the interrupt. */
rio_reset_interrupt(HostP);
}
@@ -398,26 +395,32 @@ static irqreturn_t rio_interrupt(int irq, void *ptr)
return IRQ_HANDLED;
if (test_and_set_bit(RIO_BOARD_INTR_LOCK, &HostP->locks)) {
- printk(KERN_ERR "Recursive interrupt! (host %p/irq%d)\n", ptr, HostP->Ivec);
+ printk(KERN_ERR "Recursive interrupt! (host %p/irq%d)\n",
+ HostP, HostP->Ivec);
return IRQ_HANDLED;
}
RIOServiceHost(p, HostP);
- rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n", ptr, HostP->Type);
+ rio_dprintk(RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n",
+ HostP, HostP->Type);
clear_bit(RIO_BOARD_INTR_LOCK, &HostP->locks);
- rio_dprintk(RIO_DEBUG_IFLOW, "rio: exit rio_interrupt (%d/%d)\n", irq, HostP->Ivec);
+ rio_dprintk(RIO_DEBUG_IFLOW, "rio: exit rio_interrupt (%d)\n", HostP->Ivec);
func_exit();
return IRQ_HANDLED;
}
+static irqreturn_t rio_interrupt(int dummy, void *ptr)
+{
+ return __rio_interrupt(ptr, false);
+}
static void rio_pollfunc(unsigned long data)
{
func_enter();
- rio_interrupt(0, &p->RIOHosts[data]);
+ __rio_interrupt(&p->RIOHosts[data], true);
mod_timer(&p->RIOHosts[data].timer, jiffies + rio_poll);
func_exit();
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 5ff83df..4b5b5b7 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -443,8 +443,7 @@ void missed_irq (unsigned long data)
spin_unlock_irqrestore(&bp->lock, flags);
if (irq) {
printk (KERN_INFO "Missed interrupt... Calling int from timer. \n");
- sx_interrupt (((struct specialix_board *)data)->irq,
- (void*)data);
+ sx_interrupt (-1, bp);
}
mod_timer(&missed_irq_timer, jiffies + sx_poll);
}
@@ -862,23 +861,22 @@ static inline void sx_check_modem(struct specialix_board * bp)
/* The main interrupt processing routine */
-static irqreturn_t sx_interrupt(int irq, void *dev_id)
+static irqreturn_t sx_interrupt(int dummy, void *dev_id)
{
unsigned char status;
unsigned char ack;
- struct specialix_board *bp;
+ struct specialix_board *bp = dev_id;
unsigned long loop = 0;
int saved_reg;
unsigned long flags;
func_enter();
- bp = dev_id;
spin_lock_irqsave(&bp->lock, flags);
dprintk (SX_DEBUG_FLOW, "enter %s port %d room: %ld\n", __FUNCTION__, port_No(sx_get_port(bp, "INT")), SERIAL_XMIT_SIZE - sx_get_port(bp, "ITN")->xmit_cnt - 1);
if (!(bp->flags & SX_BOARD_ACTIVE)) {
- dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", irq);
+ dprintk (SX_DEBUG_IRQ, "sx: False interrupt. irq %d.\n", bp->irq);
spin_unlock_irqrestore(&bp->lock, flags);
func_exit();
return IRQ_NONE;
diff --git a/drivers/char/stallion.c b/drivers/char/stallion.c
index feac54e..874aaa0 100644
--- a/drivers/char/stallion.c
+++ b/drivers/char/stallion.c
@@ -1645,7 +1645,7 @@ static irqreturn_t stl_intr(int irq, void *dev_id)
{
struct stlbrd *brdp = dev_id;
- pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, irq);
+ pr_debug("stl_intr(brdp=%p,irq=%d)\n", brdp, brdp->irq);
return IRQ_RETVAL((* brdp->isr)(brdp));
}
diff --git a/drivers/char/sx.c b/drivers/char/sx.c
index a6e1c9b..ae9e973 100644
--- a/drivers/char/sx.c
+++ b/drivers/char/sx.c
@@ -1241,15 +1241,13 @@ static inline void sx_check_modem_signals(struct sx_port *port)
* Small, elegant, clear.
*/
-static irqreturn_t sx_interrupt(int irq, void *ptr)
+static irqreturn_t __sx_interrupt(struct sx_board *board, bool polled)
{
- struct sx_board *board = ptr;
struct sx_port *port;
int i;
func_enter();
- sx_dprintk(SX_DEBUG_FLOW, "sx: enter sx_interrupt (%d/%d)\n", irq,
- board->irq);
+ sx_dprintk(SX_DEBUG_FLOW, "sx: enter sx_interrupt (%d)\n", board->irq);
/* AAargh! The order in which to do these things is essential and
not trivial.
@@ -1281,6 +1279,10 @@ static irqreturn_t sx_interrupt(int irq, void *ptr)
if (lastjif == jiffies) {
if (++nintr > IRQ_RATE_LIMIT) {
+ /*
+ * FIXME: free_irq() inside irq handler
+ * is unwise
+ */
free_irq(board->irq, board);
printk(KERN_ERR "sx: Too many interrupts. "
"Turning off interrupt %d.\n",
@@ -1293,7 +1295,7 @@ static irqreturn_t sx_interrupt(int irq, void *ptr)
}
#endif
- if (board->irq == irq) {
+ if (!polled) {
/* Tell the card we've noticed the interrupt. */
sx_write_board_word(board, cc_int_pending, 0);
@@ -1339,19 +1341,23 @@ static irqreturn_t sx_interrupt(int irq, void *ptr)
clear_bit(SX_BOARD_INTR_LOCK, &board->locks);
- sx_dprintk(SX_DEBUG_FLOW, "sx: exit sx_interrupt (%d/%d)\n", irq,
- board->irq);
+ sx_dprintk(SX_DEBUG_FLOW, "sx: exit sx_interrupt (%d)\n", board->irq);
func_exit();
return IRQ_HANDLED;
}
+static irqreturn_t sx_interrupt(int dummy, void *data)
+{
+ return __sx_interrupt(data, false);
+}
+
static void sx_pollfunc(unsigned long data)
{
struct sx_board *board = (struct sx_board *)data;
func_enter();
- sx_interrupt(0, board);
+ __sx_interrupt(board, true);
mod_timer(&board->timer, jiffies + sx_poll);
func_exit();
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c
index ddc74d1..a3237d4 100644
--- a/drivers/char/synclink.c
+++ b/drivers/char/synclink.c
@@ -1695,20 +1695,16 @@ static void mgsl_isr_transmit_dma( struct mgsl_struct *info )
*
* Return Value: None
*/
-static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
+static irqreturn_t mgsl_interrupt(int dummy, void *dev_id)
{
- struct mgsl_struct * info;
+ struct mgsl_struct *info = dev_id;
u16 UscVector;
u16 DmaVector;
if ( debug_level >= DEBUG_LEVEL_ISR )
- printk("%s(%d):mgsl_interrupt(%d)entry.\n",
- __FILE__,__LINE__,irq);
+ printk(KERN_DEBUG "%s(%d):mgsl_interrupt(%d)entry.\n",
+ __FILE__, __LINE__, info->irq_level);
- info = (struct mgsl_struct *)dev_id;
- if (!info)
- return IRQ_NONE;
-
spin_lock(&info->irq_spinlock);
for(;;) {
@@ -1732,8 +1728,8 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
mgsl_isr_receive_dma(info);
if ( info->isr_overflow ) {
- printk(KERN_ERR"%s(%d):%s isr overflow irq=%d\n",
- __FILE__,__LINE__,info->device_name, irq);
+ printk(KERN_ERR "%s(%d):%s isr overflow irq=%d\n",
+ __FILE__, __LINE__, info->device_name, info->irq_level);
usc_DisableMasterIrqBit(info);
usc_DisableDmaInterrupts(info,DICR_MASTER);
break;
@@ -1755,8 +1751,9 @@ static irqreturn_t mgsl_interrupt(int irq, void *dev_id)
spin_unlock(&info->irq_spinlock);
if ( debug_level >= DEBUG_LEVEL_ISR )
- printk("%s(%d):mgsl_interrupt(%d)exit.\n",
- __FILE__,__LINE__,irq);
+ printk(KERN_DEBUG "%s(%d):mgsl_interrupt(%d)exit.\n",
+ __FILE__, __LINE__, info->irq_level);
+
return IRQ_HANDLED;
} /* end of mgsl_interrupt() */
diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c
index 1f954ac..3c89266 100644
--- a/drivers/char/synclink_gt.c
+++ b/drivers/char/synclink_gt.c
@@ -491,7 +491,6 @@ static void isr_serial(struct slgt_info *info);
static void isr_rdma(struct slgt_info *info);
static void isr_txeom(struct slgt_info *info, unsigned short status);
static void isr_tdma(struct slgt_info *info);
-static irqreturn_t slgt_interrupt(int irq, void *dev_id);
static int alloc_dma_bufs(struct slgt_info *info);
static void free_dma_bufs(struct slgt_info *info);
@@ -2326,17 +2325,13 @@ static void isr_gpio(struct slgt_info *info, unsigned int changed, unsigned int
* irq interrupt number
* dev_id device ID supplied during interrupt registration
*/
-static irqreturn_t slgt_interrupt(int irq, void *dev_id)
+static irqreturn_t slgt_interrupt(int dummy, void *dev_id)
{
- struct slgt_info *info;
+ struct slgt_info *info = dev_id;
unsigned int gsr;
unsigned int i;
- DBGISR(("slgt_interrupt irq=%d entry\n", irq));
-
- info = dev_id;
- if (!info)
- return IRQ_NONE;
+ DBGISR(("slgt_interrupt irq=%d entry\n", info->irq_level));
spin_lock(&info->lock);
@@ -2385,7 +2380,7 @@ static irqreturn_t slgt_interrupt(int irq, void *dev_id)
spin_unlock(&info->lock);
- DBGISR(("slgt_interrupt irq=%d exit\n", irq));
+ DBGISR(("slgt_interrupt irq=%d exit\n", info->irq_level));
return IRQ_HANDLED;
}
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c
index f3e7807..c96062e 100644
--- a/drivers/char/synclinkmp.c
+++ b/drivers/char/synclinkmp.c
@@ -2586,9 +2586,9 @@ void isr_io_pin( SLMP_INFO *info, u16 status )
* dev_id device ID supplied during interrupt registration
* regs interrupted processor context
*/
-static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
+static irqreturn_t synclinkmp_interrupt(int dummy, void *dev_id)
{
- SLMP_INFO * info;
+ SLMP_INFO *info = dev_id;
unsigned char status, status0, status1=0;
unsigned char dmastatus, dmastatus0, dmastatus1=0;
unsigned char timerstatus0, timerstatus1=0;
@@ -2597,12 +2597,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
unsigned short tmp;
if ( debug_level >= DEBUG_LEVEL_ISR )
- printk("%s(%d): synclinkmp_interrupt(%d)entry.\n",
- __FILE__,__LINE__,irq);
-
- info = (SLMP_INFO *)dev_id;
- if (!info)
- return IRQ_NONE;
+ printk(KERN_DEBUG "%s(%d): synclinkmp_interrupt(%d)entry.\n",
+ __FILE__, __LINE__, info->irq_level);
spin_lock(&info->lock);
@@ -2615,9 +2611,9 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
timerstatus0 = read_reg(info, ISR2);
if ( debug_level >= DEBUG_LEVEL_ISR )
- printk("%s(%d):%s status0=%02x, dmastatus0=%02x, timerstatus0=%02x\n",
- __FILE__,__LINE__,info->device_name,
- status0,dmastatus0,timerstatus0);
+ printk(KERN_DEBUG "%s(%d):%s status0=%02x, dmastatus0=%02x, timerstatus0=%02x\n",
+ __FILE__, __LINE__, info->device_name,
+ status0, dmastatus0, timerstatus0);
if (info->port_count == 4) {
/* get status for SCA1 (ports 2-3) */
@@ -2702,8 +2698,8 @@ static irqreturn_t synclinkmp_interrupt(int irq, void *dev_id)
spin_unlock(&info->lock);
if ( debug_level >= DEBUG_LEVEL_ISR )
- printk("%s(%d):synclinkmp_interrupt(%d)exit.\n",
- __FILE__,__LINE__,irq);
+ printk(KERN_DEBUG "%s(%d):synclinkmp_interrupt(%d)exit.\n",
+ __FILE__, __LINE__, info->irq_level);
return IRQ_HANDLED;
}
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 81503d9..13a4bdd 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -399,7 +399,7 @@ static irqreturn_t tis_int_probe(int irq, void *dev_id)
return IRQ_HANDLED;
}
-static irqreturn_t tis_int_handler(int irq, void *dev_id)
+static irqreturn_t tis_int_handler(int dummy, void *dev_id)
{
struct tpm_chip *chip = dev_id;
u32 interrupt;
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 06/15] [SCSI] minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (3 preceding siblings ...)
2008-04-18 23:22 ` [PATCH 05/15] drivers/char: " Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-18 23:22 ` [PATCH 07/15] [SCSI] aha1542: " Jeff Garzik
` (11 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: linux-scsi; +Cc: Andrew Morton, LKML
- remove pointless casts from void*
- remove needless references to 'irq' function argument, when that
information is already stored somewhere in a driver-private struct.
- where the 'irq' function argument is known never to be used, rename
it to 'dummy' to make this more obvious
- remove always-false tests for dev_id==NULL
- remove always-true tests for 'irq == host_struct->irq'
- replace per-irq lookup functions and tables with a direct reference
to data object obtained via 'dev_id' function argument, passed from
request_irq()
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
---
drivers/scsi/aha152x.c | 7 +------
drivers/scsi/eata.c | 11 ++++-------
drivers/scsi/u14-34f.c | 9 ++++-----
3 files changed, 9 insertions(+), 18 deletions(-)
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 6ccdc96..a09b2d3 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -1432,15 +1432,10 @@ static void run(struct work_struct *work)
*/
static irqreturn_t intr(int irqno, void *dev_id)
{
- struct Scsi_Host *shpnt = (struct Scsi_Host *)dev_id;
+ struct Scsi_Host *shpnt = dev_id;
unsigned long flags;
unsigned char rev, dmacntrl0;
- if (!shpnt) {
- printk(KERN_ERR "aha152x: catched interrupt %d for unknown controller.\n", irqno);
- return IRQ_NONE;
- }
-
/*
* Read a couple of registers that are known to not be all 1's. If
* we read all 1's (-1), that means that either:
diff --git a/drivers/scsi/eata.c b/drivers/scsi/eata.c
index 8be3d76..a73a6bb 100644
--- a/drivers/scsi/eata.c
+++ b/drivers/scsi/eata.c
@@ -2286,17 +2286,14 @@ static void flush_dev(struct scsi_device *dev, unsigned long cursec,
}
}
-static irqreturn_t ihdlr(int irq, struct Scsi_Host *shost)
+static irqreturn_t ihdlr(struct Scsi_Host *shost)
{
struct scsi_cmnd *SCpnt;
unsigned int i, k, c, status, tstatus, reg;
struct mssp *spp;
struct mscp *cpp;
struct hostdata *ha = (struct hostdata *)shost->hostdata;
-
- if (shost->irq != irq)
- panic("%s: ihdlr, irq %d, shost->irq %d.\n", ha->board_name, irq,
- shost->irq);
+ int irq = shost->irq;
/* Check if this board need to be serviced */
if (!(inb(shost->io_port + REG_AUX_STATUS) & IRQ_ASSERTED))
@@ -2535,7 +2532,7 @@ static irqreturn_t ihdlr(int irq, struct Scsi_Host *shost)
return IRQ_NONE;
}
-static irqreturn_t do_interrupt_handler(int irq, void *shap)
+static irqreturn_t do_interrupt_handler(int dummy, void *shap)
{
struct Scsi_Host *shost;
unsigned int j;
@@ -2548,7 +2545,7 @@ static irqreturn_t do_interrupt_handler(int irq, void *shap)
shost = sh[j];
spin_lock_irqsave(shost->host_lock, spin_flags);
- ret = ihdlr(irq, shost);
+ ret = ihdlr(shost);
spin_unlock_irqrestore(shost->host_lock, spin_flags);
return ret;
}
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c
index 58d7eee..640333b 100644
--- a/drivers/scsi/u14-34f.c
+++ b/drivers/scsi/u14-34f.c
@@ -1715,13 +1715,12 @@ static void flush_dev(struct scsi_device *dev, unsigned long cursec, unsigned in
}
-static irqreturn_t ihdlr(int irq, unsigned int j) {
+static irqreturn_t ihdlr(unsigned int j)
+{
struct scsi_cmnd *SCpnt;
unsigned int i, k, c, status, tstatus, reg, ret;
struct mscp *spp, *cpp;
-
- if (sh[j]->irq != irq)
- panic("%s: ihdlr, irq %d, sh[j]->irq %d.\n", BN(j), irq, sh[j]->irq);
+ int irq = sh[j]->irq;
/* Check if this board need to be serviced */
if (!((reg = inb(sh[j]->io_port + REG_SYS_INTR)) & IRQ_ASSERTED)) goto none;
@@ -1935,7 +1934,7 @@ static irqreturn_t do_interrupt_handler(int irq, void *shap) {
if ((j = (unsigned int)((char *)shap - sha)) >= num_boards) return IRQ_NONE;
spin_lock_irqsave(sh[j]->host_lock, spin_flags);
- ret = ihdlr(irq, j);
+ ret = ihdlr(j);
spin_unlock_irqrestore(sh[j]->host_lock, spin_flags);
return ret;
}
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 07/15] [SCSI] aha1542: minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (4 preceding siblings ...)
2008-04-18 23:22 ` [PATCH 06/15] [SCSI] " Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-18 23:22 ` [PATCH 08/15] [ISDN] " Jeff Garzik
` (10 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: linux-scsi; +Cc: Andrew Morton, LKML
- where the 'irq' function argument is known never to be used, rename
it to 'dummy' to make this more obvious
- replace per-irq lookup functions and tables with a direct reference
to data object obtained via 'dev_id' function argument, passed from
request_irq()
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
drivers/scsi/aha1542.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 5a1471c..1375915 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -153,8 +153,6 @@ struct aha1542_hostdata {
#define HOSTDATA(host) ((struct aha1542_hostdata *) &host->hostdata)
-static struct Scsi_Host *aha_host[7]; /* One for each IRQ level (9-15) */
-
static DEFINE_SPINLOCK(aha1542_lock);
@@ -163,8 +161,7 @@ static DEFINE_SPINLOCK(aha1542_lock);
static void setup_mailboxes(int base_io, struct Scsi_Host *shpnt);
static int aha1542_restart(struct Scsi_Host *shost);
-static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id);
-static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id);
+static void aha1542_intr_handle(struct Scsi_Host *shost);
#define aha1542_intr_reset(base) outb(IRST, CONTROL(base))
@@ -404,23 +401,19 @@ fail:
}
/* A quick wrapper for do_aha1542_intr_handle to grab the spin lock */
-static irqreturn_t do_aha1542_intr_handle(int irq, void *dev_id)
+static irqreturn_t do_aha1542_intr_handle(int dummy, void *dev_id)
{
unsigned long flags;
- struct Scsi_Host *shost;
-
- shost = aha_host[irq - 9];
- if (!shost)
- panic("Splunge!");
+ struct Scsi_Host *shost = dev_id;
spin_lock_irqsave(shost->host_lock, flags);
- aha1542_intr_handle(shost, dev_id);
+ aha1542_intr_handle(shost);
spin_unlock_irqrestore(shost->host_lock, flags);
return IRQ_HANDLED;
}
/* A "high" level interrupt handler */
-static void aha1542_intr_handle(struct Scsi_Host *shost, void *dev_id)
+static void aha1542_intr_handle(struct Scsi_Host *shost)
{
void (*my_done) (Scsi_Cmnd *) = NULL;
int errstatus, mbi, mbo, mbistatus;
@@ -1197,7 +1190,8 @@ fail:
DEB(printk("aha1542_detect: enable interrupt channel %d\n", irq_level));
spin_lock_irqsave(&aha1542_lock, flags);
- if (request_irq(irq_level, do_aha1542_intr_handle, 0, "aha1542", NULL)) {
+ if (request_irq(irq_level, do_aha1542_intr_handle, 0,
+ "aha1542", shpnt)) {
printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n");
spin_unlock_irqrestore(&aha1542_lock, flags);
goto unregister;
@@ -1214,7 +1208,7 @@ fail:
enable_dma(dma_chan);
}
}
- aha_host[irq_level - 9] = shpnt;
+
shpnt->this_id = scsi_id;
shpnt->unique_id = base_io;
shpnt->io_port = base_io;
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 08/15] [ISDN] minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (5 preceding siblings ...)
2008-04-18 23:22 ` [PATCH 07/15] [SCSI] aha1542: " Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-18 23:22 ` [PATCH 09/15] [AVR32] remove unused 'irq' argument from local_timer_interrupt() Jeff Garzik
` (9 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: kkeil, isdn4linux, netdev; +Cc: Andrew Morton, LKML
- remove pointless casts from void*
- remove braces around singleton C statements
- remove unused 'intno' argument from rs_interrupt_elsa()
- cs->irq_func() should be defined using standard irq_handler_t
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
drivers/isdn/hisax/elsa.c | 4 ++--
drivers/isdn/hisax/elsa_ser.c | 4 ++--
drivers/isdn/hisax/hisax.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c
index d272d8c..2c3691f 100644
--- a/drivers/isdn/hisax/elsa.c
+++ b/drivers/isdn/hisax/elsa.c
@@ -299,7 +299,7 @@ elsa_interrupt(int intno, void *dev_id)
val = serial_inp(cs, UART_IIR);
if (!(val & UART_IIR_NO_INT)) {
debugl1(cs,"IIR %02x", val);
- rs_interrupt_elsa(intno, cs);
+ rs_interrupt_elsa(cs);
}
}
#endif
@@ -379,7 +379,7 @@ elsa_interrupt_ipac(int intno, void *dev_id)
val = serial_inp(cs, UART_IIR);
if (!(val & UART_IIR_NO_INT)) {
debugl1(cs,"IIR %02x", val);
- rs_interrupt_elsa(intno, cs);
+ rs_interrupt_elsa(cs);
}
}
#endif
diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c
index 1642dca..f181db4 100644
--- a/drivers/isdn/hisax/elsa_ser.c
+++ b/drivers/isdn/hisax/elsa_ser.c
@@ -384,13 +384,13 @@ static inline void transmit_chars(struct IsdnCardState *cs, int *intr_done)
}
-static void rs_interrupt_elsa(int irq, struct IsdnCardState *cs)
+static void rs_interrupt_elsa(struct IsdnCardState *cs)
{
int status, iir, msr;
int pass_counter = 0;
#ifdef SERIAL_DEBUG_INTR
- printk("rs_interrupt_single(%d)...", irq);
+ printk(KERN_DEBUG "rs_interrupt_single(%d)...", cs->irq);
#endif
do {
diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
index 34733c9..e8d429f 100644
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -925,7 +925,7 @@ struct IsdnCardState {
int (*cardmsg) (struct IsdnCardState *, int, void *);
void (*setstack_d) (struct PStack *, struct IsdnCardState *);
void (*DC_Close) (struct IsdnCardState *);
- int (*irq_func) (int, void *);
+ irq_handler_t irq_func;
int (*auxcmd) (struct IsdnCardState *, isdn_ctrl *);
struct Channel channel[2+MAX_WAITING_CALLS];
struct BCState bcs[2+MAX_WAITING_CALLS];
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 09/15] [AVR32] remove unused 'irq' argument from local_timer_interrupt()
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (6 preceding siblings ...)
2008-04-18 23:22 ` [PATCH 08/15] [ISDN] " Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-18 23:22 ` [PATCH 10/15] [IA64] minor irq handler cleanups Jeff Garzik
` (8 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: hskinnemoen; +Cc: Andrew Morton, LKML
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/avr32/kernel/time.c | 4 ++--
arch/avr32/mach-at32ap/time-tc.c | 2 +-
include/asm-avr32/arch-at32ap/time.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
index 36a46c3..d6bb69c 100644
--- a/arch/avr32/kernel/time.c
+++ b/arch/avr32/kernel/time.c
@@ -150,7 +150,7 @@ int __weak avr32_hpt_start(void)
*
* In UP mode, it is invoked from the (global) timer_interrupt.
*/
-void local_timer_interrupt(int irq, void *dev_id)
+void local_timer_interrupt(void *dev_id)
{
if (current->pid)
profile_tick(CPU_PROFILING);
@@ -175,7 +175,7 @@ irqreturn_t __weak timer_interrupt(int irq, void *dev_id)
*
* SMP is not supported yet.
*/
- local_timer_interrupt(irq, dev_id);
+ local_timer_interrupt(dev_id);
return IRQ_HANDLED;
}
diff --git a/arch/avr32/mach-at32ap/time-tc.c b/arch/avr32/mach-at32ap/time-tc.c
index 1026586..53e8e6e 100644
--- a/arch/avr32/mach-at32ap/time-tc.c
+++ b/arch/avr32/mach-at32ap/time-tc.c
@@ -209,7 +209,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
*
* SMP is not supported yet.
*/
- local_timer_interrupt(irq, dev_id);
+ local_timer_interrupt(dev_id);
return IRQ_HANDLED;
}
diff --git a/include/asm-avr32/arch-at32ap/time.h b/include/asm-avr32/arch-at32ap/time.h
index cc8a434..d23b5b0 100644
--- a/include/asm-avr32/arch-at32ap/time.h
+++ b/include/asm-avr32/arch-at32ap/time.h
@@ -13,7 +13,7 @@
extern struct irqaction timer_irqaction;
extern struct platform_device at32_systc0_device;
-extern void local_timer_interrupt(int irq, void *dev_id);
+extern void local_timer_interrupt(void *dev_id);
#define TIMER_BCR 0x000000c0
#define TIMER_BCR_SYNC 0
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 10/15] [IA64] minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (7 preceding siblings ...)
2008-04-18 23:22 ` [PATCH 09/15] [AVR32] remove unused 'irq' argument from local_timer_interrupt() Jeff Garzik
@ 2008-04-18 23:22 ` Jeff Garzik
2008-04-18 23:23 ` [PATCH 11/15] [RTC] " Jeff Garzik
` (7 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:22 UTC (permalink / raw)
To: tony.luck, linux-ia64; +Cc: Andrew Morton, LKML
- remove unused 'irq' argument from pfm_do_interrupt_handler()
- remove pointless cast to void*
- add KERN_xxx prefix to printk()
- remove braces around singleton C statement
- in tioce_provider.c, start tioce_dma_consistent() and
tioce_error_intr_handler() function declarations in column 0
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/ia64/kernel/perfmon.c | 4 ++--
arch/ia64/sn/kernel/huberror.c | 4 ++--
arch/ia64/sn/pci/tioce_provider.c | 6 ++++--
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index d1d24f4..c8e4037 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -5511,7 +5511,7 @@ stop_monitoring:
}
static int
-pfm_do_interrupt_handler(int irq, void *arg, struct pt_regs *regs)
+pfm_do_interrupt_handler(void *arg, struct pt_regs *regs)
{
struct task_struct *task;
pfm_context_t *ctx;
@@ -5591,7 +5591,7 @@ pfm_interrupt_handler(int irq, void *arg)
start_cycles = ia64_get_itc();
- ret = pfm_do_interrupt_handler(irq, arg, regs);
+ ret = pfm_do_interrupt_handler(arg, regs);
total_cycles = ia64_get_itc();
diff --git a/arch/ia64/sn/kernel/huberror.c b/arch/ia64/sn/kernel/huberror.c
index 0101c79..08b0d9b 100644
--- a/arch/ia64/sn/kernel/huberror.c
+++ b/arch/ia64/sn/kernel/huberror.c
@@ -187,8 +187,8 @@ void hub_error_init(struct hubdev_info *hubdev_info)
{
if (request_irq(SGI_II_ERROR, hub_eint_handler, IRQF_SHARED,
- "SN_hub_error", (void *)hubdev_info)) {
- printk("hub_error_init: Failed to request_irq for 0x%p\n",
+ "SN_hub_error", hubdev_info)) {
+ printk(KERN_ERR "hub_error_init: Failed to request_irq for 0x%p\n",
hubdev_info);
return;
}
diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c
index 9b3c113..94e5845 100644
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -655,7 +655,8 @@ tioce_dma(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags)
*
* Simply call tioce_do_dma_map() to create a map with the barrier bit set
* in the address.
- */ static u64
+ */
+static u64
tioce_dma_consistent(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma_flags)
{
return tioce_do_dma_map(pdev, paddr, byte_count, 1, dma_flags);
@@ -668,7 +669,8 @@ tioce_dma_consistent(struct pci_dev *pdev, u64 paddr, size_t byte_count, int dma
*
* Handle a CE error interrupt. Simply a wrapper around a SAL call which
* defers processing to the SGI prom.
- */ static irqreturn_t
+ */
+static irqreturn_t
tioce_error_intr_handler(int irq, void *arg)
{
struct tioce_common *soft = arg;
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 11/15] [RTC] minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (8 preceding siblings ...)
2008-04-18 23:22 ` [PATCH 10/15] [IA64] minor irq handler cleanups Jeff Garzik
@ 2008-04-18 23:23 ` Jeff Garzik
2008-04-18 23:23 ` [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: " Jeff Garzik
` (6 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:23 UTC (permalink / raw)
To: tglx, a.zummo, rtc-linux; +Cc: Andrew Morton, LKML
- pass rtc_int_flag to rtc_interrupt() via the standard method, dev_id
- where irq handler has been analyzed and shown never to use its
'irq' argument, rename it to 'dummy'
- remove pointless casts from void*
- remove uses of 'irq' function arg where it duplicates information
already stored in driver-private struct
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/x86/kernel/hpet.c | 4 ++--
drivers/char/rtc.c | 7 ++++---
drivers/rtc/rtc-at32ap700x.c | 2 +-
drivers/rtc/rtc-ds1374.c | 4 ++--
drivers/rtc/rtc-m48t59.c | 2 +-
5 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 36652ea..eddbf39 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -675,7 +675,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;
@@ -707,7 +707,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
if (rtc_int_flag) {
rtc_int_flag |= (RTC_IRQF | (RTC_NUM_INTS << 8));
if (irq_handler)
- irq_handler(rtc_int_flag, dev_id);
+ irq_handler(-1, (void *) rtc_int_flag);
}
return IRQ_HANDLED;
}
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index 5c3142b..6e3de5b 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -235,7 +235,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,
@@ -248,12 +248,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 & 0xF0UL;
} 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 42244f1..3d3461c 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-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 45bda18..06017e1 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -257,12 +257,12 @@ out:
return ret;
}
-static irqreturn_t ds1374_irq(int irq, void *dev_id)
+static irqreturn_t ds1374_irq(int dummy, void *dev_id)
{
struct i2c_client *client = dev_id;
struct ds1374 *ds1374 = i2c_get_clientdata(client);
- disable_irq_nosync(irq);
+ disable_irq_nosync(client->irq);
schedule_work(&ds1374->work);
return IRQ_HANDLED;
}
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index 013e6c1..5f18c9e 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);
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (9 preceding siblings ...)
2008-04-18 23:23 ` [PATCH 11/15] [RTC] " Jeff Garzik
@ 2008-04-18 23:23 ` Jeff Garzik
2008-04-28 20:53 ` Ralf Baechle
2008-04-18 23:23 ` [PATCH 13/15] [X86] standard vm86 irq handler Jeff Garzik
` (5 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:23 UTC (permalink / raw)
To: ralf; +Cc: Andrew Morton, LKML
- remove always-true test
- neaten request_irq() indentation
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c b/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c
index ab96a2d..11769b5 100644
--- a/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c
+++ b/arch/mips/pmc-sierra/msp71xx/msp_hwbutton.c
@@ -126,9 +126,6 @@ static irqreturn_t hwbutton_handler(int irq, void *data)
struct hwbutton_interrupt *hirq = data;
unsigned long cic_ext = *CIC_EXT_CFG_REG;
- if (irq != hirq->irq)
- return IRQ_NONE;
-
if (CIC_EXT_IS_ACTIVE_HI(cic_ext, hirq->eirq)) {
/* Interrupt: pin is now HI */
CIC_EXT_SET_ACTIVE_LO(cic_ext, hirq->eirq);
@@ -164,7 +161,7 @@ static int msp_hwbutton_register(struct hwbutton_interrupt *hirq)
*CIC_EXT_CFG_REG = cic_ext;
return request_irq(hirq->irq, hwbutton_handler, IRQF_DISABLED,
- hirq->name, (void *)hirq);
+ hirq->name, hirq);
}
static int __init msp_hwbutton_setup(void)
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 13/15] [X86] standard vm86 irq handler
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (10 preceding siblings ...)
2008-04-18 23:23 ` [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: " Jeff Garzik
@ 2008-04-18 23:23 ` Jeff Garzik
2008-04-21 13:52 ` Ingo Molnar
2008-04-18 23:23 ` [PATCH 14/15] Canonicalize several irq handlers Jeff Garzik
` (4 subsequent siblings)
16 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:23 UTC (permalink / raw)
To: tglx, mingo; +Cc: Andrew Morton, LKML
Prefer 'void *dev_id' argument for passing data from request_irq() to
each per-irq handler invocation.
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
arch/x86/kernel/vm86_32.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 38f566f..e610c08 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -735,9 +735,9 @@ static int irqbits;
| (1 << SIGUSR1) | (1 << SIGUSR2) | (1 << SIGIO) | (1 << SIGURG) \
| (1 << SIGUNUSED))
-static irqreturn_t irq_handler(int intno, void *dev_id)
+static irqreturn_t irq_handler(int dummy, void *dev_id)
{
- int irq_bit;
+ int irq_bit, intno = (int)(unsigned long) dev_id;
unsigned long flags;
spin_lock_irqsave(&irqbits_lock, flags);
@@ -818,7 +818,8 @@ static int do_vm86_irq_handling(int subfunction, int irqnumber)
if (!((1 << sig) & ALLOWED_SIGS)) return -EPERM;
if (invalid_vm86_irq(irq)) return -EPERM;
if (vm86_irqs[irq].tsk) return -EPERM;
- ret = request_irq(irq, &irq_handler, 0, VM86_IRQNAME, NULL);
+ ret = request_irq(irq, irq_handler, 0, VM86_IRQNAME,
+ (void *)(unsigned long) irq);
if (ret) return ret;
vm86_irqs[irq].sig = sig;
vm86_irqs[irq].tsk = current;
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 14/15] Canonicalize several irq handlers.
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (11 preceding siblings ...)
2008-04-18 23:23 ` [PATCH 13/15] [X86] standard vm86 irq handler Jeff Garzik
@ 2008-04-18 23:23 ` Jeff Garzik
2008-04-18 23:23 ` [PATCH 15/15] [INPUT, PCMCIA] avoid use of 'irq' function arg Jeff Garzik
` (3 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:23 UTC (permalink / raw)
To: netdev, khali, dtor, lethal, linux-serial; +Cc: Andrew Morton, LKML
* prefer passing data to irq handler using 'void *dev_id' argument
* remove references to 'irq' function arg that either duplicate
a member of our private struct, or are always [true|false].
* add linux/interrupt.h include where needed
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---
drivers/atm/ambassador.c | 7 ++++---
drivers/i2c/chips/tps65010.c | 4 ++--
drivers/input/touchscreen/ucb1400_ts.c | 11 ++++-------
drivers/serial/8250.c | 5 +++--
include/asm-sh/push-switch.h | 2 +-
5 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c
index 7b44a59..da41d26 100644
--- a/drivers/atm/ambassador.c
+++ b/drivers/atm/ambassador.c
@@ -862,8 +862,9 @@ static inline void interrupts_off (amb_dev * dev) {
/********** interrupt handling **********/
-static irqreturn_t interrupt_handler(int irq, void *dev_id) {
- amb_dev * dev = dev_id;
+static irqreturn_t interrupt_handler(int irq, void *dev_id)
+{
+ amb_dev *dev = dev_id;
PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler: %p", dev_id);
@@ -872,7 +873,7 @@ static irqreturn_t interrupt_handler(int irq, void *dev_id) {
// for us or someone else sharing the same interrupt
if (!interrupt) {
- PRINTD (DBG_IRQ, "irq not for me: %d", irq);
+ PRINTD (DBG_IRQ, "no irq events pending");
return IRQ_NONE;
}
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c
index 4154a91..78b365c 100644
--- a/drivers/i2c/chips/tps65010.c
+++ b/drivers/i2c/chips/tps65010.c
@@ -437,11 +437,11 @@ static void tps65010_work(struct work_struct *work)
mutex_unlock(&tps->lock);
}
-static irqreturn_t tps65010_irq(int irq, void *_tps)
+static irqreturn_t tps65010_irq(int dummy, void *_tps)
{
struct tps65010 *tps = _tps;
- disable_irq_nosync(irq);
+ disable_irq_nosync(tps->client->irq);
set_bit(FLAG_IRQ_ENABLE, &tps->flags);
(void) schedule_work(&tps->work.work);
return IRQ_HANDLED;
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 607f993..079cddc 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -358,13 +358,10 @@ static irqreturn_t ucb1400_hard_irq(int irqnr, void *devid)
{
struct ucb1400 *ucb = devid;
- if (irqnr == ucb->irq) {
- disable_irq(ucb->irq);
- ucb->irq_pending = 1;
- wake_up(&ucb->ts_wait);
- return IRQ_HANDLED;
- }
- return IRQ_NONE;
+ disable_irq(ucb->irq);
+ ucb->irq_pending = 1;
+ wake_up(&ucb->ts_wait);
+ return IRQ_HANDLED;
}
static int ucb1400_ts_open(struct input_dev *idev)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 96a585e..109921e 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -40,6 +40,7 @@
#include <linux/serial_8250.h>
#include <linux/nmi.h>
#include <linux/mutex.h>
+#include <linux/interrupt.h>
#include <asm/io.h>
#include <asm/irq.h>
@@ -1457,7 +1458,7 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
struct list_head *l, *end = NULL;
int pass_counter = 0, handled = 0;
- DEBUG_INTR("serial8250_interrupt(%d)...", irq);
+ DEBUG_INTR("serial8250_interrupt...");
spin_lock(&i->lock);
@@ -1496,7 +1497,7 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
if (l == i->head && pass_counter++ > PASS_LIMIT) {
/* If we hit this, we're dead. */
printk(KERN_ERR "serial8250: too much work for "
- "irq%d\n", irq);
+ "irq%d\n", up->port.irq);
break;
}
} while (l != end);
diff --git a/include/asm-sh/push-switch.h b/include/asm-sh/push-switch.h
index 4903f9e..73ecaf2 100644
--- a/include/asm-sh/push-switch.h
+++ b/include/asm-sh/push-switch.h
@@ -19,7 +19,7 @@ struct push_switch {
struct push_switch_platform_info {
/* IRQ handler */
- irqreturn_t (*irq_handler)(int irq, void *data);
+ irq_handler_t irq_handler;
/* Special IRQ flags */
unsigned int irq_flags;
/* Bit location of switch */
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH 15/15] [INPUT, PCMCIA] avoid use of 'irq' function arg
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (12 preceding siblings ...)
2008-04-18 23:23 ` [PATCH 14/15] Canonicalize several irq handlers Jeff Garzik
@ 2008-04-18 23:23 ` Jeff Garzik
2008-04-18 23:29 ` [PATCH 01/15] ARM minor irq handler cleanups Lennert Buytenhek
` (2 subsequent siblings)
16 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-18 23:23 UTC (permalink / raw)
To: dtor; +Cc: Andrew Morton, LKML
NOTE: NOT FOR MERGE, NOT FOR UPSTREAM
Not-signed-off-by: ...
This change's main purpose is to prepare for the patchset in
jgarzik/misc-2.6.git#irq-remove, that explores removal of the
never-used 'irq' argument in each interrupt handler.
---
drivers/input/serio/i8042.c | 23 +++++++++++++----------
drivers/pcmcia/i82365.c | 15 ++++++++++-----
2 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 65a74cf..ee2dfab 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -108,8 +108,6 @@ static unsigned char i8042_aux_irq_registered;
static unsigned char i8042_suppress_kbd_ack;
static struct platform_device *i8042_platform_device;
-static irqreturn_t i8042_interrupt(int irq, void *dev_id);
-
/*
* The i8042_wait_read() and i8042_wait_write functions wait for the i8042 to
* be ready for reading values from it / writing values to it.
@@ -302,7 +300,7 @@ static void i8042_stop(struct serio *serio)
* to the upper layers.
*/
-static irqreturn_t i8042_interrupt(int irq, void *dev_id)
+static irqreturn_t __i8042_interrupt(bool polled)
{
struct i8042_port *port;
unsigned long flags;
@@ -315,7 +313,7 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
str = i8042_read_status();
if (unlikely(~str & I8042_STR_OBF)) {
spin_unlock_irqrestore(&i8042_lock, flags);
- if (irq) dbg("Interrupt %d, without any data", irq);
+ if (!polled) dbg("Interrupt without any data");
ret = 0;
goto out;
}
@@ -370,8 +368,8 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
port = &i8042_ports[port_no];
- dbg("%02x <- i8042 (interrupt, %d, %d%s%s)",
- data, port_no, irq,
+ dbg("%02x <- i8042 (interrupt, %d, %s%s)",
+ data, port_no,
dfl & SERIO_PARITY ? ", bad parity" : "",
dfl & SERIO_TIMEOUT ? ", timeout" : "");
@@ -389,6 +387,11 @@ static irqreturn_t i8042_interrupt(int irq, void *dev_id)
return IRQ_RETVAL(ret);
}
+static irqreturn_t i8042_interrupt(int dummy, void *dev_id)
+{
+ return __i8042_interrupt(false);
+}
+
/*
* i8042_enable_kbd_port enables keybaord port on chip
*/
@@ -650,7 +653,7 @@ static int __devinit i8042_check_aux(void)
}
if (request_irq(I8042_AUX_IRQ, i8042_aux_test_irq, IRQF_SHARED,
- "i8042", i8042_platform_device))
+ "i8042", NULL))
goto out;
irq_registered = 1;
@@ -953,7 +956,7 @@ static int i8042_resume(struct platform_device *dev)
if (i8042_ports[I8042_KBD_PORT_NO].serio)
i8042_enable_kbd_port();
- i8042_interrupt(0, NULL);
+ __i8042_interrupt(true);
dev->dev.power.power_state = PMSG_ON;
@@ -1104,7 +1107,7 @@ static int __devinit i8042_setup_aux(void)
}
error = request_irq(I8042_AUX_IRQ, i8042_interrupt, IRQF_SHARED,
- "i8042", i8042_platform_device);
+ "i8042", NULL);
if (error)
goto err_free_ports;
@@ -1130,7 +1133,7 @@ static int __devinit i8042_setup_kbd(void)
return error;
error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED,
- "i8042", i8042_platform_device);
+ "i8042", NULL);
if (error)
goto err_free_port;
diff --git a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
index 32a2ab1..ce9364b 100644
--- a/drivers/pcmcia/i82365.c
+++ b/drivers/pcmcia/i82365.c
@@ -82,7 +82,8 @@ module_param(pc_debug, int, 0644);
static irqreturn_t i365_count_irq(int, void *);
static inline int _check_irq(int irq, int flags)
{
- if (request_irq(irq, i365_count_irq, flags, "x", i365_count_irq) != 0)
+ if (request_irq(irq, i365_count_irq, flags, "x",
+ (void *)(unsigned long) irq) != 0)
return -1;
free_irq(irq, i365_count_irq);
return 0;
@@ -497,8 +498,10 @@ static u_int __init set_bridge_opts(u_short s, u_short ns)
static volatile u_int irq_hits;
static u_short irq_sock;
-static irqreturn_t i365_count_irq(int irq, void *dev)
+static irqreturn_t i365_count_irq(int dummy, void *dev_id)
{
+ int irq = (int)(unsigned long) dev_id;
+
i365_get(irq_sock, I365_CSC);
irq_hits++;
debug(2, "-> hit on irq %d\n", irq);
@@ -509,7 +512,7 @@ static u_int __init test_irq(u_short sock, int irq)
{
debug(2, " testing ISA irq %d\n", irq);
if (request_irq(irq, i365_count_irq, IRQF_PROBE_SHARED, "scan",
- i365_count_irq) != 0)
+ (void *)(unsigned long) irq) != 0)
return 1;
irq_hits = 0; irq_sock = sock;
msleep(10);
@@ -847,8 +850,9 @@ static void __init isa_probe(void)
/*====================================================================*/
-static irqreturn_t pcic_interrupt(int irq, void *dev)
+static irqreturn_t pcic_interrupt(int dummy, void *dev_id)
{
+ int irq = (int)(unsigned long) dev_id;
int i, j, csc;
u_int events, active;
u_long flags = 0;
@@ -1293,7 +1297,8 @@ static int __init init_i82365(void)
/* Set up interrupt handler(s) */
if (grab_irq != 0)
- request_irq(cs_irq, pcic_interrupt, 0, "i82365", pcic_interrupt);
+ request_irq(cs_irq, pcic_interrupt, 0, "i82365",
+ (void *)(unsigned long) cs_irq);
/* register sockets with the pcmcia core */
for (i = 0; i < sockets; i++) {
--
1.5.4.1
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (13 preceding siblings ...)
2008-04-18 23:23 ` [PATCH 15/15] [INPUT, PCMCIA] avoid use of 'irq' function arg Jeff Garzik
@ 2008-04-18 23:29 ` Lennert Buytenhek
2008-04-19 0:25 ` Jeff Garzik
2008-04-18 23:44 ` Andrew Morton
2008-04-19 8:17 ` Russell King
16 siblings, 1 reply; 37+ messages in thread
From: Lennert Buytenhek @ 2008-04-18 23:29 UTC (permalink / raw)
To: Jeff Garzik; +Cc: rmk, linux-arm-kernel, kernel, Andrew Morton, LKML
On Fri, Apr 18, 2008 at 07:22:45PM -0400, Jeff Garzik wrote:
> Avoid confusion by /not/ passing an unused pointer to
> arm_rtc_interrupt()
Looks OK to me.
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
What do you mean? I know at least one of two interrupt handlers
in-tree that use their 'irq' arguments.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 02/15] [SPARC] minor irq handler cleanups
2008-04-18 23:22 ` [PATCH 02/15] [SPARC] " Jeff Garzik
@ 2008-04-18 23:33 ` David Miller
0 siblings, 0 replies; 37+ messages in thread
From: David Miller @ 2008-04-18 23:33 UTC (permalink / raw)
To: jeff; +Cc: akpm, linux-kernel
From: Jeff Garzik <jeff@garzik.org>
Date: Fri, 18 Apr 2008 19:22:46 -0400 (EDT)
> - mark timer_interrupt() static
>
> - sparc_floppy_request_irq() prototype should use irq_handler_t
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (14 preceding siblings ...)
2008-04-18 23:29 ` [PATCH 01/15] ARM minor irq handler cleanups Lennert Buytenhek
@ 2008-04-18 23:44 ` Andrew Morton
2008-04-19 0:21 ` Jeff Garzik
2008-04-19 8:17 ` Russell King
16 siblings, 1 reply; 37+ messages in thread
From: Andrew Morton @ 2008-04-18 23:44 UTC (permalink / raw)
To: Jeff Garzik; +Cc: rmk, linux-arm-kernel, kernel, linux-kernel
On Fri, 18 Apr 2008 19:22:45 -0400 (EDT)
Jeff Garzik <jeff@garzik.org> wrote:
> Avoid confusion by /not/ passing an unused pointer to
> arm_rtc_interrupt()
>
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
#irq-remove doesn't seem to be included in the #ALL branch which
I'm grabbing?
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-18 23:44 ` Andrew Morton
@ 2008-04-19 0:21 ` Jeff Garzik
2008-04-19 1:17 ` Andrew Morton
0 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-19 0:21 UTC (permalink / raw)
To: Andrew Morton; +Cc: rmk, linux-arm-kernel, kernel, linux-kernel
Andrew Morton wrote:
> On Fri, 18 Apr 2008 19:22:45 -0400 (EDT)
> Jeff Garzik <jeff@garzik.org> wrote:
>
>> Avoid confusion by /not/ passing an unused pointer to
>> arm_rtc_interrupt()
>>
>> This change's main purpose is to prepare for the patchset in
>> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
>> never-used 'irq' argument in each interrupt handler.
>
> #irq-remove doesn't seem to be included in the #ALL branch which
> I'm grabbing?
I certainly welcome the exposure....... but it would be a huge pain for
you IMO because of the constant breakage.
Jeff
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-18 23:29 ` [PATCH 01/15] ARM minor irq handler cleanups Lennert Buytenhek
@ 2008-04-19 0:25 ` Jeff Garzik
2008-04-19 16:14 ` Lennert Buytenhek
0 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-19 0:25 UTC (permalink / raw)
To: Lennert Buytenhek; +Cc: rmk, linux-arm-kernel, kernel, Andrew Morton, LKML
Lennert Buytenhek wrote:
> On Fri, Apr 18, 2008 at 07:22:45PM -0400, Jeff Garzik wrote:
>> This change's main purpose is to prepare for the patchset in
>> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
>> never-used 'irq' argument in each interrupt handler.
>
> What do you mean? I know at least one of two interrupt handlers
> in-tree that use their 'irq' arguments.
They can use new function get_irqfunc_irq(), similar to the existing
method of getting pt_regs for the tiny number of users who need that
sort of info, when pt_regs was removed.
But after having gone over, literally, every single interrupt handler in
the kernel, I can safely say that 99.8% never reference that argument,
and 0.1% that do already have the same information via another route.
That leaves only a few drivers that need it without modification, and
even fewer drivers that need it after modification.
Jeff
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-19 0:21 ` Jeff Garzik
@ 2008-04-19 1:17 ` Andrew Morton
2008-04-20 22:17 ` Jeff Garzik
0 siblings, 1 reply; 37+ messages in thread
From: Andrew Morton @ 2008-04-19 1:17 UTC (permalink / raw)
To: Jeff Garzik; +Cc: rmk, linux-arm-kernel, kernel, linux-kernel
On Fri, 18 Apr 2008 20:21:07 -0400 Jeff Garzik <jeff@garzik.org> wrote:
> Andrew Morton wrote:
> > On Fri, 18 Apr 2008 19:22:45 -0400 (EDT)
> > Jeff Garzik <jeff@garzik.org> wrote:
> >
> >> Avoid confusion by /not/ passing an unused pointer to
> >> arm_rtc_interrupt()
> >>
> >> This change's main purpose is to prepare for the patchset in
> >> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> >> never-used 'irq' argument in each interrupt handler.
> >
> > #irq-remove doesn't seem to be included in the #ALL branch which
> > I'm grabbing?
>
> I certainly welcome the exposure....... but it would be a huge pain for
> you IMO because of the constant breakage.
>
wow.
1084 files changed, 2363 insertions(+), 1934 deletions(-)
I didn't realise you'd changed all the interrupt handlers too. Good luck
with that :)
Is it a flag day or do we have a migration plan? I'd have thought that we
could do a request_irq_new(irqreturn_t (*)(void *d)) and keep things
compatible?
<checks>
Actually, that tree applies reasonably sanely to the full -mm lineup.
There are rejects of course, but they're easily fixed and a lot are due to
file motion which git will handle anyway,
The bigger problem is newly-added irq handlers which your patch doesn't
know about:
y:/usr/src/25> grep '^+.*request_irq[(]' patches/*.patch | wc -l
74
If we had a migration plan (ie: request_irq_new(), above) then this of
course wouldn't be a problem.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 05/15] drivers/char: minor irq handler cleanups
2008-04-18 23:22 ` [PATCH 05/15] drivers/char: " Jeff Garzik
@ 2008-04-19 6:00 ` Rogier Wolff
2008-04-22 8:05 ` Benjamin Herrenschmidt
2008-04-19 16:16 ` Alan Cox
1 sibling, 1 reply; 37+ messages in thread
From: Rogier Wolff @ 2008-04-19 6:00 UTC (permalink / raw)
To: Jeff Garzik; +Cc: alan, R.E.Wolff, Andrew Morton, LKML
On Fri, Apr 18, 2008 at 07:22:51PM -0400, Jeff Garzik wrote:
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
The changes look sane, (for the drivers that I'm involved with).
However, you're now adding a second parameter to my interrupt
routines: "polled" to replace the "never used" irq parameter. (which
/was/ used to determine wether we were called polled or not...
On the other hand, most hardware should work if you remove the if
(!polled).
You added a "XXX Using free_irq in the interrupt is not wise!". When I
wrote that code, I didn't know about this. These lines triggered when
the level-triggered PCI interrupt stuck "active" this would mean that
NO userspace code would get executed anymore: Hard lock up. Difficult
to debug. This happend a few times during development when the code
behind the "if (!polled)": "tell the hardware we've seen the
interrupt" didn't work. On the other hand, some failures in the field
have triggered this. So I think it's wise to keep it in. Disabling the
interrupt on the card is not an option, because that's exactly what
this is supposed to catch: We're unable to make the card stop
interrupting the CPU.
Note that it also doesn't work (i.e. hard lock of the machine) if some
other driver is using the same interupt.
Roger.
--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement.
Does it sit on the couch all day? Is it unemployed? Please be specific!
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
` (15 preceding siblings ...)
2008-04-18 23:44 ` Andrew Morton
@ 2008-04-19 8:17 ` Russell King
2008-04-19 8:28 ` Jeff Garzik
16 siblings, 1 reply; 37+ messages in thread
From: Russell King @ 2008-04-19 8:17 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-arm-kernel, kernel, Andrew Morton, LKML
On Fri, Apr 18, 2008 at 07:22:45PM -0400, Jeff Garzik wrote:
> Avoid confusion by /not/ passing an unused pointer to
> arm_rtc_interrupt()
>
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
I don't see how these two things are connected. Yes, it's true that
this RTC driver doesn't use 'dev_id' but that's an entirely separate
issue to removing the 'int irq' argument.
As I see it, this change is just unnecessarily adding to your workload
for this patch set.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-19 8:17 ` Russell King
@ 2008-04-19 8:28 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-19 8:28 UTC (permalink / raw)
To: Russell King; +Cc: linux-arm-kernel, kernel, Andrew Morton, LKML
Russell King wrote:
> On Fri, Apr 18, 2008 at 07:22:45PM -0400, Jeff Garzik wrote:
>> Avoid confusion by /not/ passing an unused pointer to
>> arm_rtc_interrupt()
>>
>> This change's main purpose is to prepare for the patchset in
>> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
>> never-used 'irq' argument in each interrupt handler.
>
> I don't see how these two things are connected. Yes, it's true that
> this RTC driver doesn't use 'dev_id' but that's an entirely separate
> issue to removing the 'int irq' argument.
>
> As I see it, this change is just unnecessarily adding to your workload
> for this patch set.
The added workload came from confusion created when I reviewed the code :)
Therefore I considered it better to have to less confusing version of
the code in my tree for future reviews, and ideally have the less
confusing version of the code in upstream as well.
I can remove the boilerplate paragraph from the patch description, if
that's your main complaint.
Jeff
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 04/15] [PPC] minor irq handler cleanups
2008-04-18 23:22 ` [PATCH 04/15] [PPC] " Jeff Garzik
@ 2008-04-19 14:57 ` Kumar Gala
0 siblings, 0 replies; 37+ messages in thread
From: Kumar Gala @ 2008-04-19 14:57 UTC (permalink / raw)
To: Jeff Garzik; +Cc: vitb, linuxppc-dev, Andrew Morton, LKML
On Apr 18, 2008, at 6:22 PM, Jeff Garzik wrote:
> - whitespace cleanups
>
> - remove pointless prototype (uses always follow func implementation)
>
> - 'irq' argument is often used purely as a local variable. rename
> argument to 'dummy' and define 'irq' as local to make this plain.
>
> - remove pointless casts from void*
>
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
arch/ppc is pretty much left for dead at this point. I'm guessing we
will end up removing it 2.6.27 if we follow through with our plans of
killing it this summer.
Acked-by: Kumar Gala <galak@kernel.crashing.org>
- k
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-19 0:25 ` Jeff Garzik
@ 2008-04-19 16:14 ` Lennert Buytenhek
0 siblings, 0 replies; 37+ messages in thread
From: Lennert Buytenhek @ 2008-04-19 16:14 UTC (permalink / raw)
To: Jeff Garzik; +Cc: rmk, linux-arm-kernel, Andrew Morton, LKML
On Fri, Apr 18, 2008 at 08:25:37PM -0400, Jeff Garzik wrote:
> >>This change's main purpose is to prepare for the patchset in
> >>jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> >>never-used 'irq' argument in each interrupt handler.
> >
> >What do you mean? I know at least one of two interrupt handlers
> >in-tree that use their 'irq' arguments.
>
> They can use new function get_irqfunc_irq(), similar to the existing
> method of getting pt_regs for the tiny number of users who need that
> sort of info, when pt_regs was removed.
Well, you said that the 'irq' argument was never-used, I was merely
saying that I found that not to be the case.
> But after having gone over, literally, every single interrupt handler in
> the kernel, I can safely say that 99.8% never reference that argument,
> and 0.1% that do already have the same information via another route.
>
> That leaves only a few drivers that need it without modification, and
> even fewer drivers that need it after modification.
Sounds good.
Very-much-liked-by: Lennert Buytenhek <buytenh@wantstofly.org>
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 05/15] drivers/char: minor irq handler cleanups
2008-04-18 23:22 ` [PATCH 05/15] drivers/char: " Jeff Garzik
2008-04-19 6:00 ` Rogier Wolff
@ 2008-04-19 16:16 ` Alan Cox
2008-04-21 1:38 ` Jeff Garzik
1 sibling, 1 reply; 37+ messages in thread
From: Alan Cox @ 2008-04-19 16:16 UTC (permalink / raw)
To: Jeff Garzik; +Cc: alan, R.E.Wolff, Andrew Morton, LKML
On Fri, Apr 18, 2008 at 07:22:51PM -0400, Jeff Garzik wrote:
> +++ b/drivers/char/cyclades.c
> if (unlikely(!ISZLOADED(*cinfo))) {
> #ifdef CY_DEBUG_INTERRUPTS
> - printk(KERN_DEBUG "cyz_interrupt: board not yet loaded "
> - "(IRQ%d).\n", irq);
> + printk(KERN_DEBUG "cyz_interrupt: board not yet loaded\n");
If you are debugging IRQ funnies you really really want to know which
IRQ or which port.
Ack the rest on the base the __foo_interrupt uglies will go away with the
final change over. A follow up patch to tweak cyclades would be useful and also
to know from Andrew if these are going in so they don't clash with the coding
style cleanups also queued.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-19 1:17 ` Andrew Morton
@ 2008-04-20 22:17 ` Jeff Garzik
2008-04-20 22:40 ` Russell King
0 siblings, 1 reply; 37+ messages in thread
From: Jeff Garzik @ 2008-04-20 22:17 UTC (permalink / raw)
To: Andrew Morton; +Cc: rmk, linux-arm-kernel, kernel, linux-kernel
Andrew Morton wrote:
> I didn't realise you'd changed all the interrupt handlers too. Good luck
> with that :)
Hey, I did, and last time I checked (months ago, to be honest) it boots
on x86 :)
> Is it a flag day or do we have a migration plan? I'd have thought that we
> could do a request_irq_new(irqreturn_t (*)(void *d)) and keep things
> compatible?
>
>
>
> <checks>
>
> Actually, that tree applies reasonably sanely to the full -mm lineup.
> There are rejects of course, but they're easily fixed and a lot are due to
> file motion which git will handle anyway,
>
> The bigger problem is newly-added irq handlers which your patch doesn't
> know about:
>
> y:/usr/src/25> grep '^+.*request_irq[(]' patches/*.patch | wc -l
> 74
>
> If we had a migration plan (ie: request_irq_new(), above) then this of
> course wouldn't be a problem.
A fair comment...
My goal has been to get the tree to the point where a flag-day patch
"make the obvious change to each irq handler" /could/ be applied --
following the lead of the huge 'pt_regs arg removal' that went in in Oct
2006.
Since I knew reaching that point would take time -- I started this
project in Aug/Sep 2006 -- I simply didn't bother with a migration plan
at the time. I figured once the tree was prepped, which has taken over
a year, _then_ I would waste maintainers' time discussing migration.
Jeff
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-20 22:17 ` Jeff Garzik
@ 2008-04-20 22:40 ` Russell King
2008-04-20 22:49 ` Jeff Garzik
0 siblings, 1 reply; 37+ messages in thread
From: Russell King @ 2008-04-20 22:40 UTC (permalink / raw)
To: Jeff Garzik, Andrew Morton; +Cc: linux-arm-kernel, kernel, linux-kernel
On Sun, Apr 20, 2008 at 06:17:32PM -0400, Jeff Garzik wrote:
> Andrew Morton wrote:
> >If we had a migration plan (ie: request_irq_new(), above) then this of
> >course wouldn't be a problem.
>
> A fair comment...
Then we'll be stuck with request_irq_new() for the next 10 years or so.
FWIW (and appologies for hijacking the topic), Jeffs discussion about
changing the ARM integrator RTC driver has triggered a number of cleanups
in the ARM tree:
- converting the ARM integrator PL030 RTC driver to a RTC class driver
... which triggered:
- removal of the ARM dyntick code and the unused generic changes
(including the s390 and sh bits which look like they've never been
functional.)
... which triggered:
- attempting to fix a circular include dependency involving linux/irq.h
and asm-arm/mach/irq.h
... which then triggered:
- allowing PXA platform class to build for more than one PXA platform
at a time, so I don't have to run 20 (!) separate kernel builds to
check them all for breakage caused by the elimination of the
circular dependency.
... which also allowed me to find several PXA platform build bugs.
Thanks Jeff. ;)
I'm not intending pushing this stuff into mainline for a bit, although
it will appear in my public tree for others to start looking at and for
them to be aware of.
That does mean that, unfortunately, akpm's going to see those changes
and it might cause Andrew some headaches - sorry about that. You may
wish to avoid pulling the ARM 'devel' branch until the dust settles.
(Obviously the appropriate fixes will be head towards Linus at the
appropriate time.)
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 01/15] ARM minor irq handler cleanups
2008-04-20 22:40 ` Russell King
@ 2008-04-20 22:49 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-20 22:49 UTC (permalink / raw)
To: Russell King, Andrew Morton; +Cc: linux-arm-kernel, kernel, linux-kernel
Russell King wrote:
> On Sun, Apr 20, 2008 at 06:17:32PM -0400, Jeff Garzik wrote:
>> Andrew Morton wrote:
>>> If we had a migration plan (ie: request_irq_new(), above) then this of
>>> course wouldn't be a problem.
>> A fair comment...
>
> Then we'll be stuck with request_irq_new() for the next 10 years or so.
(un-hijacking topic <grin>)
Another fair comment. I am secretly hoping for the ease of a flag day
(a la pt_regs) rather than a decade-long transition, but I readily to
confess to dodging the entire issue by doing all these cleanups first :)
Jeff
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 05/15] drivers/char: minor irq handler cleanups
2008-04-19 16:16 ` Alan Cox
@ 2008-04-21 1:38 ` Jeff Garzik
0 siblings, 0 replies; 37+ messages in thread
From: Jeff Garzik @ 2008-04-21 1:38 UTC (permalink / raw)
To: Alan Cox, R.E.Wolff; +Cc: Andrew Morton, LKML
Alan Cox wrote:
> On Fri, Apr 18, 2008 at 07:22:51PM -0400, Jeff Garzik wrote:
>> +++ b/drivers/char/cyclades.c
>> if (unlikely(!ISZLOADED(*cinfo))) {
>> #ifdef CY_DEBUG_INTERRUPTS
>> - printk(KERN_DEBUG "cyz_interrupt: board not yet loaded "
>> - "(IRQ%d).\n", irq);
>> + printk(KERN_DEBUG "cyz_interrupt: board not yet loaded\n");
>
> If you are debugging IRQ funnies you really really want to know which
> IRQ or which port.
>
> Ack the rest on the base the __foo_interrupt uglies will go away with the
> final change over. A follow up patch to tweak cyclades would be useful and also
> to know from Andrew if these are going in so they don't clash with the coding
> style cleanups also queued.
In the stuff I pushed just now, I took the attitude "if there was
remotely a peep from anyone, do not send it"
So the stuff ya'll mentioned shouldn't be in the push at all.
In particular, I wanted to note the __foo_interrupt stuff will not go
away when I remove the 'irq' arg from all handlers... we still need to
indicate two separate callsites (local poll or system irq) to achieve
the same behavior as exists today.
Jeff
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 13/15] [X86] standard vm86 irq handler
2008-04-18 23:23 ` [PATCH 13/15] [X86] standard vm86 irq handler Jeff Garzik
@ 2008-04-21 13:52 ` Ingo Molnar
0 siblings, 0 replies; 37+ messages in thread
From: Ingo Molnar @ 2008-04-21 13:52 UTC (permalink / raw)
To: Jeff Garzik; +Cc: tglx, mingo, Andrew Morton, LKML
* Jeff Garzik <jeff@garzik.org> wrote:
> Prefer 'void *dev_id' argument for passing data from request_irq() to
> each per-irq handler invocation.
thanks, applied.
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
neat ...
Ingo
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 03/15] [BLACKFIN] minor irq handler cleanups
2008-04-18 23:22 ` [PATCH 03/15] [BLACKFIN] " Jeff Garzik
@ 2008-04-22 3:27 ` Bryan Wu
0 siblings, 0 replies; 37+ messages in thread
From: Bryan Wu @ 2008-04-22 3:27 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Andrew Morton, LKML
On Sat, Apr 19, 2008 at 7:22 AM, Jeff Garzik <jeff@garzik.org> wrote:
> - time_sched_init() should use standard irq_handler_t
>
> - sys_timer0_int_handler() should not take 'regs' third argument
>
> - remove pointless cast from void*
>
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
> ---
> arch/blackfin/kernel/time.c | 5 ++---
> arch/blackfin/oprofile/timer_int.c | 5 ++---
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c
> index 9bdc8f9..715b394 100644
> --- a/arch/blackfin/kernel/time.c
> +++ b/arch/blackfin/kernel/time.c
> @@ -39,8 +39,7 @@
> /* This is an NTP setting */
> #define TICK_SIZE (tick_nsec / 1000)
>
> -static void time_sched_init(irqreturn_t(*timer_routine)
> - (int, void *));
> +static void time_sched_init(irq_handler_t timer_routine);
> static unsigned long gettimeoffset(void);
>
> static struct irqaction bfin_timer_irq = {
> @@ -64,7 +63,7 @@ static struct irqaction bfin_timer_irq = {
> #define TIME_SCALE 1
>
> static void
> -time_sched_init(irqreturn_t(*timer_routine) (int, void *))
> +time_sched_init(irq_handler_t timer_routine)
> {
> u32 tcount;
>
> diff --git a/arch/blackfin/oprofile/timer_int.c b/arch/blackfin/oprofile/timer_int.c
> index 6c6f860..e2c825a 100644
> --- a/arch/blackfin/oprofile/timer_int.c
> +++ b/arch/blackfin/oprofile/timer_int.c
> @@ -40,10 +40,9 @@ static void disable_sys_timer0()
> {
> }
>
> -static irqreturn_t sys_timer0_int_handler(int irq, void *dev_id,
> - struct pt_regs *regs)
> +static irqreturn_t sys_timer0_int_handler(int irq, void *dev_id)
> {
> - oprofile_add_sample(regs, 0);
> + oprofile_add_sample(get_irq_regs(), 0);
> return IRQ_HANDLED;
> }
>
Sorry for the delay, it is pretty good for Blackfin.
Acked-by: Bryan Wu <cooloney@kernel.org>
-Bryan
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 05/15] drivers/char: minor irq handler cleanups
2008-04-19 6:00 ` Rogier Wolff
@ 2008-04-22 8:05 ` Benjamin Herrenschmidt
2008-04-22 10:13 ` Rogier Wolff
0 siblings, 1 reply; 37+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-22 8:05 UTC (permalink / raw)
To: Rogier Wolff; +Cc: Jeff Garzik, alan, Andrew Morton, LKML
On Sat, 2008-04-19 at 08:00 +0200, Rogier Wolff wrote:
>
> You added a "XXX Using free_irq in the interrupt is not wise!". When I
> wrote that code, I didn't know about this. These lines triggered when
> the level-triggered PCI interrupt stuck "active" this would mean that
> NO userspace code would get executed anymore: Hard lock up. Difficult
> to debug. This happend a few times during development when the code
> behind the "if (!polled)": "tell the hardware we've seen the
> interrupt" didn't work. On the other hand, some failures in the field
> have triggered this. So I think it's wise to keep it in. Disabling the
> interrupt on the card is not an option, because that's exactly what
> this is supposed to catch: We're unable to make the card stop
> interrupting the CPU.
>
> Note that it also doesn't work (i.e. hard lock of the machine) if some
> other driver is using the same interupt.
You should let the kernel generic code deal with the runaway interrupt,
it should be capable of doing so nowadays pretty reliably.
free_irq() is definitely not going to be happy when it start messing
with /proc from an interrupt... It will at least give you a WARN_ON.
Ben.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 05/15] drivers/char: minor irq handler cleanups
2008-04-22 8:05 ` Benjamin Herrenschmidt
@ 2008-04-22 10:13 ` Rogier Wolff
2008-04-22 10:46 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 37+ messages in thread
From: Rogier Wolff @ 2008-04-22 10:13 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Rogier Wolff, Jeff Garzik, alan, Andrew Morton, LKML
On Tue, Apr 22, 2008 at 06:05:40PM +1000, Benjamin Herrenschmidt wrote:
>
> On Sat, 2008-04-19 at 08:00 +0200, Rogier Wolff wrote:
> >
> > You added a "XXX Using free_irq in the interrupt is not wise!". When I
> > wrote that code, I didn't know about this. These lines triggered when
> > the level-triggered PCI interrupt stuck "active" this would mean that
> > NO userspace code would get executed anymore: Hard lock up. Difficult
> > to debug. This happend a few times during development when the code
> > behind the "if (!polled)": "tell the hardware we've seen the
> > interrupt" didn't work. On the other hand, some failures in the field
> > have triggered this. So I think it's wise to keep it in. Disabling the
> > interrupt on the card is not an option, because that's exactly what
> > this is supposed to catch: We're unable to make the card stop
> > interrupting the CPU.
> >
> > Note that it also doesn't work (i.e. hard lock of the machine) if some
> > other driver is using the same interupt.
>
> You should let the kernel generic code deal with the runaway interrupt,
> it should be capable of doing so nowadays pretty reliably.
>
> free_irq() is definitely not going to be happy when it start messing
> with /proc from an interrupt... It will at least give you a WARN_ON.
The situation is NOT normal operation. It is an emergency measure in
an attempt to prevent a full hang. It is great that other parts of the
kernel also "shout" that something is wrong.
Consider it similar to a "kernel null pointer dereference". Once that
happens, all bets are off. In practise you've probably seen one, and
you were able to continue to work. It is advisable to save everything
you can, and reboot. This is similar.
The "generic code for runaway interrupts" didn't exist when this was
written. If it exists, and works for the case that this was written
for, then all is fine, and we can remove my code. As you can see, I
copied over the code from one driver to the next after I got bitten
again with the second driver. So having something generic is of course
preferable. :-)
Roger.
--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement.
Does it sit on the couch all day? Is it unemployed? Please be specific!
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 05/15] drivers/char: minor irq handler cleanups
2008-04-22 10:13 ` Rogier Wolff
@ 2008-04-22 10:46 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 37+ messages in thread
From: Benjamin Herrenschmidt @ 2008-04-22 10:46 UTC (permalink / raw)
To: Rogier Wolff; +Cc: Jeff Garzik, alan, Andrew Morton, LKML
On Tue, 2008-04-22 at 12:13 +0200, Rogier Wolff wrote:
> > You should let the kernel generic code deal with the runaway
> interrupt,
> > it should be capable of doing so nowadays pretty reliably.
> >
> > free_irq() is definitely not going to be happy when it start messing
> > with /proc from an interrupt... It will at least give you a WARN_ON.
>
> The situation is NOT normal operation. It is an emergency measure in
> an attempt to prevent a full hang. It is great that other parts of the
> kernel also "shout" that something is wrong.
But free_irq at interrupt time has great chances of crashing the machine
or currupting data structures in subtle ways. You should -not- do that.
Either let the kernel handle the runaway interrupt, or eventually if you
want to be brutal, call disable_irq_nosync yourself, but not free_irq.
> Consider it similar to a "kernel null pointer dereference". Once that
> happens, all bets are off. In practise you've probably seen one, and
> you were able to continue to work. It is advisable to save everything
> you can, and reboot. This is similar.
It would be if you used something like disable_irq_nosync. Not free_irq.
The later is just bogus.
> The "generic code for runaway interrupts" didn't exist when this was
> written. If it exists, and works for the case that this was written
> for, then all is fine, and we can remove my code. As you can see, I
> copied over the code from one driver to the next after I got bitten
> again with the second driver. So having something generic is of course
> preferable. :-)
Well, if you know how to trigger the bug, it would be useful to verify
that the kernel generic code properly detects and masks the runaway
interrupt. If that works, then remove your code completely. If not, it
would be useful to figure out why :-) But either way, just replace it
with disable_irq_nosync.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: minor irq handler cleanups
2008-04-18 23:23 ` [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: " Jeff Garzik
@ 2008-04-28 20:53 ` Ralf Baechle
0 siblings, 0 replies; 37+ messages in thread
From: Ralf Baechle @ 2008-04-28 20:53 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Andrew Morton, LKML
On Fri, Apr 18, 2008 at 07:23:01PM -0400, Jeff Garzik wrote:
> - remove always-true test
>
> - neaten request_irq() indentation
>
> This change's main purpose is to prepare for the patchset in
> jgarzik/misc-2.6.git#irq-remove, that explores removal of the
> never-used 'irq' argument in each interrupt handler.
>
> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Applied, thanks Jeff.
Ralf
^ permalink raw reply [flat|nested] 37+ messages in thread
end of thread, other threads:[~2008-04-28 21:03 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-18 23:22 [PATCH 01/15] ARM minor irq handler cleanups Jeff Garzik
2008-04-18 23:22 ` [PATCH 02/15] [SPARC] " Jeff Garzik
2008-04-18 23:33 ` David Miller
2008-04-18 23:22 ` [PATCH 03/15] [BLACKFIN] " Jeff Garzik
2008-04-22 3:27 ` Bryan Wu
2008-04-18 23:22 ` [PATCH 04/15] [PPC] " Jeff Garzik
2008-04-19 14:57 ` Kumar Gala
2008-04-18 23:22 ` [PATCH 05/15] drivers/char: " Jeff Garzik
2008-04-19 6:00 ` Rogier Wolff
2008-04-22 8:05 ` Benjamin Herrenschmidt
2008-04-22 10:13 ` Rogier Wolff
2008-04-22 10:46 ` Benjamin Herrenschmidt
2008-04-19 16:16 ` Alan Cox
2008-04-21 1:38 ` Jeff Garzik
2008-04-18 23:22 ` [PATCH 06/15] [SCSI] " Jeff Garzik
2008-04-18 23:22 ` [PATCH 07/15] [SCSI] aha1542: " Jeff Garzik
2008-04-18 23:22 ` [PATCH 08/15] [ISDN] " Jeff Garzik
2008-04-18 23:22 ` [PATCH 09/15] [AVR32] remove unused 'irq' argument from local_timer_interrupt() Jeff Garzik
2008-04-18 23:22 ` [PATCH 10/15] [IA64] minor irq handler cleanups Jeff Garzik
2008-04-18 23:23 ` [PATCH 11/15] [RTC] " Jeff Garzik
2008-04-18 23:23 ` [PATCH 12/15] [MIPS] pmc-sierra/msp71xx/msp_hwbutton.c: " Jeff Garzik
2008-04-28 20:53 ` Ralf Baechle
2008-04-18 23:23 ` [PATCH 13/15] [X86] standard vm86 irq handler Jeff Garzik
2008-04-21 13:52 ` Ingo Molnar
2008-04-18 23:23 ` [PATCH 14/15] Canonicalize several irq handlers Jeff Garzik
2008-04-18 23:23 ` [PATCH 15/15] [INPUT, PCMCIA] avoid use of 'irq' function arg Jeff Garzik
2008-04-18 23:29 ` [PATCH 01/15] ARM minor irq handler cleanups Lennert Buytenhek
2008-04-19 0:25 ` Jeff Garzik
2008-04-19 16:14 ` Lennert Buytenhek
2008-04-18 23:44 ` Andrew Morton
2008-04-19 0:21 ` Jeff Garzik
2008-04-19 1:17 ` Andrew Morton
2008-04-20 22:17 ` Jeff Garzik
2008-04-20 22:40 ` Russell King
2008-04-20 22:49 ` Jeff Garzik
2008-04-19 8:17 ` Russell King
2008-04-19 8:28 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox