• Bert Kenward's avatar
    sfc: avoid hang from nested use of the filter_sem · 1c56c099
    Bert Kenward authored
    In some situations we may end up calling down_read while already
    holding the semaphore for write, thus hanging. This has been seen
    when setting the MAC address for the interface. The hung task log
    in this situation includes this stack:
      down_read
      efx_ef10_filter_insert
      efx_ef10_filter_insert_addr_list
      efx_ef10_filter_vlan_sync_rx_mode
      efx_ef10_filter_add_vlan
      efx_ef10_filter_table_probe
      efx_ef10_set_mac_address
      efx_set_mac_address
      dev_set_mac_address
    
    In addition, lockdep rightly points out that nested calling of
    down_read is incorrect.
    
    Fixes: c2bebe37 ("sfc: give ef10 its own rwsem in the filter table instead of filter_lock")
    Tested-by: default avatarJarod Wilson <jarod@redhat.com>
    Signed-off-by: default avatarBert Kenward <bkenward@solarflare.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    1c56c099
ef10.c 201 KB