Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Martin Gebert <martin.gebert@alpha-bit.de>
To: linux-mips@linux-mips.org
Subject: Patch spinlock initialisation au1000_eth.c
Date: Fri, 27 Jun 2008 11:22:02 +0200	[thread overview]
Message-ID: <4864B13A.2030702@alpha-bit.de> (raw)

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

Hi all!

While debugging spinlocks I came across a message from the kernel 
indicating a problem in the AU1x00 ethernet driver. Seems like the 
spinlock for the device is initialised too late, as it is already used 
in enable_mac(), which is called via mii_probe() before the init takes 
place. The attached patch is working here for a Linux Au1100 
2.6.22.6-Rev504 kernel, and as far as I checked should also be 
applicable to the current head (line numbers differ).
Comments welcome; I'm quite new to kernel hacking :-)

Martin

Martin Gebert
alpha-bit Gesellschaft für software-engineering mbH
Karl-Zucker-Str. 1a
D-91052 Erlangen
mailto:martin.gebert@alpha-bit.de
Fon:    +49 (9131) 97799-24
Fax:    +49 (9131) 97799-28

Handelsregister Fürth HRB 3159
Geschäftsführer Dipl.-Ing. Lothar Müller, Evi Reiß



[-- Attachment #2: OFSP6-kernel-2.6.22-Eth.patch --]
[-- Type: text/x-patch, Size: 597 bytes --]

--- drivers/net/au1000_eth.c.orig	2008-06-26 14:21:53.000000000 +0200
+++ drivers/net/au1000_eth.c	2008-06-26 14:23:00.000000000 +0200
# The following spinlock needs to be initialized earlier, as it is already used
# in enable_mac(), called via mii_probe()
@@ -656,6 +656,7 @@
 		dev->name, base, irq);
 
 	aup = dev->priv;
+	spin_lock_init(&aup->lock);
 
 	/* Allocate the data buffers */
 	/* Snooping works fine with eth on all au1xxx */
@@ -766,7 +767,6 @@
 		aup->tx_db_inuse[i] = pDB;
 	}
 
-	spin_lock_init(&aup->lock);
 	dev->base_addr = base;
 	dev->irq = irq;
 	dev->open = au1000_open;

                 reply	other threads:[~2008-06-27  9:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4864B13A.2030702@alpha-bit.de \
    --to=martin.gebert@alpha-bit.de \
    --cc=linux-mips@linux-mips.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