• R
    net: fec: quiesce packet processing before changing features · 8506fa1d
    Russell King 提交于
    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: NFugang Duan <B38611@freescale.com>
    Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: NDavid S. Miller <davem@davemloft.net>
    8506fa1d
fec_main.c 71.1 KB