• Finn Thain's avatar
    net/sonic: Fix command register usage · 27e0c31c
    Finn Thain authored
    There are several issues relating to command register usage during
    chip initialization.
    
    Firstly, the SONIC sometimes comes out of software reset with the
    Start Timer bit set. This gets logged as,
    
        macsonic macsonic eth0: sonic_init: status=24, i=101
    
    Avoid this by giving the Stop Timer command earlier than later.
    
    Secondly, the loop that waits for the Read RRA command to complete has
    the break condition inverted. That's why the for loop iterates until
    its termination condition. Call the helper for this instead.
    
    Finally, give the Receiver Enable command after clearing interrupts,
    not before, to avoid the possibility of losing an interrupt.
    
    Fixes: 1da177e4 ("Linux-2.6.12-rc2")
    Tested-by: default avatarStan Johnson <userm57@yahoo.com>
    Signed-off-by: default avatarFinn Thain <fthain@telegraphics.com.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    27e0c31c
sonic.c 22.6 KB