All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Adam Nielsen <a.nielsen@optushome.com.au>
Subject: Re: [PATCH] Fix kernel lockup in RTL-8169 gigabit ethernet driver
Date: Sat, 03 Apr 2004 13:30:28 +0200	[thread overview]
Message-ID: <406EA054.2020401@colorfullife.com> (raw)

Andrew wrote:

>The logic is faulty, or at least very odd.
>
>	tx_left = tp->cur_tx - dirty_tx;
>
>	while (tx_left > 0) {
>		int entry = dirty_tx % NUM_TX_DESC;
>
>		if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) {
>			...
>		}
>	}
>
>Why is that `if' test there at all?  If it ever returns false, the box
>locks up.  A BUG_ON(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)
>might make more sense.
>  
>
tx_left counts packets submitted by hard_xmit_start to the hardware. 
Initially OWNbit is set, the packet is owned by the nic. The OWNbit is 
cleared by the hardware after the packet was sent. A packet with OWNbit 
set means that the nic didn't send it yet to the wire. I think the "else 
break;" patch is correct, but someone with docs should confirm that.

Adam: did you see deadlocks that disappeared after applying your patch? 
It shouldn't deadlock - it should loop until the nic sends the packet to 
the wire. It might take a few msecs, but then it should continue. 
Perhaps gcc optimized away the reload from memory and loops on a 
register. Or there is another bug that is hidden by your patch.

--
    Manfred


             reply	other threads:[~2004-04-03 11:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-03 11:30 Manfred Spraul [this message]
2004-04-03 12:45 ` [PATCH] Fix kernel lockup in RTL-8169 gigabit ethernet driver Francois Romieu
2004-04-04  0:55 ` Malvineous
2004-04-04  9:15   ` Francois Romieu
2004-04-05 21:51     ` Adam Nielsen
2004-04-06 17:11       ` Manfred Spraul
2004-04-06 20:50         ` Francois Romieu
  -- strict thread matches above, loose matches on Subject: below --
2004-04-05 23:08 Dieter Nützel
2004-04-06  7:47 ` Francois Romieu
2004-04-03  5:02 Adam Nielsen
2004-04-03  9:27 ` Francois Romieu
2004-04-03 10:07   ` Andrew Morton
2004-04-03 12:13     ` Francois Romieu

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=406EA054.2020401@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=a.nielsen@optushome.com.au \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.