qcacmn: Avoid calling qdf_timer_mod after qdf_timer_stop

Avoid calling qdf_timer_mod after qdf_timer_stop as the
node is deleted after timer is stopped and qdf_timer_mod
dereferences the deleted node leading to data abort.

Replace 'qdf_timer_mod' by the sequence
'qdf_timer_sync_cancel, qdf_timer_start' to be SMP safe.
If a timer is being started for the first time, use only
'qdf_timer_start' and not the sequence
'qdf_timer_sync_cancel, qdf_timer_start'

Change-Id: Ida5440d4a54d49aa97f57fbda57ab1ef2cce16e6
CRs-Fixed: 3005699
Cette révision appartient à :
Gururaj Pandurangi
2021-08-03 12:40:12 -07:00
révisé par Madan Koyyalamudi
Parent 6ad64c3532
révision f5673aa2a4
2 fichiers modifiés avec 5 ajouts et 5 suppressions

Voir le fichier

@@ -371,8 +371,8 @@ void dfs_nol_addchan(struct wlan_dfs *dfs,
"Update OS Ticks for NOL %d MHz / %d MHz",
nol->nol_freq, nol->nol_chwidth);
qdf_timer_stop(&nol->nol_timer);
qdf_timer_mod(&nol->nol_timer,
qdf_timer_sync_cancel(&nol->nol_timer);
qdf_timer_start(&nol->nol_timer,
dfs_nol_timeout * TIME_IN_MS);
return;
}
@@ -403,7 +403,7 @@ void dfs_nol_addchan(struct wlan_dfs *dfs,
&elem->nol_timer, dfs_remove_from_nol,
elem, QDF_TIMER_TYPE_WAKE_APPS);
qdf_timer_mod(&elem->nol_timer, dfs_nol_timeout * TIME_IN_MS);
qdf_timer_start(&elem->nol_timer, dfs_nol_timeout * TIME_IN_MS);
/* Update the NOL counter. */
dfs->dfs_nol_count++;

Voir le fichier

@@ -758,11 +758,11 @@ bool dfs_radar_found_event_basic_sanity(struct wlan_dfs *dfs,
void dfs_send_csa_to_current_chan(struct wlan_dfs *dfs)
{
qdf_timer_stop(&dfs->wlan_dfstesttimer);
dfs->wlan_dfstest = 1;
dfs->wlan_dfstest_ieeechan = dfs->dfs_curchan->dfs_ch_ieee;
dfs->wlan_dfstesttime = 1; /* 1ms */
qdf_timer_mod(&dfs->wlan_dfstesttimer, dfs->wlan_dfstesttime);
qdf_timer_sync_cancel(&dfs->wlan_dfstesttimer);
qdf_timer_start(&dfs->wlan_dfstesttimer, dfs->wlan_dfstesttime);
}
int dfs_second_segment_radar_disable(struct wlan_dfs *dfs)