qcacld-3.0: Mark target not ready in hif disable path

Currently, the target-not-ready flag is only ever cleared in the event
of a firmware down notification from the platform driver. However, we
know that the target is not ready after a certain point in the hif
disable path. Additionally, the hif enable path does not clear this flag
during error handling. Address these issues.

Change-Id: I02555940dfba35874768aa453a24121a101354e5
CRs-Fixed: 2339361
This commit is contained in:
Dustin Brown 2018-10-25 16:56:27 -07:00 • committed by nshrivas
commit c2a156e17b
2 changed files with 6 additions and 2 deletions

View file

@ -255,7 +255,7 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid,
hdd_err("NAPI creation error, rc: 0x%x, reinit: %d",
ret, reinit);
ret = -EFAULT;
goto err_hif_close;
goto mark_target_not_ready;
} else {
hdd_napi_event(NAPI_EVT_INI_FILE,
(void *)hdd_ctx->napi_enable);
@ -271,6 +271,9 @@ int hdd_hif_open(struct device *dev, void *bdev, const struct hif_bus_id *bid,
CFG_DP_CE_SERVICE_MAX_RX_IND_FLUSH));
return 0;
mark_target_not_ready:
cds_set_target_ready(false);
err_hif_close:
hdd_deinit_cds_hif_context();
hif_close(hif_ctx);
@ -287,6 +290,7 @@ void hdd_hif_close(struct hdd_context *hdd_ctx, void *hif_ctx)
if (hif_ctx == NULL)
return;
cds_set_target_ready(false);
hif_disable(hif_ctx, HIF_DISABLE_TYPE_REMOVE);
hdd_napi_destroy(true);

View file

@ -11077,7 +11077,7 @@ int hdd_wlan_stop_modules(struct hdd_context *hdd_ctx, bool ftm_mode)
ol_cds_free();
if (IS_IDLE_STOP && cds_is_target_ready()) {
if (IS_IDLE_STOP) {
ret = pld_power_off(qdf_ctx->dev);
if (ret)
hdd_err("Failed to power down device; errno:%d", ret);