aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mxser_new.c
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-02-10 04:45:19 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:29 -0500
commit18b95576bc6b9ef9270ec778e1d545c0ca8bbbbb (patch)
tree5d7e9555f8cb5123037630825a50e4ece606024e /drivers/char/mxser_new.c
parented79ba12e981538a399012f226360db635b50570 (diff)
[PATCH] Char: mxser_new, less loops in isr
Loop only 100^2 times, not 99999^2 times in isr (at most). Signed-off-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/mxser_new.c')
-rw-r--r--drivers/char/mxser_new.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/char/mxser_new.c b/drivers/char/mxser_new.c
index 945c7e1b4c3..042d1381ff6 100644
--- a/drivers/char/mxser_new.c
+++ b/drivers/char/mxser_new.c
@@ -56,7 +56,7 @@
56#define MXSER_BOARDS 4 /* Max. boards */ 56#define MXSER_BOARDS 4 /* Max. boards */
57#define MXSER_PORTS_PER_BOARD 8 /* Max. ports per board */ 57#define MXSER_PORTS_PER_BOARD 8 /* Max. ports per board */
58#define MXSER_PORTS (MXSER_BOARDS * MXSER_PORTS_PER_BOARD) 58#define MXSER_PORTS (MXSER_BOARDS * MXSER_PORTS_PER_BOARD)
59#define MXSER_ISR_PASS_LIMIT 99999L 59#define MXSER_ISR_PASS_LIMIT 100
60 60
61#define MXSER_ERR_IOADDR -1 61#define MXSER_ERR_IOADDR -1
62#define MXSER_ERR_IRQ -2 62#define MXSER_ERR_IRQ -2
@@ -2222,8 +2222,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id)
2222 struct mxser_board *brd = NULL; 2222 struct mxser_board *brd = NULL;
2223 struct mxser_port *port; 2223 struct mxser_port *port;
2224 int max, irqbits, bits, msr; 2224 int max, irqbits, bits, msr;
2225 int pass_counter = 0; 2225 unsigned int int_cnt, pass_counter = 0;
2226 unsigned int int_cnt;
2227 int handled = IRQ_NONE; 2226 int handled = IRQ_NONE;
2228 2227
2229 for (i = 0; i < MXSER_BOARDS; i++) 2228 for (i = 0; i < MXSER_BOARDS; i++)
@@ -2237,7 +2236,7 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id)
2237 if (brd == NULL) 2236 if (brd == NULL)
2238 goto irq_stop; 2237 goto irq_stop;
2239 max = brd->info->nports; 2238 max = brd->info->nports;
2240 while (1) { 2239 while (pass_counter++ < MXSER_ISR_PASS_LIMIT) {
2241 irqbits = inb(brd->vector) & brd->vector_mask; 2240 irqbits = inb(brd->vector) & brd->vector_mask;
2242 if (irqbits == brd->vector_mask) 2241 if (irqbits == brd->vector_mask)
2243 break; 2242 break;
@@ -2308,8 +2307,6 @@ static irqreturn_t mxser_interrupt(int irq, void *dev_id)
2308 } while (int_cnt++ < MXSER_ISR_PASS_LIMIT); 2307 } while (int_cnt++ < MXSER_ISR_PASS_LIMIT);
2309 spin_unlock(&port->slock); 2308 spin_unlock(&port->slock);
2310 } 2309 }
2311 if (pass_counter++ > MXSER_ISR_PASS_LIMIT)
2312 break; /* Prevent infinite loops */
2313 } 2310 }
2314 2311
2315irq_stop: 2312irq_stop: