• Finn Thain's avatar
    net/sonic: Fix CAM initialization · 772f6642
    Finn Thain authored
    Section 4.3.1 of the datasheet says,
    
        This bit [TXP] must not be set if a Load CAM operation is in
        progress (LCAM is set). The SONIC will lock up if both bits are
        set simultaneously.
    
    Testing has shown that the driver sometimes attempts to set LCAM
    while TXP is set. Avoid this by waiting for command completion
    before and after giving the LCAM command.
    
    After issuing the Load CAM command, poll for !SONIC_CR_LCAM rather than
    SONIC_INT_LCD, because the SONIC_CR_TXP bit can't be used until
    !SONIC_CR_LCAM.
    
    When in reset mode, take the opportunity to reset the CAM Enable
    register.
    
    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>
    772f6642
sonic.c 22.7 KB