public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: ktech@wanadoo.es
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org, jgarzik@pobox.com
Subject: Re: 2.6.7-rc1 breaks forcedeth
Date: Sun, 06 Jun 2004 16:17:20 +0200	[thread overview]
Message-ID: <40C32770.8070704@colorfullife.com> (raw)
In-Reply-To: <E1BWwTR-0003d0-I6@mb07.in.mad.eresmas.com>

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

ktech@wanadoo.es wrote:

>forcedeth: irq line 11, Status 0x       4, Mask 08x
>
>  
>
I can't type: The formatting rule for printk was wrong. I've attached an 
updated patch.

I have two ideas:
- try the attached patch. It won't fix your problem, but it might give 
us further hints.
- is it possible to disable on-board devices in the bios? I'd go back to 
2.6.7-rc1 (i.e. without my debug patches) and try a few combinations. 
Does usb work if ethernet is disabled? ethernet if usb is disabled? Does 
the board support network boot? What happens if you disable network boot 
(PXE)?

--
    Manfred

[-- Attachment #2: patch-forcedeth-test --]
[-- Type: text/plain, Size: 2926 bytes --]

--- 2.6/drivers/net/forcedeth.c	2004-05-10 04:31:59.000000000 +0200
+++ build-2.6/drivers/net/forcedeth.c	2004-06-06 16:09:42.960783872 +0200
@@ -1126,6 +1126,15 @@
 		writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
 		pci_push(base);
 		dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, events);
+
+printk(KERN_ERR "forcedeth %s: got irq Status 0x%08x, Mask 0x%08x\n",
+				dev->name, readl(base + NvRegIrqStatus),
+				readl(base + NvRegIrqMask));
+		if (np->in_shutdown) {
+printk(KERN_ERR "forcedeth: irq while not running.\n");
+			break;
+		}
+
 		if (!(events & np->irqmask))
 			break;
 
@@ -1195,16 +1204,13 @@
 	enable_irq(dev->irq);
 }
 
-static int nv_open(struct net_device *dev)
+static void nv_reset(struct net_device *dev)
 {
-	struct fe_priv *np = get_nvpriv(dev);
 	u8 *base = get_hwbase(dev);
-	int ret, oom, i;
 
-	dprintk(KERN_DEBUG "nv_open: begin\n");
+	writel(0, base + NvRegIrqMask);
+	writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
 
-	/* 1) erase previous misconfiguration */
-	/* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */
 	writel(NVREG_MCASTADDRA_FORCE, base + NvRegMulticastAddrA);
 	writel(0, base + NvRegMulticastAddrB);
 	writel(0, base + NvRegMulticastMaskA);
@@ -1215,9 +1221,22 @@
 	writel(0, base + NvRegUnknownTransmitterReg);
 	nv_txrx_reset(dev);
 	writel(0, base + NvRegUnknownSetupReg6);
+	pci_push(base);
+}
+
+static int nv_open(struct net_device *dev)
+{
+	struct fe_priv *np = get_nvpriv(dev);
+	u8 *base = get_hwbase(dev);
+	int ret, oom, i;
+
+	dprintk(KERN_DEBUG "nv_open: begin\n");
+
+	/* 1) erase previous misconfiguration */
+	/* 4.1-1: stop adapter: ignored, 4.3 seems to be overkill */
+	nv_reset(dev);
 
 	/* 2) initialize descriptor rings */
-	np->in_shutdown = 0;
 	oom = nv_init_ring(dev);
 
 	/* 3) set mac address */
@@ -1319,10 +1338,7 @@
 	writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
 	pci_push(base);
 
-	ret = request_irq(dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev);
-	if (ret)
-		goto out_drain;
-
+	np->in_shutdown = 0;
 	writel(np->irqmask, base + NvRegIrqMask);
 
 	spin_lock_irq(&np->lock);
@@ -1506,6 +1522,11 @@
 	writel(0, base + NvRegWakeUpFlags);
 	np->wolenabled = 0;
 
+printk(KERN_ERR "forcedeth: irq line %d, Status 0x%08x, Mask 0x%08x\n",
+		       		pci_dev->irq, readl(base + NvRegIrqStatus),
+				readl(base + NvRegIrqMask));
+	nv_reset(dev);
+
 	np->tx_flags = cpu_to_le16(NV_TX_LASTPACKET|NV_TX_LASTPACKET1|NV_TX_VALID);
 	if (id->driver_data & DEV_NEED_LASTPACKET1)
 		np->tx_flags |= cpu_to_le16(NV_TX_LASTPACKET1);
@@ -1516,6 +1537,12 @@
 	if (id->driver_data & DEV_NEED_TIMERIRQ)
 		np->irqmask |= NVREG_IRQ_TIMER;
 
+	np->in_shutdown = 1;
+	err = request_irq(dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev);
+	if (err) {
+printk(KERN_ERR "forcedeth: Duh. request_irq failed.\n");
+	}
+
 	err = register_netdev(dev);
 	if (err) {
 		printk(KERN_INFO "forcedeth: unable to register netdev: %d\n", err);

  parent reply	other threads:[~2004-06-06 14:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-06 12:10 Re: 2.6.7-rc1 breaks forcedeth ktech
2004-06-06 12:53 ` Vincent van de Camp
2004-06-06 13:40   ` Manfred Spraul
2004-06-06 14:17 ` Manfred Spraul [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-06-16 18:40 David Mansfield
2004-06-06 13:49 jjluza
     [not found] <E1BWxTh-0002dx-KR@mb06.in.mad.eresmas.com>
2004-06-06 13:31 ` Daniel Schmitt
2004-06-06  1:59 ktech
2004-06-06  3:14 ` Linus Torvalds
2004-06-06  8:36   ` Manfred Spraul
2004-06-06 17:04     ` Linus Torvalds
2004-06-06 18:13       ` Jeff Garzik
2004-06-06 18:21   ` Jeff Garzik
2004-06-06 18:32     ` Linus Torvalds
2004-06-05 23:41 Luis Miguel García Mancebo
2004-06-05 23:50 ` Linus Torvalds
2004-05-31  0:29 jjluza
2004-05-30 17:54 Luis Miguel García Mancebo
2004-05-30 20:47 ` Jeff Garzik
2004-05-30 15:57 Lee Howard
2004-05-30 17:20 ` Jeff Garzik
2004-05-30 22:59   ` Lee Howard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40C32770.8070704@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=jgarzik@pobox.com \
    --cc=ktech@wanadoo.es \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox