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

Commit d05f7833 authored by Arun Kumar Khandavalli's avatar Arun Kumar Khandavalli Committed by Gerrit - the friendly Code Review server
Browse files

qcacld-3.0: Remove obselete wma_needShutdown code

wma_needShutdown related code is now obselete, during the cds_preenable
failure, this is obselete code is being invoked which is setting
wma->needShutdown. If the same is set the wma_close will not be
inokved resulting in the reference leak of of pdev object.

Remove obselete wma_needShutdown code.

Change-Id: Ia1463c9197593165eb5844e154f78fe3fe278fbd
CRs-Fixed: 2947133
parent c0cbb4a3
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -177,8 +177,6 @@ struct cds_context {

	uint32_t driver_state;

	qdf_event_t wma_complete_event;

	/* WMA Context */
	void *wma_context;

+6 −41
Original line number Diff line number Diff line
@@ -653,24 +653,18 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
	/* Initialize bug reporting structure */
	cds_init_log_completion();

	status = qdf_event_create(&gp_cds_context->wma_complete_event);
	if (QDF_IS_STATUS_ERROR(status)) {
		cds_alert("Unable to init wma_complete_event");
		return status;
	}

	hdd_ctx = gp_cds_context->hdd_context;
	if (!hdd_ctx || !hdd_ctx->config) {
		cds_err("Hdd Context is Null");

		status = QDF_STATUS_E_FAILURE;
		goto err_wma_complete_event;
		return status;
	}

	status = dispatcher_enable();
	if (QDF_IS_STATUS_ERROR(status)) {
		cds_err("Failed to enable dispatcher; status:%d", status);
		goto err_wma_complete_event;
		return status;
	}

	/* Now Open the CDS Scheduler */
@@ -895,9 +889,6 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
	if (QDF_IS_STATUS_ERROR(dispatcher_disable()))
		QDF_DEBUG_PANIC("Failed to disable dispatcher");

err_wma_complete_event:
	qdf_event_destroy(&gp_cds_context->wma_complete_event);

	return status;
} /* cds_open() */

@@ -1174,26 +1165,10 @@ QDF_STATUS cds_enable(struct wlan_objmgr_psoc *psoc)
	mac_stop(gp_cds_context->mac_context);

err_wma_stop:
	qdf_event_reset(&gp_cds_context->wma_complete_event);
	qdf_status = wma_stop();
	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
		cds_err("Failed to stop wma");
		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
		wma_setneedshutdown();
	} else {
		qdf_status =
			qdf_wait_for_event_completion(
					&gp_cds_context->wma_complete_event,
					CDS_WMA_TIMEOUT);
		if (qdf_status != QDF_STATUS_SUCCESS) {
			if (qdf_status == QDF_STATUS_E_TIMEOUT) {
				cds_alert("Timeout occurred before WMA_stop complete");
			} else {
				cds_alert("WMA_stop reporting other error");
			}
			QDF_ASSERT(0);
			wma_setneedshutdown();
		}
	}

	return QDF_STATUS_E_FAILURE;
@@ -1227,7 +1202,6 @@ QDF_STATUS cds_disable(struct wlan_objmgr_psoc *psoc)
	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
		cds_err("Failed to stop wma");
		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
		wma_setneedshutdown();
	}

	handle = cds_get_context(QDF_MODULE_ID_PE);
@@ -1365,15 +1339,12 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc)
	ucfg_pmo_psoc_update_dp_handle(psoc, NULL);
	wlan_psoc_set_dp_handle(psoc, NULL);

	if (true == wma_needshutdown()) {
		cds_err("Failed to shutdown wma");
	} else {

	qdf_status = wma_close();
	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
		cds_err("Failed to close wma");
		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
	}
	}

	qdf_status = wma_wmi_service_close();
	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
@@ -1381,12 +1352,6 @@ QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc)
		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
	}

	qdf_status = qdf_event_destroy(&gp_cds_context->wma_complete_event);
	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
		cds_err("failed to destroy wma_complete_event");
		QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status));
	}

	cds_deinit_ini_config();
	qdf_timer_module_deinit();

+0 −2
Original line number Diff line number Diff line
@@ -827,7 +827,6 @@ struct wma_wlm_stats_data {
 * @last_umac_data_ota_timestamp: timestamp when OTA of last umac data
 *   was done
 * @last_umac_data_nbuf: cache nbuf ptr for the last umac data buf
 * @needShutdown: is shutdown needed or not
 * @tgt_cfg_update_cb: configuration update callback
 * @reg_cap: regulatory capablities
 * @scan_id: scan id
@@ -949,7 +948,6 @@ typedef struct {
	wma_tx_ota_comp_callback umac_data_ota_ack_cb;
	unsigned long last_umac_data_ota_timestamp;
	qdf_nbuf_t last_umac_data_nbuf;
	bool needShutdown;
	wma_tgt_cfg_cb tgt_cfg_update_cb;
	HAL_REG_CAPABILITIES reg_cap;
	uint32_t scan_id;
+0 −4
Original line number Diff line number Diff line
@@ -129,10 +129,6 @@ int wma_rx_service_ready_event(void *handle, uint8_t *ev, uint32_t len);

int wma_rx_service_ready_ext_event(void *handle, uint8_t *ev, uint32_t len);

void wma_setneedshutdown(void);

bool wma_needshutdown(void);

QDF_STATUS wma_wait_for_ready_event(WMA_HANDLE handle);

int wma_cli_get_command(int vdev_id, int param_id, int vpdev);
+0 −46
Original line number Diff line number Diff line
@@ -6953,52 +6953,6 @@ int wma_rx_ready_event(void *handle, uint8_t *cmd_param_info,
	return 0;
}

/**
 * wma_setneedshutdown() - setting wma needshutdown flag
 *
 * Return: none
 */
void wma_setneedshutdown(void)
{
	tp_wma_handle wma_handle;

	wma_debug("Enter");

	wma_handle = cds_get_context(QDF_MODULE_ID_WMA);

	if (!wma_handle) {
		wma_err("Invalid arguments");
		QDF_ASSERT(0);
		return;
	}

	wma_handle->needShutdown = true;
	wma_debug("Exit");
}

/**
 * wma_needshutdown() - Is wma needs shutdown?
 *
 * Return: returns true/false
 */
bool wma_needshutdown(void)
{
	tp_wma_handle wma_handle;

	wma_debug("Enter");

	wma_handle = cds_get_context(QDF_MODULE_ID_WMA);

	if (!wma_handle) {
		wma_err("Invalid arguments");
		QDF_ASSERT(0);
		return false;
	}

	wma_debug("Exit");
	return wma_handle->needShutdown;
}

/**
 * wma_wait_for_ready_event() - wait for wma ready event
 * @handle: wma handle