Commit a688bf88 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] irqs: ATM

Update ATM drivers to new IRQ API
parent 153dec02
...@@ -868,7 +868,8 @@ static inline void interrupts_off (amb_dev * dev) { ...@@ -868,7 +868,8 @@ static inline void interrupts_off (amb_dev * dev) {
/********** interrupt handling **********/ /********** interrupt handling **********/
static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) { static irqreturn_t interrupt_handler(int irq, void *dev_id,
struct pt_regs *pt_regs) {
amb_dev * dev = amb_devs; amb_dev * dev = amb_devs;
(void) pt_regs; (void) pt_regs;
...@@ -876,7 +877,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) ...@@ -876,7 +877,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs)
if (!dev_id) { if (!dev_id) {
PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
return; return IRQ_NONE;
} }
// Did one of our cards generate the interrupt? // Did one of our cards generate the interrupt?
while (dev) { while (dev) {
...@@ -889,12 +890,12 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) ...@@ -889,12 +890,12 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs)
// the card generates an IRQ at startup - should not happen again // the card generates an IRQ at startup - should not happen again
if (!dev) { if (!dev) {
PRINTD (DBG_IRQ, "irq for unknown device: %d", irq); PRINTD (DBG_IRQ, "irq for unknown device: %d", irq);
return; return IRQ_NONE;
} }
// impossible - unless we have memory corruption of dev or kernel // impossible - unless we have memory corruption of dev or kernel
if (irq != dev->irq) { if (irq != dev->irq) {
PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq);
return; return IRQ_NONE;
} }
{ {
...@@ -903,7 +904,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) ...@@ -903,7 +904,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs)
// for us or someone else sharing the same interrupt // for us or someone else sharing the same interrupt
if (!interrupt) { if (!interrupt) {
PRINTD (DBG_IRQ, "irq not for me: %d", irq); PRINTD (DBG_IRQ, "irq not for me: %d", irq);
return; return IRQ_NONE;
} }
// definitely for us // definitely for us
...@@ -934,7 +935,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) ...@@ -934,7 +935,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs)
} }
PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id); PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id);
return; return IRQ_HANDLED;
} }
/********** don't panic... yeah, right **********/ /********** don't panic... yeah, right **********/
......
...@@ -1483,7 +1483,7 @@ static void bug_int(struct atm_dev *dev,unsigned long reason) ...@@ -1483,7 +1483,7 @@ static void bug_int(struct atm_dev *dev,unsigned long reason)
} }
static void eni_int(int irq,void *dev_id,struct pt_regs *regs) static irqreturn_t eni_int(int irq,void *dev_id,struct pt_regs *regs)
{ {
struct atm_dev *dev; struct atm_dev *dev;
struct eni_dev *eni_dev; struct eni_dev *eni_dev;
...@@ -1515,6 +1515,7 @@ static void eni_int(int irq,void *dev_id,struct pt_regs *regs) ...@@ -1515,6 +1515,7 @@ static void eni_int(int irq,void *dev_id,struct pt_regs *regs)
eni_dev->events |= reason; eni_dev->events |= reason;
spin_unlock(&eni_dev->lock); spin_unlock(&eni_dev->lock);
tasklet_schedule(&eni_dev->task); tasklet_schedule(&eni_dev->task);
return IRQ_HANDLED;
} }
......
...@@ -1562,14 +1562,15 @@ static void __devexit free_freepool (struct fs_dev *dev, struct freepool *fp) ...@@ -1562,14 +1562,15 @@ static void __devexit free_freepool (struct fs_dev *dev, struct freepool *fp)
static void fs_irq (int irq, void *dev_id, struct pt_regs * pt_regs) static irqreturn_t fs_irq (int irq, void *dev_id, struct pt_regs * pt_regs)
{ {
int i; int i;
u32 status; u32 status;
struct fs_dev *dev = dev_id; struct fs_dev *dev = dev_id;
status = read_fs (dev, ISR); status = read_fs (dev, ISR);
if (!status) return; if (!status)
return IRQ_NONE;
func_enter (); func_enter ();
...@@ -1649,6 +1650,7 @@ static void fs_irq (int irq, void *dev_id, struct pt_regs * pt_regs) ...@@ -1649,6 +1650,7 @@ static void fs_irq (int irq, void *dev_id, struct pt_regs * pt_regs)
} }
func_exit (); func_exit ();
return IRQ_HANDLED;
} }
......
...@@ -1227,7 +1227,7 @@ fore200e_irq_rx(struct fore200e* fore200e) ...@@ -1227,7 +1227,7 @@ fore200e_irq_rx(struct fore200e* fore200e)
} }
static void static irqreturn_t
fore200e_interrupt(int irq, void* dev, struct pt_regs* regs) fore200e_interrupt(int irq, void* dev, struct pt_regs* regs)
{ {
struct fore200e* fore200e = FORE200E_DEV((struct atm_dev*)dev); struct fore200e* fore200e = FORE200E_DEV((struct atm_dev*)dev);
...@@ -1235,13 +1235,14 @@ fore200e_interrupt(int irq, void* dev, struct pt_regs* regs) ...@@ -1235,13 +1235,14 @@ fore200e_interrupt(int irq, void* dev, struct pt_regs* regs)
if (fore200e->bus->irq_check(fore200e) == 0) { if (fore200e->bus->irq_check(fore200e) == 0) {
DPRINTK(3, "unexpected interrupt on device %c\n", fore200e->name[9]); DPRINTK(3, "unexpected interrupt on device %c\n", fore200e->name[9]);
return; return IRQ_NONE;
} }
DPRINTK(3, "valid interrupt on device %c\n", fore200e->name[9]); DPRINTK(3, "valid interrupt on device %c\n", fore200e->name[9]);
tasklet_schedule(&fore200e->tasklet); tasklet_schedule(&fore200e->tasklet);
fore200e->bus->irq_ack(fore200e); fore200e->bus->irq_ack(fore200e);
return IRQ_HANDLED;
} }
......
...@@ -1398,7 +1398,8 @@ static inline void rx_data_av_handler (hrz_dev * dev) { ...@@ -1398,7 +1398,8 @@ static inline void rx_data_av_handler (hrz_dev * dev) {
/********** interrupt handler **********/ /********** interrupt handler **********/
static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) { static irqreturn_t interrupt_handler(int irq, void *dev_id,
struct pt_regs *pt_regs) {
hrz_dev * dev = hrz_devs; hrz_dev * dev = hrz_devs;
u32 int_source; u32 int_source;
unsigned int irq_ok; unsigned int irq_ok;
...@@ -1408,7 +1409,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) ...@@ -1408,7 +1409,7 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs)
if (!dev_id) { if (!dev_id) {
PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq); PRINTD (DBG_IRQ|DBG_ERR, "irq with NULL dev_id: %d", irq);
return; return IRQ_NONE;
} }
// Did one of our cards generate the interrupt? // Did one of our cards generate the interrupt?
while (dev) { while (dev) {
...@@ -1418,11 +1419,11 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) ...@@ -1418,11 +1419,11 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs)
} }
if (!dev) { if (!dev) {
PRINTD (DBG_IRQ, "irq not for me: %d", irq); PRINTD (DBG_IRQ, "irq not for me: %d", irq);
return; return IRQ_NONE;
} }
if (irq != dev->irq) { if (irq != dev->irq) {
PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq); PRINTD (DBG_IRQ|DBG_ERR, "irq mismatch: %d", irq);
return; return IRQ_NONE;
} }
// definitely for us // definitely for us
...@@ -1468,6 +1469,9 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs) ...@@ -1468,6 +1469,9 @@ static void interrupt_handler (int irq, void * dev_id, struct pt_regs * pt_regs)
} }
PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id); PRINTD (DBG_IRQ|DBG_FLOW, "interrupt_handler done: %p", dev_id);
if (irq_ok)
return IRQ_HANDLED;
return IRQ_NONE;
} }
/********** housekeeping **********/ /********** housekeeping **********/
......
...@@ -134,8 +134,6 @@ static int idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos, ...@@ -134,8 +134,6 @@ static int idt77252_change_qos(struct atm_vcc *vcc, struct atm_qos *qos,
int flags); int flags);
static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos, static int idt77252_proc_read(struct atm_dev *dev, loff_t * pos,
char *page); char *page);
static void idt77252_interrupt(int irq, void *dev_id,
struct pt_regs *regs);
static void idt77252_softint(void *dev_id); static void idt77252_softint(void *dev_id);
...@@ -2812,7 +2810,7 @@ idt77252_collect_stat(struct idt77252_dev *card) ...@@ -2812,7 +2810,7 @@ idt77252_collect_stat(struct idt77252_dev *card)
#endif #endif
} }
static void static irqreturn_t
idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
{ {
struct idt77252_dev *card = dev_id; struct idt77252_dev *card = dev_id;
...@@ -2820,7 +2818,7 @@ idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) ...@@ -2820,7 +2818,7 @@ idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
stat = readl(SAR_REG_STAT) & 0xffff; stat = readl(SAR_REG_STAT) & 0xffff;
if (!stat) /* no interrupt for us */ if (!stat) /* no interrupt for us */
return; return IRQ_NONE;
if (test_and_set_bit(IDT77252_BIT_INTERRUPT, &card->flags)) { if (test_and_set_bit(IDT77252_BIT_INTERRUPT, &card->flags)) {
printk("%s: Re-entering irq_handler()\n", card->name); printk("%s: Re-entering irq_handler()\n", card->name);
...@@ -2901,6 +2899,7 @@ idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) ...@@ -2901,6 +2899,7 @@ idt77252_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
out: out:
clear_bit(IDT77252_BIT_INTERRUPT, &card->flags); clear_bit(IDT77252_BIT_INTERRUPT, &card->flags);
return IRQ_HANDLED;
} }
static void static void
......
...@@ -2197,16 +2197,18 @@ static int tx_init(struct atm_dev *dev) ...@@ -2197,16 +2197,18 @@ static int tx_init(struct atm_dev *dev)
return -ENOMEM; return -ENOMEM;
} }
static void ia_int(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t ia_int(int irq, void *dev_id, struct pt_regs *regs)
{ {
struct atm_dev *dev; struct atm_dev *dev;
IADEV *iadev; IADEV *iadev;
unsigned int status; unsigned int status;
int handled = 0;
dev = dev_id; dev = dev_id;
iadev = INPH_IA_DEV(dev); iadev = INPH_IA_DEV(dev);
while( (status = readl(iadev->reg+IPHASE5575_BUS_STATUS_REG) & 0x7f)) while( (status = readl(iadev->reg+IPHASE5575_BUS_STATUS_REG) & 0x7f))
{ {
handled = 1;
IF_EVENT(printk("ia_int: status = 0x%x\n", status);) IF_EVENT(printk("ia_int: status = 0x%x\n", status);)
if (status & STAT_REASSINT) if (status & STAT_REASSINT)
{ {
...@@ -2236,7 +2238,8 @@ static void ia_int(int irq, void *dev_id, struct pt_regs *regs) ...@@ -2236,7 +2238,8 @@ static void ia_int(int irq, void *dev_id, struct pt_regs *regs)
if (status & STAT_FEINT) if (status & STAT_FEINT)
IaFrontEndIntr(iadev); IaFrontEndIntr(iadev);
} }
} }
return IRQ_RETVAL(handled);
} }
......
...@@ -2047,10 +2047,12 @@ static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason) ...@@ -2047,10 +2047,12 @@ static inline void lanai_int_1(struct lanai_dev *lanai, u32 reason)
reg_write(lanai, ack, IntAck_Reg); reg_write(lanai, ack, IntAck_Reg);
} }
static void lanai_int(int irq, void *devid, struct pt_regs *regs) static irqreturn_t lanai_int(int irq, void *devid, struct pt_regs *regs)
{ {
struct lanai_dev *lanai = (struct lanai_dev *) devid; struct lanai_dev *lanai = (struct lanai_dev *) devid;
u32 reason; u32 reason;
int handled = 0;
(void) irq; (void) regs; /* unused variables */ (void) irq; (void) regs; /* unused variables */
#ifdef USE_POWERDOWN #ifdef USE_POWERDOWN
if (lanai->conf1 & CONFIG1_POWERDOWN) { if (lanai->conf1 & CONFIG1_POWERDOWN) {
...@@ -2062,8 +2064,11 @@ static void lanai_int(int irq, void *devid, struct pt_regs *regs) ...@@ -2062,8 +2064,11 @@ static void lanai_int(int irq, void *devid, struct pt_regs *regs)
conf2_write(lanai); conf2_write(lanai);
} }
#endif #endif
while ((reason = intr_pending(lanai)) != 0) while ((reason = intr_pending(lanai)) != 0) {
handled = 1;
lanai_int_1(lanai, reason); lanai_int_1(lanai, reason);
}
return IRQ_RETVAL(handled);
} }
/* TODO - it would be nice if we could use the "delayed interrupt" system /* TODO - it would be nice if we could use the "delayed interrupt" system
......
...@@ -220,7 +220,7 @@ static scq_info *get_scq(int size, u32 scd); ...@@ -220,7 +220,7 @@ static scq_info *get_scq(int size, u32 scd);
static void free_scq(scq_info *scq, struct atm_vcc *vcc); static void free_scq(scq_info *scq, struct atm_vcc *vcc);
static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1, static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1,
u32 handle2, u32 addr2); u32 handle2, u32 addr2);
static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs);
static int ns_open(struct atm_vcc *vcc, short vpi, int vci); static int ns_open(struct atm_vcc *vcc, short vpi, int vci);
static void ns_close(struct atm_vcc *vcc); static void ns_close(struct atm_vcc *vcc);
static void fill_tst(ns_dev *card, int n, vc_map *vc); static void fill_tst(ns_dev *card, int n, vc_map *vc);
...@@ -1186,7 +1186,7 @@ static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1, ...@@ -1186,7 +1186,7 @@ static void push_rxbufs(ns_dev *card, u32 type, u32 handle1, u32 addr1,
static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs) static irqreturn_t ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
{ {
u32 stat_r; u32 stat_r;
ns_dev *card; ns_dev *card;
...@@ -1366,6 +1366,7 @@ static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1366,6 +1366,7 @@ static void ns_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
spin_unlock_irqrestore(&card->int_lock, flags); spin_unlock_irqrestore(&card->int_lock, flags);
PRINTK("nicstar%d: end of interrupt service\n", card->index); PRINTK("nicstar%d: end of interrupt service\n", card->index);
return IRQ_HANDLED;
} }
......
...@@ -1214,15 +1214,17 @@ static int start_tx(struct atm_dev *dev) ...@@ -1214,15 +1214,17 @@ static int start_tx(struct atm_dev *dev)
/*------------------------------- interrupts --------------------------------*/ /*------------------------------- interrupts --------------------------------*/
static void zatm_int(int irq,void *dev_id,struct pt_regs *regs) static irqreturn_t zatm_int(int irq,void *dev_id,struct pt_regs *regs)
{ {
struct atm_dev *dev; struct atm_dev *dev;
struct zatm_dev *zatm_dev; struct zatm_dev *zatm_dev;
u32 reason; u32 reason;
int handled = 0;
dev = dev_id; dev = dev_id;
zatm_dev = ZATM_DEV(dev); zatm_dev = ZATM_DEV(dev);
while ((reason = zin(GSR))) { while ((reason = zin(GSR))) {
handled = 1;
EVENT("reason 0x%x\n",reason,0); EVENT("reason 0x%x\n",reason,0);
if (reason & uPD98401_INT_PI) { if (reason & uPD98401_INT_PI) {
EVENT("PHY int\n",0,0); EVENT("PHY int\n",0,0);
...@@ -1285,6 +1287,7 @@ static void zatm_int(int irq,void *dev_id,struct pt_regs *regs) ...@@ -1285,6 +1287,7 @@ static void zatm_int(int irq,void *dev_id,struct pt_regs *regs)
} }
/* @@@ handle RCRn */ /* @@@ handle RCRn */
} }
return IRQ_RETVAL(handled);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment