qcacmn: Move tasklet flush up to ce
Wish to reuse this logic for snoc Change-Id: Ibd678feec9fe0ee583d32d055d4cb4a4885991ab CRs-Fixed: 1051968
This commit is contained in:

committed by
Vishwajith Upendra

parent
cb9bc6333d
commit
6f60b107c5
@@ -240,6 +240,35 @@ void ce_tasklet_kill(struct hif_softc *scn)
|
||||
qdf_atomic_set(&scn->active_tasklet_cnt, 0);
|
||||
}
|
||||
|
||||
#define HIF_CE_DRAIN_WAIT_CNT 20
|
||||
/**
|
||||
* hif_drain_tasklets(): wait untill no tasklet is pending
|
||||
* @scn: hif context
|
||||
*
|
||||
* Let running tasklets clear pending trafic.
|
||||
*
|
||||
* Return: 0 if no bottom half is in progress when it returns.
|
||||
* -EFAULT if it times out.
|
||||
*/
|
||||
int hif_drain_tasklets(struct hif_softc *scn)
|
||||
{
|
||||
uint32_t ce_drain_wait_cnt = 0;
|
||||
|
||||
while (qdf_atomic_read(&scn->active_tasklet_cnt)) {
|
||||
if (++ce_drain_wait_cnt > HIF_CE_DRAIN_WAIT_CNT) {
|
||||
HIF_ERROR("%s: CE still not done with access",
|
||||
__func__);
|
||||
|
||||
return -EFAULT;
|
||||
}
|
||||
HIF_INFO("%s: Waiting for CE to finish access", __func__);
|
||||
msleep(10);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef WLAN_SUSPEND_RESUME_TEST
|
||||
static bool g_hif_apps_fake_suspended;
|
||||
static hdd_fake_resume_callback hdd_fake_aps_resume;
|
||||
|
@@ -31,6 +31,7 @@
|
||||
void init_tasklet_workers(struct hif_opaque_softc *scn);
|
||||
void ce_tasklet_init(struct HIF_CE_state *hif_ce_state, uint32_t mask);
|
||||
void ce_tasklet_kill(struct hif_softc *scn);
|
||||
int hif_drain_tasklets(struct hif_softc *scn);
|
||||
QDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask);
|
||||
QDF_STATUS ce_unregister_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask);
|
||||
irqreturn_t ce_dispatch_interrupt(int irq,
|
||||
|
@@ -2504,32 +2504,6 @@ void hif_pci_prevent_linkdown(struct hif_softc *scn, bool flag)
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* hif_drain_tasklets(): wait untill no tasklet is pending
|
||||
* @scn: hif context
|
||||
*
|
||||
* Let running tasklets clear pending trafic.
|
||||
*
|
||||
* Return: 0 if no bottom half is in progress when it returns.
|
||||
* -EFAULT if it times out.
|
||||
*/
|
||||
static inline int hif_drain_tasklets(struct hif_softc *scn)
|
||||
{
|
||||
uint32_t ce_drain_wait_cnt = 0;
|
||||
|
||||
while (qdf_atomic_read(&scn->active_tasklet_cnt)) {
|
||||
if (++ce_drain_wait_cnt > HIF_CE_DRAIN_WAIT_CNT) {
|
||||
HIF_ERROR("%s: CE still not done with access",
|
||||
__func__);
|
||||
|
||||
return -EFAULT;
|
||||
}
|
||||
HIF_INFO("%s: Waiting for CE to finish access", __func__);
|
||||
msleep(10);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* hif_bus_suspend_link_up() - suspend the bus
|
||||
*
|
||||
|
@@ -185,9 +185,6 @@ irqreturn_t hif_pci_interrupt_handler(int irq, void *arg);
|
||||
#define OL_ATH_TX_DRAIN_WAIT_CNT 60
|
||||
#endif
|
||||
|
||||
#define HIF_CE_DRAIN_WAIT_CNT 20
|
||||
|
||||
|
||||
#ifdef FEATURE_RUNTIME_PM
|
||||
#include <linux/pm_runtime.h>
|
||||
|
||||
|
Reference in New Issue
Block a user