diff --git a/core/hdd/src/wlan_hdd_driver_ops.c b/core/hdd/src/wlan_hdd_driver_ops.c index 3a167db35ea0..02b2ab8f10af 100644 --- a/core/hdd/src/wlan_hdd_driver_ops.c +++ b/core/hdd/src/wlan_hdd_driver_ops.c @@ -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); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 4eedbe928b99..ab87de0ff37d 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -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);