Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fba75b27 authored by Abhishek Singh's avatar Abhishek Singh
Browse files

qcacmn: Free serial cmd before its timer when rmmod

Rmmod process:
wlan_hdd_pld_remove --> hdd_stop_adapter --> hdd_vdev_destroy
--> WLAN_SER_CMD_DEL_STA_SESSION (25) cmd queued --> PLD_FW_DOWN
(will complete wait event as part of qdf_complete_wait_events)
--> hdd_wlan_stop_modules --> cds_disable -->
dispatcher_psoc_disable --> wlan_serialization_psoc_disable -->
wlan_serialization_timer_destroy --> umac_stop --> csr_stop -->
wlan_ser_cancel_non_scan_cmd -> check if timer is present but th
 timer are already destroyed, so assert.

Move wlan_serialization_purge_cmd_list into converged API file to
be shared by MCC and WIN.

Change-Id: Iad557e4a05d682c257be0c39049c52950e5eb530
CRs-Fixed: 2451058
parent 5dae8928
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -460,6 +460,22 @@ bool wlan_serialization_is_cmd_present_in_active_queue(
		struct wlan_objmgr_psoc *psoc,
		struct wlan_serialization_command *cmd);

/**
 * wlan_serialization_purge_all_pdev_cmd() - purge all command for given pdev
 * @pdev: objmgr pdev pointer
 *
 * Return: void
 */
void wlan_serialization_purge_all_pdev_cmd(struct wlan_objmgr_pdev *pdev);

/**
 * wlan_serialization_purge_all_cmd() - purge all command for psoc
 * @psoc: objmgr psoc pointer
 *
 * Return: void
 */
void wlan_serialization_purge_all_cmd(struct wlan_objmgr_psoc *psoc);

/**
 * wlan_serialization_get_scan_cmd_using_scan_id() - Return command which
 *					matches vdev_id and scan_id
+46 −0
Original line number Diff line number Diff line
@@ -435,3 +435,49 @@ void *wlan_serialization_get_active_cmd(struct wlan_objmgr_psoc *psoc,

	return umac_cmd;
}

void wlan_serialization_purge_all_pdev_cmd(struct wlan_objmgr_pdev *pdev)
{
	struct wlan_serialization_pdev_priv_obj *ser_pdev_obj;

	if (!pdev) {
		serialization_err("NULL pdev");
		return;
	}

	ser_pdev_obj = wlan_serialization_get_pdev_priv_obj(pdev);
	if (!ser_pdev_obj) {
		serialization_err("invalid ser_pdev_obj");
		return;
	}

	wlan_serialization_remove_all_cmd_from_queue(
			&ser_pdev_obj->pending_scan_list, ser_pdev_obj,
			pdev, NULL, NULL, false);
	wlan_serialization_remove_all_cmd_from_queue(
			&ser_pdev_obj->active_scan_list, ser_pdev_obj,
			pdev, NULL, NULL, true);
	wlan_serialization_remove_all_cmd_from_queue(
			&ser_pdev_obj->pending_list, ser_pdev_obj,
			pdev, NULL, NULL, false);
	wlan_serialization_remove_all_cmd_from_queue(
			&ser_pdev_obj->active_list, ser_pdev_obj,
			pdev, NULL, NULL, true);
}

static inline
void wlan_ser_purge_pdev_cmd_cb(struct wlan_objmgr_psoc *psoc,
				void *object, void *arg)
{
	struct wlan_objmgr_pdev *pdev = (struct wlan_objmgr_pdev *)object;

	wlan_serialization_purge_all_pdev_cmd(pdev);
}

void wlan_serialization_purge_all_cmd(struct wlan_objmgr_psoc *psoc)
{
	wlan_objmgr_iterate_obj_list(psoc, WLAN_PDEV_OP,
				     wlan_ser_purge_pdev_cmd_cb, NULL, 1,
				     WLAN_SERIALIZATION_ID);
}
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,12 @@ QDF_STATUS wlan_serialization_psoc_disable(struct wlan_objmgr_psoc *psoc)
		serialization_err("invalid ser_soc_obj");
		return QDF_STATUS_E_FAILURE;
	}

	/*
	 * purge all serialization command if there are any pending to make
	 * sure memory and vdev ref are freed.
	 */
	wlan_serialization_purge_all_cmd(psoc);
	/* clean up all timers before exiting */
	status = wlan_serialization_cleanup_all_timers(ser_soc_obj);
	if (status != QDF_STATUS_SUCCESS)