qcacmn: Fix get station stats cmd timeout

Request is cleared before response for race condition between request
thread wificond and response work thread.
1. wificond thread sent cp_stats_get request and waited for
response.
2. worker thread got response from F/W, completed the request.
3. Wificond got the response, finished the request.
4. wificond triggered another cp_stats_get request, created
new request, set pending request bit TYPE_STATION_STATS.
5. Kworker thread clear the pending request bit
TYPE_STATION_STATS.
6. Cleared request TYPE_STATION_STATS couldn't be completed any
more, wificond thread waited for 1.6s, timeout happened.

Fix: Clear pending request bit TYPE_STATION_STATS before
complete the request, make sure old pending request bit is
cleared before new request of same type is set.

Change-Id: I7b89571b1e95a6e17aec9d649bd3adfccf3eb02e
CRs-Fixed: 2619370
このコミットが含まれているのは:
Jianmin Zhu
2020-02-11 23:41:32 +08:00
committed by nshrivas
コミット 587fdeec25

ファイルの表示

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
* Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -882,9 +882,9 @@ static void tgt_mc_cp_stats_extract_station_stats(
* reset type_map bit for station stats .
*/
if (tgt_mc_cp_stats_is_last_event(ev, TYPE_STATION_STATS)) {
ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_STATION_STATS);
tgt_mc_cp_stats_prepare_n_send_raw_station_stats(psoc,
&last_req);
ucfg_mc_cp_stats_reset_pending_req(psoc, TYPE_STATION_STATS);
}
}