qcacld-3.0: Synchronize hdd_driver_unload against other vdev trans

Unloading the driver is a driver transition. As a part of this driver
unload, the PLD calls the pld_remove which is a psoc transition. This is
the reason why the driver unload is currently not being protected as
there is a call to psoc transition within it.

This absence of locking can lead to potential deadlock scenario. Assume the
example of add_virtual_interface and rmmod coming in parallel.

	T1: add_virtual_interface (starts a vdev_trans)

	T2: rmmod comes in parallel
		-> unregister_driver goes to PLD
		-> PLD calls pld_remove (psoc_trans waits due to T1)

	T1: add_virtual_interface continues
		-> Calls idle_restart that goes to PLD
		-> PLD waits from pld_remove (T2) to complete first

	T1 and T2 are waiting for each other to exit resulting in
	deadlock.

To resolve this, add a driver_trans_start_wait to hdd_driver_unload.
This will ensure that either the unload waits for all other trans to be
completed before proceeding or set the driver_load_unload flag which
will result in upcoming trans to get rejected.

Change-Id: I64b03843065e5eef7c2be209c1f8cb936bdd0742
CRs-Fixed: 2683032
1 file changed