From: Jarek Poplawski <jarkao2@o2.pl>
To: Thibaut VARENE <T-Bone@parisc-linux.org>
Cc: Dale Farnsworth <dale@farnsworth.org>,
netdev@vger.kernel.org, mlachwani@mvista.com
Subject: [PATCH] Re: kernel BUG in eth_alloc_tx_desc_index at drivers/net/mv643xx_eth.c:1069!
Date: Thu, 11 Jan 2007 11:42:20 +0100 [thread overview]
Message-ID: <20070111104220.GA3171@ff.dom.local> (raw)
In-Reply-To: <7d01f9f00701100912kc6fb635wd863d9563b0eb328@mail.gmail.com>
On Wed, Jan 10, 2007 at 06:12:29PM +0100, Thibaut VARENE wrote:
> On 1/9/07, Thibaut VARENE <T-Bone@parisc-linux.org> wrote:
> >On 1/9/07, Dale Farnsworth <dale@farnsworth.org> wrote:
> >>
> >> Thank you Thibaut. Please try the following patch:
> >>
> >> From: Dale Farnsworth <dale@farnsworth.org>
> >>
> >> Reserve one unused descriptor in the TX ring
> >> to facilitate testing for when the ring is full.
> >
> >Dale,
> >
> >tried it and unfortunately:
>
> Also, I don't know if you read that bit, but everytime I reboot the
> box immediately after a crash, the NIC gets a bogus (always the same
> it seems) MAC address, and I have to reboot one more time to get back
> to the "normal" MAC address.
>
> Dunno if that hints anything though.
There is something in the code about MAC writing and saving
some config during initialization, so probably it's possible
if reinitialization was broken.
I tried to look more into the code and here are my (maybe
wrong) conclusions:
- It looks like something could be broken during tx descs
freeing or eth_tx_timeout_task. I compared the timeout code
with e100 and tg3 and have a feeling mv643xx_eth is doing
less but I'm not able to estimate the importance of this.
- Such errors, IMHO, could be possible with races and not
enough locking, and btw. I think suspected function isn't
properly locked: mp->tx_desc_count in while condition isn't
protected at all. Below I attach a patch proposal but I'm
not sure some irq off or spin_lock isn't also needed
elswere. If it's only locking it would be suitable to do
the test with a kernel compiled without PREEMPT and SMP,
but if irqs nothing should change...
Regards,
Jarek P.
PS: alas I didn't even check compiling - I had no time to
find all compile dependencies of this driver
---
Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
---
diff -Nurp linux-2.6.20-rc4-/drivers/net/mv643xx_eth.c linux-2.6.20-rc4/drivers/net/mv643xx_eth.c
--- linux-2.6.20-rc4-/drivers/net/mv643xx_eth.c 2006-12-18 08:57:52.000000000 +0100
+++ linux-2.6.20-rc4/drivers/net/mv643xx_eth.c 2007-01-11 08:55:34.000000000 +0100
@@ -312,8 +312,8 @@ int mv643xx_eth_free_tx_descs(struct net
int count;
int released = 0;
+ spin_lock_irqsave(&mp->lock, flags);
while (mp->tx_desc_count > 0) {
- spin_lock_irqsave(&mp->lock, flags);
tx_index = mp->tx_used_desc_q;
desc = &mp->p_tx_desc_area[tx_index];
cmd_sts = desc->cmd_sts;
@@ -348,8 +348,10 @@ int mv643xx_eth_free_tx_descs(struct net
dev_kfree_skb_irq(skb);
released = 1;
+ spin_lock_irqsave(&mp->lock, flags);
}
+ spin_unlock_irqrestore(&mp->lock, flags);
return released;
}
next prev parent reply other threads:[~2007-01-11 10:40 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-05 19:03 kernel BUG in eth_alloc_tx_desc_index at drivers/net/mv643xx_eth.c:1069! Thibaut VARENE
2007-01-09 9:26 ` Jarek Poplawski
2007-01-09 10:27 ` Thibaut VARENE
2007-01-09 10:52 ` Jarek Poplawski
2007-01-09 10:56 ` Thibaut VARENE
2007-01-09 11:48 ` Jarek Poplawski
2007-01-09 10:57 ` Jarek Poplawski
2007-01-09 13:02 ` Jarek Poplawski
2007-01-09 17:44 ` Thibaut VARENE
2007-01-09 20:05 ` Dale Farnsworth
2007-01-09 21:05 ` Thibaut VARENE
2007-01-10 17:12 ` Thibaut VARENE
2007-01-11 10:42 ` Jarek Poplawski [this message]
2007-01-21 12:18 ` [PATCH] " Thibaut VARENE
2007-01-21 13:02 ` Thibaut VARENE
2007-01-22 10:02 ` Jarek Poplawski
2007-01-22 17:06 ` Dale Farnsworth
2007-01-23 8:17 ` Jarek Poplawski
2007-01-23 11:52 ` Thibaut VARENE
2007-01-23 12:42 ` Thibaut VARENE
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=20070111104220.GA3171@ff.dom.local \
--to=jarkao2@o2.pl \
--cc=T-Bone@parisc-linux.org \
--cc=dale@farnsworth.org \
--cc=mlachwani@mvista.com \
--cc=netdev@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).