qcacmn: Do not free timer object from within timer callback

When a timer callback function is being executed, the kernel still has the
timer object data structure. Therefore, do not free the object from within
the timer callback function. Since there are many DFS NOL timers and the
number of DFS NOL timers are not known at the device object creation time
we cannot allocate static memory for DFS NOL timers. They should be
created and freed dynamically. While waiting for the timer to complete
we should not hold the same lock that is held by the timer callback
function, holding the same lock might lead to deadlock.

Instead of freeing the timer object from within the timer we schedule a
workQueue and the timer object is freed from the workQueue callback
function. While destroying the device object or resetting DFS, we need to
stop the timers and free (cleanup) the DFS NOL timer objects that have
already been added. While waiting for a timer to complete
(qdf_timer_sync_cancel) we do not hold the lock that is used by the timer
function callback to protect the list of DFS NOL timers. This is to avoid
deadlock. The list access is protected by the lock so that either the
cleanup thread or the DFS NOL timer removes a timer object.

Also add fix for unwanted channel addition to precac NOL list when precac
is not enabled.

Change-Id: I1ee935fd15a79579197ccccba0e37c6850fde866
CRs-Fixed: 2171259
4 files changed