Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193995
b: refs/heads/master
c: b0cf4df
h: refs/heads/master
i:
  193993: 5551276
  193991: 65c7b41
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Apr 8, 2010
1 parent f5d1bd3 commit 42383fa
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e31d5a05948e4478ba8396063d1e1f39880928e2
refs/heads/master: b0cf4dfb7cd21556efd9a6a67edcba0840b4d98d
42 changes: 30 additions & 12 deletions trunk/drivers/net/3c503.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,12 @@ el2_probe1(struct net_device *dev, int ioaddr)
return retval;
}

static irqreturn_t el2_probe_interrupt(int irq, void *seen)
{
*(bool *)seen = true;
return IRQ_HANDLED;
}

static int
el2_open(struct net_device *dev)
{
Expand All @@ -391,23 +397,35 @@ el2_open(struct net_device *dev)

outb(EGACFR_NORM, E33G_GACFR); /* Enable RAM and interrupts. */
do {
retval = request_irq(*irqp, NULL, 0, "bogus", dev);
if (retval >= 0) {
bool seen;

retval = request_irq(*irqp, el2_probe_interrupt, 0,
dev->name, &seen);
if (retval == -EBUSY)
continue;
if (retval < 0)
goto err_disable;

/* Twinkle the interrupt, and check if it's seen. */
unsigned long cookie = probe_irq_on();
seen = false;
smp_wmb();
outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
outb_p(0x00, E33G_IDCFR);
if (*irqp == probe_irq_off(cookie) && /* It's a good IRQ line! */
((retval = request_irq(dev->irq = *irqp,
eip_interrupt, 0,
dev->name, dev)) == 0))
break;
} else {
if (retval != -EBUSY)
return retval;
}
msleep(1);
free_irq(*irqp, el2_probe_interrupt);
if (!seen)
continue;

retval = request_irq(dev->irq = *irqp, eip_interrupt, 0,
dev->name, dev);
if (retval == -EBUSY)
continue;
if (retval < 0)
goto err_disable;
} while (*++irqp);

if (*irqp == 0) {
err_disable:
outb(EGACFR_IRQOFF, E33G_GACFR); /* disable interrupts. */
return -EAGAIN;
}
Expand Down

0 comments on commit 42383fa

Please sign in to comment.