[patch 1/3] natsemi: Consistently use interrupt enable/disable functions

From: broonie
Date: Wed Mar 14 2007 - 16:09:29 EST


The natsemi drivers include functions for enabling and disabling
interrupts from the chip but these are not used in all code paths. This
patch changes the code paths that touch the interrupt enable register to
use the functions. In all cases this adds an extra PCI read to post the
operation but since none of these are in fast paths this shouldn't be
too much of a problem.

Signed-Off-By: Mark Brown <broonie@xxxxxxxxxxxxx>
Index: linux-2.6/drivers/net/natsemi.c
===================================================================
--- linux-2.6.orig/drivers/net/natsemi.c 2007-03-11 02:27:34.000000000 +0000
+++ linux-2.6/drivers/net/natsemi.c 2007-03-11 02:32:43.000000000 +0000
@@ -1712,7 +1712,7 @@

/* Enable interrupts by setting the interrupt mask. */
writel(DEFAULT_INTR, ioaddr + IntrMask);
- writel(1, ioaddr + IntrEnable);
+ natsemi_irq_enable(dev);

writel(RxOn | TxOn, ioaddr + ChipCmd);
writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */
@@ -3071,7 +3071,7 @@
* Could be used to send a netlink message.
*/
writel(WOLPkt | LinkChange, ioaddr + IntrMask);
- writel(1, ioaddr + IntrEnable);
+ natsemi_irq_enable(dev);
}
}

@@ -3202,7 +3202,7 @@
disable_irq(dev->irq);
spin_lock_irq(&np->lock);

- writel(0, ioaddr + IntrEnable);
+ natsemi_irq_disable(dev);
np->hands_off = 1;
natsemi_stop_rxtx(dev);
netif_stop_queue(dev);

--
"You grabbed my hand and we fell into it, like a daydream - or a fever."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/