qcacld-3.0: Fix deadlock between rtnl lock and vdev ops DSC
The below described scenario can lead to a deadlock between wlan_hdd_del_virtual_intf and the work handler to update netdev features. - netdev features update work is scheduled and takes the vdev ops DSC lock. - before the work is able to take the rtnl lock, a delete interface is called from kernel with rtnl lock held - wlan_hdd_del_virtual_intf waits indefinitely for all the ops to be completed on this vdev. - Now netdev feature update work is waiting for rtnl lock with vdev ops DSC held, and wlan_hdd_del_virtual_intf is waiting for vdev ops DSC with rtnl lock held. In order to fix the above deadlock scenario, set a delete in progress flag in wlan_hdd_del_virtual_intf and use rtnl_trylock in the netdev features update work, only if the delete in progress flag is not set. Using rtnl_trylock with a few equally time spaced attempts to acquire rtnl lock will make sure the features update is done it the work is unable to acquire the rtnl lock due to any other netdev operation (apart from interface deletion). Change-Id: Iad6448d4d9bf7f4cbfcfc4c6fb3afb248afaeeec CRs-Fixed: 2854713
Loading
Please register or sign in to comment