Thread (22 messages) flat view 22 messages, 7 authors, 2012-11-25

Re: 8139cp: set ring address before enabling receiver

From: David Woodhouse <dwmw2@infradead.org>
Date: 2012-11-21 16:57:29

On Sat, 2012-06-02 at 23:50 +0000, Linux Kernel Mailing List wrote:
Gitweb:     http://git.kernel.org/linus/;a=commit;h=b01af4579ec41f48e9b9c774e70bd6474ad210db
Commit:     b01af4579ec41f48e9b9c774e70bd6474ad210db
Parent:     20e2a86485967c385d7c7befc1646e4d1d39362e
Author:     Jason Wang [off-list ref]
AuthorDate: Thu May 31 18:19:39 2012 +0000
Committer:  David S. Miller [off-list ref]
CommitDate: Fri Jun 1 14:22:11 2012 -0400

    8139cp: set ring address before enabling receiver
    
    Currently, we enable the receiver before setting the ring address which could
    lead the card DMA into unexpected areas. Solving this by set the ring address
    before enabling the receiver.
    
    btw. I find and test this in qemu as I didn't have a 8139cp card in hand. please
    review it carefully.
    
    Signed-off-by: Jason Wang [off-list ref]
    Signed-off-by: David S. Miller [off-list ref]
This commit appears to break Ethernet on my Traverse Geos router. With
OpenWRT and 3.6.6 I get:

[  124.068359] NETDEV WATCHDOG: eth1 (8139cp): transmit queue 0 timed out  
 ...     
[  124.260614] 8139cp 0000:00:0b.0: eth1: Transmit timeout, status  c   2b    1 80ac                                                                            


If I add code to *read* the *RingAddr registers, at the later point in
cp_init_hw() that they *used* to be set, I get the following:

[ 1126.909193] HiTxRingAddr 0000000000000000 (should be 0)                             
[ 1126.913880] RxRingAddr   000000000f1e5000 (sb f1e5000)                       
[ 1126.919018] TxRingAddr   000000000f344400 (sb f1e5400) 

Adding further debugging indicates that it's being changed in
cp_start_hw(), at the line which writes the CpCmd register. These two
outputs are from the surrounding lines...

[ 1331.650579] at line 960 TxRingAddr   000000000f3c6400 (sb f3c6400)           
[ 1331.656820] at line 962 TxRingAddr   000000000f3e4400 (sb f3c6400)  

The devices are:
00:0a.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ [10ec:8139] (rev 20)                                                  
00:0b.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ [10ec:8139] (rev 20)      

The other one (eth0) isn't connected, which is why I only see the errors
from eth1.

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help