• John Efstathiades's avatar
    lan78xx: Fix partial packet errors on suspend/resume · e1210fe6
    John Efstathiades authored
    The MAC can get out of step with the internal packet FIFOs if the
    system goes to sleep when the link is active, especially at high
    data rates. This can result in partial frames in the packet FIFOs
    that in result in malformed frames being delivered to the host.
    This occurs because the driver does not enable/disable the internal
    packet FIFOs in step with the corresponding MAC data path. The
    following changes fix this problem.
    
    Update code that enables/disables the MAC receiver and transmitter
    to the more general Rx and Tx data path, where the data path in each
    direction consists of both the MAC function (Tx or Rx) and the
    corresponding packet FIFO.
    
    In the receive path the packet FIFO must be enabled before the MAC
    receiver but disabled after the MAC receiver.
    
    In the transmit path the opposite is true: the packet FIFO must be
    enabled after the MAC transmitter but disabled before the MAC
    transmitter.
    
    The packet FIFOs can be flushed safely once the corresponding data
    path is stopped.
    Signed-off-by: default avatarJohn Efstathiades <john.efstathiades@pebblebay.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e1210fe6
lan78xx.c 108 KB