Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6bd3bd6794d4139aa1b5193a82e3adfcb488c392
Commit:     6bd3bd6794d4139aa1b5193a82e3adfcb488c392
Parent:     f3518e4ee70916e6bd43c8082e02f0dd1e19d7af
Author:     Jeff Garzik <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 15:38:40 2007 -0400
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Oct 23 19:53:16 2007 -0400

    drivers/char/ip2: separate polling and irq-driven work entry points
    
    Polling currently calls the irq handler, which loops through all the
    boards, calling the work function for all polling boards with work.
    
    irq handling loops through all the boards, finding the specific board
    that applies to us, and calling the work just for that one board.
    
    The two logics are sufficiently different to warrant different
    functions, rather than being slack and calling the same function in two
    different ways.
    
    This serves to make the interrupt handler a -lot- more efficient.
    
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/char/ip2/ip2main.c |   27 ++++++++++++++++++++-------
 1 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/char/ip2/ip2main.c b/drivers/char/ip2/ip2main.c
index 150e1e3..e04e66c 100644
--- a/drivers/char/ip2/ip2main.c
+++ b/drivers/char/ip2/ip2main.c
@@ -752,7 +752,7 @@ retry:
                                        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;
@@ -1191,12 +1191,12 @@ ip2_irq_work(i2eBordStrPtr pB)
 #endif /* USE_IQI */
 }
 
-static irqreturn_t
-ip2_interrupt(int irq, void *dev_id)
+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 );
 
@@ -1208,7 +1208,6 @@ 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;
                        ip2_irq_work(pB);
                }
        }
@@ -1216,7 +1215,21 @@ ip2_interrupt(int irq, void *dev_id)
        ++irq_counter;
 
        ip2trace (ITRC_NO_PORT, ITRC_INTR, ITRC_RETURN, 0 );
-       return IRQ_RETVAL(handled);
+}
+
+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_HANDLED;
 }
 
 
/******************************************************************************/
@@ -1239,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 );
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to