• Russell King's avatar
    net: fec: quiesce packet processing before changing features · 8506fa1d
    Russell King authored
    Changing the features (receive checksumming) requires the hardware to be
    reprogrammed, and also changes the checks in the receive packet
    processing.
    
    The current implementation has a race - fec_set_features() changes the
    flags which alter the receive packet processing while the adapter is
    active, and potentially receiving frames.  Only after we've modified
    the software flag do we shutdown and reconfigure the hardware.
    
    This can lead to packets being received and marked with a valid checksum
    (via CHECKSUM_UNNECESSARY) when the hardware checksum validation has not
    yet been enabled.
    
    We must quiesce the device, then change the software configuration for
    this feature, and then resume the device if it was previously running.
    
    The resulting code structure also allows us to add other configuration
    features in this path without having to quiesce and resume the network
    interface and device.
    Acked-by: default avatarFugang Duan <B38611@freescale.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    8506fa1d
fec_main.c 71.1 KB