diff --git a/hif/inc/hif.h b/hif/inc/hif.h index a49d2bc55096..de343149588c 100644 --- a/hif/inc/hif.h +++ b/hif/inc/hif.h @@ -46,7 +46,7 @@ typedef void __iomem *A_target_id_t; typedef void *hif_handle_t; #if defined(HIF_IPCI) && defined(FEATURE_HAL_DELAYED_REG_WRITE) -#define HIF_WORK_DRAIN_WAIT_CNT 10 +#define HIF_WORK_DRAIN_WAIT_CNT 50 #endif #define HIF_TYPE_AR6002 2 @@ -1724,6 +1724,7 @@ hif_softc_to_hif_opaque_softc(struct hif_softc *hif_handle) #if defined(HIF_IPCI) && defined(FEATURE_HAL_DELAYED_REG_WRITE) QDF_STATUS hif_try_prevent_ep_vote_access(struct hif_opaque_softc *hif_ctx); +void hif_set_ep_intermediate_vote_access(struct hif_opaque_softc *hif_ctx); void hif_allow_ep_vote_access(struct hif_opaque_softc *hif_ctx); void hif_set_ep_vote_access(struct hif_opaque_softc *hif_ctx, uint8_t type, uint8_t access); @@ -1736,6 +1737,11 @@ hif_try_prevent_ep_vote_access(struct hif_opaque_softc *hif_ctx) return QDF_STATUS_SUCCESS; } +static inline void +hif_set_ep_intermediate_vote_access(struct hif_opaque_softc *hif_ctx) +{ +} + static inline void hif_allow_ep_vote_access(struct hif_opaque_softc *hif_ctx) { diff --git a/hif/src/hif_main.c b/hif/src/hif_main.c index 2b2b3148ba2c..68935b70a04d 100644 --- a/hif/src/hif_main.c +++ b/hif/src/hif_main.c @@ -1048,12 +1048,30 @@ QDF_STATUS hif_try_prevent_ep_vote_access(struct hif_opaque_softc *hif_ctx) hif_err("timeout wait for pending work %d ", work); return QDF_STATUS_E_FAULT; } - qdf_sleep(5); + qdf_sleep(10); } return QDF_STATUS_SUCCESS; } +void hif_set_ep_intermediate_vote_access(struct hif_opaque_softc *hif_ctx) +{ + struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx); + uint8_t vote_access; + + vote_access = qdf_atomic_read(&scn->ep_vote_access); + + if (vote_access != HIF_EP_VOTE_ACCESS_DISABLE) + hif_info("EP vote changed from:%u to intermediate state", + vote_access); + + if (QDF_IS_STATUS_ERROR(hif_try_prevent_ep_vote_access(hif_ctx))) + QDF_BUG(0); + + qdf_atomic_set(&scn->ep_vote_access, + HIF_EP_VOTE_INTERMEDIATE_ACCESS); +} + void hif_allow_ep_vote_access(struct hif_opaque_softc *hif_ctx) { struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);