Commit 25c26354 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'irq-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6

* 'irq-upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  [SPARC, XEN, NET/CXGB3] use irq_handler_t where appropriate
  drivers/char/riscom8: clean up irq handling
  isdn/sc: irq handler clean
  isdn/act2000: fix major bug. clean irq handler.
  char/pcmcia/synclink_cs: trim trailing whitespace
  drivers/char/ip2: separate polling and irq-driven work entry points
  drivers/char/ip2: split out irq core logic into separate function
  [NETDRVR] lib82596, netxen: delete pointless tests from irq handler
  Eliminate pointless casts from void* in a few driver irq handlers.
  [PARPORT] Remove unused 'irq' argument from parport irq functions
  [PARPORT] Kill useful 'irq' arg from parport_{generic_irq,ieee1284_interrupt}
  [PARPORT] Consolidate code copies into a single generic irq handler
parents d8581969 7c239975
......@@ -479,7 +479,7 @@ EXPORT_SYMBOL(pdma_areasize);
extern void floppy_hardint(void);
static irqreturn_t (*floppy_irq_handler)(int irq, void *dev_id);
static irq_handler_t floppy_irq_handler;
void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
{
......@@ -500,7 +500,7 @@ void sparc_floppy_irq(int irq, void *dev_id, struct pt_regs *regs)
}
int sparc_floppy_request_irq(int irq, unsigned long flags,
irqreturn_t (*irq_handler)(int irq, void *))
irq_handler_t irq_handler)
{
floppy_irq_handler = irq_handler;
return request_fast_irq(irq, floppy_hardint, flags, "floppy");
......
......@@ -383,7 +383,7 @@ static void unbind_from_irq(unsigned int irq)
}
int bind_evtchn_to_irqhandler(unsigned int evtchn,
irqreturn_t (*handler)(int, void *),
irq_handler_t handler,
unsigned long irqflags,
const char *devname, void *dev_id)
{
......@@ -402,7 +402,7 @@ int bind_evtchn_to_irqhandler(unsigned int evtchn,
EXPORT_SYMBOL_GPL(bind_evtchn_to_irqhandler);
int bind_virq_to_irqhandler(unsigned int virq, unsigned int cpu,
irqreturn_t (*handler)(int, void *),
irq_handler_t handler,
unsigned long irqflags, const char *devname, void *dev_id)
{
unsigned int irq;
......
......@@ -1382,8 +1382,9 @@ static inline void rx_data_av_handler (hrz_dev * dev) {
/********** interrupt handler **********/
static irqreturn_t interrupt_handler(int irq, void *dev_id) {
hrz_dev * dev = (hrz_dev *) dev_id;
static irqreturn_t interrupt_handler(int irq, void *dev_id)
{
hrz_dev *dev = dev_id;
u32 int_source;
unsigned int irq_ok;
......
......@@ -752,7 +752,7 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
continue;
rc = request_irq( ip2config.irq[i], ip2_interrupt,
IP2_SA_FLAGS | (ip2config.type[i] == PCI ? IRQF_SHARED : 0),
pcName, (void *)&pcName);
pcName, i2BoardPtrTable[i]);
if (rc) {
printk(KERN_ERR "IP2: an request_irq failed: error %d\n",rc);
ip2config.irq[i] = CIR_POLL;
......@@ -1166,12 +1166,37 @@ ip2_interrupt_bh(struct work_struct *work)
/* */
/* */
/******************************************************************************/
static irqreturn_t
ip2_interrupt(int irq, void *dev_id)
static void
ip2_irq_work(i2eBordStrPtr pB)
{
#ifdef USE_IQI
if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
// Disable his interrupt (will be enabled when serviced)
// This is mostly to protect from reentrancy.
iiDisableMailIrq(pB);
// Park the board on the immediate queue for processing.
schedule_work(&pB->tqueue_interrupt);
// Make sure the immediate queue is flagged to fire.
}
#else
// We are using immediate servicing here. This sucks and can
// cause all sorts of havoc with ppp and others. The failsafe
// check on iiSendPendingMail could also throw a hairball.
i2ServiceBoard( pB );
#endif /* USE_IQI */
}
static void
ip2_polled_interrupt(void)
{
int i;
i2eBordStrPtr pB;
int handled = 0;
const int irq = 0;
ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, irq );
......@@ -1183,32 +1208,28 @@ ip2_interrupt(int irq, void *dev_id)
// IRQ = 0 for polled boards, we won't poll "IRQ" boards
if ( pB && (pB->i2eUsingIrq == irq) ) {
handled = 1;
#ifdef USE_IQI
ip2_irq_work(pB);
}
}
if (NO_MAIL_HERE != ( pB->i2eStartMail = iiGetMail(pB))) {
// Disable his interrupt (will be enabled when serviced)
// This is mostly to protect from reentrancy.
iiDisableMailIrq(pB);
++irq_counter;
// Park the board on the immediate queue for processing.
schedule_work(&pB->tqueue_interrupt);
ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
}
// Make sure the immediate queue is flagged to fire.
}
#else
// We are using immediate servicing here. This sucks and can
// cause all sorts of havoc with ppp and others. The failsafe
// check on iiSendPendingMail could also throw a hairball.
i2ServiceBoard( pB );
#endif /* USE_IQI */
}
}
static irqreturn_t
ip2_interrupt(int irq, void *dev_id)
{
i2eBordStrPtr pB = dev_id;
ip2trace (ITRC_NO_PORT, ITRC_INTR, 99, 1, pB->i2eUsingIrq );
ip2_irq_work(pB);
++irq_counter;
ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
return IRQ_RETVAL(handled);
return IRQ_HANDLED;
}
/******************************************************************************/
......@@ -1231,7 +1252,7 @@ ip2_poll(unsigned long arg)
// Just polled boards, IRQ = 0 will hit all non-interrupt boards.
// It will NOT poll boards handled by hard interrupts.
// The issue of queued BH interrups is handled in ip2_interrupt().
ip2_interrupt(0, NULL);
ip2_polled_interrupt();
PollTimer.expires = POLL_TIMEOUT;
add_timer( &PollTimer );
......
This diff is collapsed.
......@@ -267,9 +267,9 @@ static ssize_t pp_write (struct file * file, const char __user * buf,
return bytes_written;
}
static void pp_irq (int irq, void * private)
static void pp_irq (void *private)
{
struct pp_struct * pp = (struct pp_struct *) private;
struct pp_struct *pp = private;
if (pp->irqresponse) {
parport_write_control (pp->pdev->port, pp->irqctl);
......
......@@ -79,7 +79,6 @@
#define RS_EVENT_WRITE_WAKEUP 0
static struct riscom_board * IRQ_to_board[16];
static struct tty_driver *riscom_driver;
static struct riscom_board rc_board[RC_NBOARD] = {
......@@ -537,16 +536,14 @@ static inline void rc_check_modem(struct riscom_board const * bp)
}
/* The main interrupt processing routine */
static irqreturn_t rc_interrupt(int irq, void * dev_id)
static irqreturn_t rc_interrupt(int dummy, void * dev_id)
{
unsigned char status;
unsigned char ack;
struct riscom_board *bp;
struct riscom_board *bp = dev_id;
unsigned long loop = 0;
int handled = 0;
bp = IRQ_to_board[irq];
if (!(bp->flags & RC_BOARD_ACTIVE))
return IRQ_NONE;
......@@ -603,7 +600,7 @@ static irqreturn_t rc_interrupt(int irq, void * dev_id)
*/
/* Called with disabled interrupts */
static inline int rc_setup_board(struct riscom_board * bp)
static int rc_setup_board(struct riscom_board * bp)
{
int error;
......@@ -611,7 +608,7 @@ static inline int rc_setup_board(struct riscom_board * bp)
return 0;
error = request_irq(bp->irq, rc_interrupt, IRQF_DISABLED,
"RISCom/8", NULL);
"RISCom/8", bp);
if (error)
return error;
......@@ -619,14 +616,13 @@ static inline int rc_setup_board(struct riscom_board * bp)
bp->DTR = ~0;
rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */
IRQ_to_board[bp->irq] = bp;
bp->flags |= RC_BOARD_ACTIVE;
return 0;
}
/* Called with disabled interrupts */
static inline void rc_shutdown_board(struct riscom_board *bp)
static void rc_shutdown_board(struct riscom_board *bp)
{
if (!(bp->flags & RC_BOARD_ACTIVE))
return;
......@@ -634,7 +630,6 @@ static inline void rc_shutdown_board(struct riscom_board *bp)
bp->flags &= ~RC_BOARD_ACTIVE;
free_irq(bp->irq, NULL);
IRQ_to_board[bp->irq] = NULL;
bp->DTR = ~0;
rc_out(bp, RC_DTR, bp->DTR); /* Drop DTR on all ports */
......@@ -1594,7 +1589,6 @@ static inline int rc_init_drivers(void)
if (!riscom_driver)
return -ENOMEM;
memset(IRQ_to_board, 0, sizeof(IRQ_to_board));
riscom_driver->owner = THIS_MODULE;
riscom_driver->name = "ttyL";
riscom_driver->major = RISCOM8_NORMAL_MAJOR;
......
......@@ -381,7 +381,7 @@ static struct tpm_vendor_specific tpm_tis = {
static irqreturn_t tis_int_probe(int irq, void *dev_id)
{
struct tpm_chip *chip = (struct tpm_chip *) dev_id;
struct tpm_chip *chip = dev_id;
u32 interrupt;
interrupt = ioread32(chip->vendor.iobase +
......@@ -401,7 +401,7 @@ static irqreturn_t tis_int_probe(int irq, void *dev_id)
static irqreturn_t tis_int_handler(int irq, void *dev_id)
{
struct tpm_chip *chip = (struct tpm_chip *) dev_id;
struct tpm_chip *chip = dev_id;
u32 interrupt;
int i;
......
......@@ -102,7 +102,7 @@ static int parkbd_write(struct serio *port, unsigned char c)
return 0;
}
static void parkbd_interrupt(int irq, void *dev_id)
static void parkbd_interrupt(void *dev_id)
{
if (parkbd_writing) {
......
......@@ -61,7 +61,7 @@ act2000_isa_detect(unsigned short portbase)
}
static irqreturn_t
act2000_isa_interrupt(int irq, void *dev_id)
act2000_isa_interrupt(int dummy, void *dev_id)
{
act2000_card *card = dev_id;
u_char istatus;
......@@ -80,7 +80,7 @@ act2000_isa_interrupt(int irq, void *dev_id)
printk(KERN_WARNING "act2000: errIRQ\n");
}
if (istatus)
printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", irq, istatus);
printk(KERN_DEBUG "act2000: ?IRQ %d %02x\n", card->irq, istatus);
return IRQ_HANDLED;
}
......@@ -131,6 +131,8 @@ act2000_isa_enable_irq(act2000_card * card)
int
act2000_isa_config_irq(act2000_card * card, short irq)
{
int old_irq;
if (card->flags & ACT2000_FLAGS_IVALID) {
free_irq(card->irq, card);
}
......@@ -139,8 +141,10 @@ act2000_isa_config_irq(act2000_card * card, short irq)
if (!irq)
return 0;
if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
card->irq = irq;
old_irq = card->irq;
card->irq = irq;
if (request_irq(irq, &act2000_isa_interrupt, 0, card->regname, card)) {
card->irq = old_irq;
card->flags |= ACT2000_FLAGS_IVALID;
printk(KERN_WARNING
"act2000: Could not request irq %d\n",irq);
......
......@@ -334,7 +334,8 @@ static int __init sc_init(void)
*/
sc_adapter[cinst]->interrupt = irq[b];
if (request_irq(sc_adapter[cinst]->interrupt, interrupt_handler,
IRQF_DISABLED, interface->id, NULL))
IRQF_DISABLED, interface->id,
(void *)(unsigned long) cinst))
{
kfree(sc_adapter[cinst]->channel);
indicate_status(cinst, ISDN_STAT_UNLOAD, 0, NULL); /* Fix me */
......
......@@ -21,28 +21,15 @@
#include "card.h"
#include <linux/interrupt.h>
static int get_card_from_irq(int irq)
{
int i;
for(i = 0 ; i < cinst ; i++) {
if(sc_adapter[i]->interrupt == irq)
return i;
}
return -1;
}
/*
*
*/
irqreturn_t interrupt_handler(int interrupt, void *cardptr)
irqreturn_t interrupt_handler(int dummy, void *card_inst)
{
RspMessage rcvmsg;
int channel;
int card;
card = get_card_from_irq(interrupt);
int card = (int)(unsigned long) card_inst;
if(!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
......
......@@ -359,7 +359,7 @@ static int onenand_wait(struct mtd_info *mtd, int state)
*/
static irqreturn_t onenand_interrupt(int irq, void *data)
{
struct onenand_chip *this = (struct onenand_chip *) data;
struct onenand_chip *this = data;
/* To handle shared interrupt */
if (!this->complete.done)
......
......@@ -46,8 +46,6 @@
#include <asm/semaphore.h>
#include <asm/io.h>
typedef irqreturn_t(*intr_handler_t) (int, void *);
struct vlan_group;
struct adapter;
struct sge_qset;
......@@ -270,7 +268,7 @@ void t3_sge_start(struct adapter *adap);
void t3_sge_stop(struct adapter *adap);
void t3_free_sge_resources(struct adapter *adap);
void t3_sge_err_intr_handler(struct adapter *adapter);
intr_handler_t t3_intr_handler(struct adapter *adap, int polling);
irq_handler_t t3_intr_handler(struct adapter *adap, int polling);
int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev);
int t3_mgmt_tx(struct adapter *adap, struct sk_buff *skb);
void t3_update_qset_coalesce(struct sge_qset *qs, const struct qset_params *p);
......
......@@ -2431,7 +2431,7 @@ static irqreturn_t t3b_intr_napi(int irq, void *cookie)
* (MSI-X, MSI, or legacy) and whether NAPI will be used to service the
* response queues.
*/
intr_handler_t t3_intr_handler(struct adapter *adap, int polling)
irq_handler_t t3_intr_handler(struct adapter *adap, int polling)
{
if (adap->flags & USING_MSIX)
return polling ? t3_sge_intr_msix_napi : t3_sge_intr_msix;
......
......@@ -325,12 +325,6 @@ static int eppconfig(struct baycom_state *bc)
/* ---------------------------------------------------------------------- */
static void epp_interrupt(int irq, void *dev_id)
{
}
/* ---------------------------------------------------------------------- */
static inline void do_kiss_params(struct baycom_state *bc,
unsigned char *data, unsigned long len)
{
......@@ -871,7 +865,7 @@ static int epp_open(struct net_device *dev)
}
memset(&bc->modem, 0, sizeof(bc->modem));
bc->pdev = parport_register_device(pp, dev->name, NULL, epp_wakeup,
epp_interrupt, PARPORT_DEV_EXCL, dev);
NULL, PARPORT_DEV_EXCL, dev);
parport_put_port(pp);
if (!bc->pdev) {
printk(KERN_ERR "%s: cannot register parport at 0x%lx\n", bc_drvname, pp->base);
......
......@@ -270,9 +270,9 @@ static __inline__ void par96_rx(struct net_device *dev, struct baycom_state *bc)
/* --------------------------------------------------------------------- */
static void par96_interrupt(int irq, void *dev_id)
static void par96_interrupt(void *dev_id)
{
struct net_device *dev = (struct net_device *)dev_id;
struct net_device *dev = dev_id;
struct baycom_state *bc = netdev_priv(dev);
baycom_int_freq(bc);
......
......@@ -1124,12 +1124,6 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id)
struct i596_dma *dma;
unsigned short status, ack_cmd = 0;
if (dev == NULL) {
printk(KERN_WARNING "%s: irq %d for unknown device.\n",
__FUNCTION__, irq);
return IRQ_NONE;
}
lp = netdev_priv(dev);
dma = lp->dma;
......@@ -1140,7 +1134,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id)
DEB(DEB_INTS, printk(KERN_DEBUG
"%s: i596 interrupt, IRQ %d, status %4.4x.\n",
dev->name, irq, status));
dev->name, dev->irq, status));
ack_cmd = status & 0xf000;
......
......@@ -1268,17 +1268,10 @@ netxen_handle_int(struct netxen_adapter *adapter, struct net_device *netdev)
*/
irqreturn_t netxen_intr(int irq, void *data)
{
struct netxen_adapter *adapter;
struct net_device *netdev;
struct netxen_adapter *adapter = data;
struct net_device *netdev = adapter->netdev;
u32 our_int = 0;
if (unlikely(!irq)) {
return IRQ_NONE; /* Not our interrupt */
}
adapter = (struct netxen_adapter *)data;
netdev = adapter->netdev;
if (!(adapter->flags & NETXEN_NIC_MSI_ENABLED)) {
our_int = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_INT_VECTOR));
/* not our interrupt */
......
......@@ -143,7 +143,7 @@ static void plip_bh(struct work_struct *work);
static void plip_timer_bh(struct work_struct *work);
/* Interrupt handler */
static void plip_interrupt(int irq, void *dev_id);
static void plip_interrupt(void *dev_id);
/* Functions for DEV methods */
static int plip_tx_packet(struct sk_buff *skb, struct net_device *dev);
......@@ -380,7 +380,7 @@ plip_timer_bh(struct work_struct *work)
container_of(work, struct net_local, timer.work);
if (!(atomic_read (&nl->kill_timer))) {
plip_interrupt (-1, nl->dev);
plip_interrupt (nl->dev);
schedule_delayed_work(&nl->timer, 1);
}
......@@ -897,7 +897,7 @@ plip_error(struct net_device *dev, struct net_local *nl,
/* Handle the parallel port interrupts. */
static void
plip_interrupt(int irq, void *dev_id)
plip_interrupt(void *dev_id)
{
struct net_device *dev = dev_id;
struct net_local *nl;
......
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