• Claudiu Manoil's avatar
    gianfar: Fix on-the-fly vlan and mtu updates · 88302648
    Claudiu Manoil authored
    The RCTRL and TCTRL registers should not be changed
    on-the-fly, while the controller is running, otherwise
    unexpected behaviour occurs.  But that's exactly what
    gfar_vlan_mode() does, updating the VLAN acceleration
    bits inside RCTRL/TCTRL.  The attempt to lock these
    operations doesn't help, but only adds to the confusion.
    There's also a dependency for Rx FCB insertion (activating
    /de-activating the TOE offload block on Rx) which might
    change the required rx buffer size.  This makes matters
    worse as gfar_vlan_mode() ends up calling gfar_change_mtu(),
    though the MTU size remains the same.  Note that there are
    other situations that may affect the required rx buffer size,
    like changing RXCSUM or rx hw timestamping, but errorneously
    the rx buffer size is not recomputed/ updated in the process.
    
    To fix this, do the vlan updates properly inside the MAC
    reset and reconfiguration procedure, which takes care of
    the rx buffer size dependecy and the rx TOE block (PRSDEP)
    activation/deactivation as well (in the correct order).
    As a consequence, MTU/ rx buff size updates are done now
    by the same MAC reset and reconfig procedure, so that out
    of context updates to MAXFRM, MRBLR, and MACCFG inside
    change_mtu() are no longer needed.  The rx buffer size
    dependecy to Rx FCB is now handled for the other cases too
    (RXCSUM and rx hw timestamping).
    Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    88302648
gianfar.c 86.8 KB