• Vladimir Oltean's avatar
    net: dsa: lantiq_gswip: serialize access to the PCE registers · cf231b43
    Vladimir Oltean authored
    The GSWIP switch accesses various bridging layer tables (VLANs, FDBs,
    forwarding rules) indirectly through PCE registers. These hardware
    accesses are non-atomic, being comprised of several register reads and
    writes.
    
    These accesses are currently serialized by the rtnl_lock, but DSA is
    changing its driver API and that lock will no longer be held when
    calling ->port_fdb_add() and ->port_fdb_del().
    
    So this driver needs to serialize the access to the PCE registers using
    its own locking scheme. This patch adds that.
    
    Note that the driver also uses the gswip_pce_load_microcode() function
    to load a static configuration for the packet classification engine into
    a table using the same registers. It is currently not protected, but
    since that configuration is only done from the dsa_switch_ops :: setup
    method, there is no risk of it being concurrent with other operations.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Acked-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    cf231b43
lantiq_gswip.c 63.7 KB