Prechádzať zdrojové kódy

qcacmn: cancel ce_tasklet workers during deinit sequence

Fix tasklet workers leak, make sure to cancel the ce tasklet workqueues
during driver unload/deinit sequence.

Change-Id: I48e0c60f1a8bd9dc5e9cb151e197b3e843eaa0f3
CRs-Fixed: 2244061
Manjunathappa Prakash 6 rokov pred
rodič
commit
a5a30867c4
3 zmenil súbory, kde vykonal 20 pridanie a 1 odobranie
  1. 2 0
      hif/src/ce/ce_main.c
  2. 16 0
      hif/src/ce/ce_tasklet.c
  3. 2 1
      hif/src/ce/ce_tasklet.h

+ 2 - 0
hif/src/ce/ce_main.c

@@ -2681,6 +2681,7 @@ void hif_unconfig_ce(struct hif_softc *hif_sc)
 	int pipe_num;
 	struct HIF_CE_pipe_info *pipe_info;
 	struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_sc);
+	struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(hif_sc);
 
 	for (pipe_num = 0; pipe_num < hif_sc->ce_count; pipe_num++) {
 		pipe_info = &hif_state->pipe_info[pipe_num];
@@ -2692,6 +2693,7 @@ void hif_unconfig_ce(struct hif_softc *hif_sc)
 			qdf_spinlock_destroy(&pipe_info->recv_bufs_needed_lock);
 		}
 	}
+	deinit_tasklet_workers(hif_hdl);
 	if (hif_sc->athdiag_procfs_inited) {
 		athdiag_procfs_remove();
 		hif_sc->athdiag_procfs_inited = false;

+ 16 - 0
hif/src/ce/ce_tasklet.c

@@ -111,6 +111,22 @@ void init_tasklet_workers(struct hif_opaque_softc *scn)
 	work_initialized = true;
 }
 
+/**
+ * deinit_tasklet_workers() - deinit_tasklet_workers
+ * @scn: HIF Context
+ *
+ * Return: N/A
+ */
+void deinit_tasklet_workers(struct hif_opaque_softc *scn)
+{
+	u32 id;
+
+	for (id = 0; id < CE_ID_MAX; id++)
+		cancel_work_sync(&tasklet_workers[id].work);
+
+	work_initialized = false;
+}
+
 #ifdef HIF_CONFIG_SLUB_DEBUG_ON
 /**
  * ce_schedule_tasklet() - schedule ce tasklet

+ 2 - 1
hif/src/ce/ce_tasklet.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2016,2018 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
@@ -20,6 +20,7 @@
 #define __CE_TASKLET_H__
 #include "ce_main.h"
 void init_tasklet_workers(struct hif_opaque_softc *scn);
+void deinit_tasklet_workers(struct hif_opaque_softc *scn);
 void ce_tasklet_init(struct HIF_CE_state *hif_ce_state, uint32_t mask);
 void ce_tasklet_kill(struct hif_softc *scn);
 int hif_drain_tasklets(struct hif_softc *scn);