qcacmn: Deregister HIF ext groups on rmmod
- Deregister & free the hif ext ctx when detaching DP interrupts. - Unregister the hotcpu_notifier during rmmod. Change-Id: Icbd3c6cee70b6b224059a4b301b9840485a96d11 CRs-Fixed: 2086729
This commit is contained in:
@@ -1188,6 +1188,8 @@ static void dp_soc_interrupt_detach(void *txrx_soc)
|
|||||||
if (soc->intr_mode == DP_INTR_POLL) {
|
if (soc->intr_mode == DP_INTR_POLL) {
|
||||||
qdf_timer_stop(&soc->int_timer);
|
qdf_timer_stop(&soc->int_timer);
|
||||||
qdf_timer_free(&soc->int_timer);
|
qdf_timer_free(&soc->int_timer);
|
||||||
|
} else {
|
||||||
|
hif_deregister_exec_group(soc->hif_handle, "dp_intr");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++) {
|
for (i = 0; i < wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx); i++) {
|
||||||
|
@@ -299,6 +299,7 @@ struct qca_napi_data {
|
|||||||
int lilcl_head, bigcl_head;
|
int lilcl_head, bigcl_head;
|
||||||
enum qca_napi_tput_state napi_mode;
|
enum qca_napi_tput_state napi_mode;
|
||||||
struct notifier_block hnc_cpu_notifier;
|
struct notifier_block hnc_cpu_notifier;
|
||||||
|
bool cpu_notifier_registered;
|
||||||
uint8_t flags;
|
uint8_t flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -890,6 +891,8 @@ uint32_t hif_register_ext_group(struct hif_opaque_softc *hif_ctx,
|
|||||||
uint32_t numirq, uint32_t irq[], ext_intr_handler handler,
|
uint32_t numirq, uint32_t irq[], ext_intr_handler handler,
|
||||||
void *cb_ctx, const char *context_name,
|
void *cb_ctx, const char *context_name,
|
||||||
uint32_t budget);
|
uint32_t budget);
|
||||||
|
void hif_deregister_exec_group(struct hif_opaque_softc *hif_ctx,
|
||||||
|
const char *context_name);
|
||||||
|
|
||||||
void hif_update_pipe_callback(struct hif_opaque_softc *osc,
|
void hif_update_pipe_callback(struct hif_opaque_softc *osc,
|
||||||
u_int8_t pipeid,
|
u_int8_t pipeid,
|
||||||
|
@@ -151,6 +151,8 @@ static void hif_exec_napi_kill(struct hif_exec_context *ctx)
|
|||||||
|
|
||||||
for (irq_ind = 0; irq_ind < ctx->numirq; irq_ind++)
|
for (irq_ind = 0; irq_ind < ctx->numirq; irq_ind++)
|
||||||
hif_irq_affinity_remove(ctx->os_irq[irq_ind]);
|
hif_irq_affinity_remove(ctx->os_irq[irq_ind]);
|
||||||
|
|
||||||
|
netif_napi_del(&(n_ctx->napi));
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hif_execution_ops napi_sched_ops = {
|
struct hif_execution_ops napi_sched_ops = {
|
||||||
@@ -413,3 +415,42 @@ void hif_exec_destroy(struct hif_exec_context *ctx)
|
|||||||
qdf_spinlock_destroy(&ctx->irq_lock);
|
qdf_spinlock_destroy(&ctx->irq_lock);
|
||||||
qdf_mem_free(ctx);
|
qdf_mem_free(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hif_deregister_exec_group() - API to free the exec contexts
|
||||||
|
* @hif_ctx: HIF context
|
||||||
|
* @context_name: name of the module whose contexts need to be deregistered
|
||||||
|
*
|
||||||
|
* This function deregisters the contexts of the requestor identified
|
||||||
|
* based on the context_name & frees the memory.
|
||||||
|
*
|
||||||
|
* Return: void
|
||||||
|
*/
|
||||||
|
void hif_deregister_exec_group(struct hif_opaque_softc *hif_ctx,
|
||||||
|
const char *context_name)
|
||||||
|
{
|
||||||
|
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
|
||||||
|
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
|
||||||
|
struct hif_exec_context *hif_ext_group;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < HIF_MAX_GROUP; i++) {
|
||||||
|
hif_ext_group = hif_state->hif_ext_group[i];
|
||||||
|
|
||||||
|
if (!hif_ext_group)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
HIF_INFO("%s: Deregistering grp id %d name %s\n",
|
||||||
|
__func__,
|
||||||
|
hif_ext_group->grp_id,
|
||||||
|
hif_ext_group->context_name);
|
||||||
|
|
||||||
|
if (strcmp(hif_ext_group->context_name, context_name) == 0) {
|
||||||
|
hif_ext_group->sched_ops->kill(hif_ext_group);
|
||||||
|
hif_state->hif_ext_group[i] = NULL;
|
||||||
|
hif_exec_destroy(hif_ext_group);
|
||||||
|
hif_state->hif_num_extgroup--;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1146,9 +1146,14 @@ static int hnc_hotplug_hook(struct hif_softc *hif_sc, int install)
|
|||||||
= hnc_cpu_notify_cb;
|
= hnc_cpu_notify_cb;
|
||||||
rc = register_hotcpu_notifier(
|
rc = register_hotcpu_notifier(
|
||||||
&hif_sc->napi_data.hnc_cpu_notifier);
|
&hif_sc->napi_data.hnc_cpu_notifier);
|
||||||
|
if (rc == 0)
|
||||||
|
hif_sc->napi_data.cpu_notifier_registered = true;
|
||||||
} else {
|
} else {
|
||||||
unregister_hotcpu_notifier(
|
if (hif_sc->napi_data.cpu_notifier_registered == true) {
|
||||||
&hif_sc->napi_data.hnc_cpu_notifier);
|
unregister_hotcpu_notifier(
|
||||||
|
&hif_sc->napi_data.hnc_cpu_notifier);
|
||||||
|
hif_sc->napi_data.cpu_notifier_registered = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NAPI_DEBUG("<--%s()[%d]", __func__, rc);
|
NAPI_DEBUG("<--%s()[%d]", __func__, rc);
|
||||||
|
Reference in New Issue
Block a user