Browse Source

qcacmn: Fix pl_info->log_stat update

If log state 1, 2, 0, 1 are set serially, log state 2 can't be set
successfully, while log state 1 is set to wdi twice, which results
in two same pointers in doubly linked list txrx_pdev->wdi_event_list
and causes dead loop.

Update pl_info->log_stat only when it is subscribed to wdi and sent
to firmware successfully.

Change-Id: I8d67b9f02a2fb2c958d2553a743cbabcedfb2f42
CRs-Fixed: 2250715
bings 6 years ago
parent
commit
315d67f3f4
1 changed files with 5 additions and 1 deletions
  1. 5 1
      utils/pktlog/pktlog_ac.c

+ 5 - 1
utils/pktlog/pktlog_ac.c

@@ -618,8 +618,11 @@ static int __pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
 					__func__);
 				return -EINVAL;
 			}
+		} else {
+			qdf_print("Unable to subscribe %d to the WDI %s\n",
+				  log_state, __func__);
+			return -EINVAL;
 		}
-		pl_dev->is_pktlog_cb_subscribed = true;
 		/* WMI command to enable pktlog on the firmware */
 		if (pktlog_enable_tgt(scn, log_state, ini_triggered,
 				user_triggered)) {
@@ -627,6 +630,7 @@ static int __pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
 			qdf_print("Device cannot be enabled, %s\n", __func__);
 			return -EINVAL;
 		}
+		pl_dev->is_pktlog_cb_subscribed = true;
 
 		if (is_iwpriv_command == 0)
 			pl_dev->vendor_cmd_send = true;