• Oliver Hartkopp's avatar
    can: Fix SJA1000 command register writes on SMP systems · 57c8a456
    Oliver Hartkopp authored
    The SJA1000 command register is concurrently written in the rx-path to free
    the receive buffer _and_ in the tx-path to start the transmission.
    
    The SJA1000 data sheet, 6.4.4 COMMAND REGISTER (CMR) states:
    "Between two commands at least one internal clock cycle is needed in
    order to proceed. The internal clock is half of the external oscillator
    frequency."
    
    On SMP systems the current implementation leads to a write stall in the
    tx-path, which can be solved by adding some general locking and some time
    to settle the write_reg() operation for the command register.
    
    Thanks to Klaus Hitschler for the original fix and detailed problem
    description.
    
    This patch applies on net-2.6 and (with some offsets) on net-next-2.6 .
    Signed-off-by: default avatarOliver Hartkopp <socketcan@hartkopp.net>
    Acked-by: default avatarWolfgang Grandegger <wg@grandegger.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    57c8a456
sja1000.h 5.31 KB