]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: avoid hang from nested use of the filter_sem
authorBert Kenward <bkenward@solarflare.com>
Wed, 11 Jul 2018 10:44:25 +0000 (11:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jul 2018 21:52:04 +0000 (14:52 -0700)
commitf4ac486150c79e8e6eb49c198d5e27ff0e2231cf
treebfcb18dd2cb125fbf0b624df967a40256b3b8b38
parent7301a8aee70a049589770d7a4f9b1773eea33913
sfc: avoid hang from nested use of the filter_sem

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: 0716a41dca75 ("sfc: give ef10 its own rwsem in the filter table instead of filter_lock")
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/ef10.c