[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] m68k: Atari EtherNEC fixes


- EtherNEC hangs with interrupts from stopped card - ethernec needs to be
built as a module, not compiled in for the time being. I've tried to fix
this in the driver, but no success so far.


Okay that's queued for 2.6.26-7. I'm going to try to build that soon for
the dailies and because it will require a d-i change. So this might take
a bit yet.

NP, I will try a few more things to make ethernec behave better (right now you have to use module arguments to set the base address, unnecessarily.

I finally found out why the driver was even getting interrupt delivered. Turns out I did not use a wrapper for ei_interrupt in the usual case ... now where did my brown paper bag go?

Patch attached; this goes on top of 2.6.26-m68k (i.e. with the current EtherNEC
patch applied). Should apply to Geert's tree with minimum fuss.

The driver loads as module without need of parameters now. It should also load normally when compiled in (we'll see that in the next d-i iteration, won't we?).


(who hasn't forgotten about the various driver cleanups promised; it's been a tad busy lately)
 Use wrapper around ei_interrupt to prevent delivery of (timer!) interrupts before card 
 is opened.

 Limit IO addresses to 0x300 (this is hardwired on the bus adapter anyway, and the card 
 needs to be programmed to use that IO in some way before the adapter can work). 

 Preset io=0x300 for module use.
 Signed-off-by: Michael Schmitz <schmitz@debian.org>

 atari_ethernec.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

--- linux-2.6.26-geert/drivers/net/atari_ethernec.c	2008-07-18 01:21:51.000000000 +0200
+++ linux-2.6.26-ms/drivers/net/atari_ethernec.c	2008-09-27 05:42:37.000000000 +0200
@@ -124,7 +124,7 @@
 /* A zero-terminated list of I/O addresses to be probed at boot. */
 #ifndef MODULE
 static unsigned int netcard_portlist[] __initdata = {
-	0x300, 0x280, 0x320, 0x340, 0x360, 0x380, 0
+	0x300, 0
@@ -227,6 +227,14 @@
 static struct net_device *poll_dev = NULL;
+irqreturn_t atari_ei_interrupt(int irq, void *dev_id)
+	struct net_device *dev = dev_id;
+	if (netif_running(dev))
+		return ei_interrupt(dev->irq, dev);
+	return IRQ_NONE;
 static void atari_ethernec_int(struct work_struct *work)
 	struct net_device *dev = poll_dev;
@@ -619,7 +627,7 @@
 			mfp.tim_ct_cd = (mfp.tim_ct_cd & 0xf0) | 0x6;
 		/* Must make this shared in case other timer ints are needed */
-		ret = request_irq(dev->irq, ei_interrupt, IRQF_SHARED, name, dev);
+		ret = request_irq(dev->irq, atari_ei_interrupt, IRQF_SHARED, name, dev);
 		if (ret) {
 			printk(" unable to get IRQ %d (errno=%d), polling instead.\n",
 			       dev->irq, ret);
@@ -941,9 +949,9 @@
 #ifdef MODULE
-#define MAX_NE_CARDS	4	/* Max number of NE cards per module */
+#define MAX_NE_CARDS	1	/* Max number of NE cards per module */
 static struct net_device *dev_ne[MAX_NE_CARDS];
-static int io[MAX_NE_CARDS];
+static int io[MAX_NE_CARDS] = { 0x300 };
 static int irq[MAX_NE_CARDS];
 static int bad[MAX_NE_CARDS];	/* 0xbad = bad sig or no reset ack */

Reply to: