From 91674b50e6efbdc49d80234ae2fb00127fb5de98 Mon Sep 17 00:00:00 2001 From: Aditya Bavanari Date: Fri, 23 Nov 2018 17:02:49 +0530 Subject: [PATCH] dsp: afe: Cleanup task_struct related implementation Cleanup task_struct related implementation in AFE driver as it is not used anymore and causes invalid pointer access in stability tests. Change-Id: I97ad810f9389338af85c7cea3213432917a21106 Signed-off-by: Aditya Bavanari --- dsp/q6afe.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/dsp/q6afe.c b/dsp/q6afe.c index 8ae2739e234a..de7782c48d32 100644 --- a/dsp/q6afe.c +++ b/dsp/q6afe.c @@ -88,7 +88,6 @@ struct afe_ctl { atomic_t status; wait_queue_head_t wait[AFE_MAX_PORTS]; wait_queue_head_t wait_wakeup; - struct task_struct *task; void (*tx_cb)(uint32_t opcode, uint32_t token, uint32_t *payload, void *priv); void (*rx_cb)(uint32_t opcode, @@ -438,12 +437,6 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv) this_afe.apr = NULL; rtac_set_afe_handle(this_afe.apr); } - /* send info to user */ - if (this_afe.task == NULL) - this_afe.task = current; - pr_debug("%s: task_name = %s pid = %d\n", - __func__, - this_afe.task->comm, this_afe.task->pid); /* * Pass reset events to proxy driver, if cb is registered @@ -2799,7 +2792,7 @@ EXPORT_SYMBOL(afe_send_spdif_ch_status_cfg); int afe_send_cmd_wakeup_register(void *handle, bool enable) { struct afe_svc_cmd_evt_cfg_payload wakeup_irq; - int ret; + int ret = 0; pr_debug("%s: enter\n", __func__); @@ -2813,18 +2806,13 @@ int afe_send_cmd_wakeup_register(void *handle, bool enable) wakeup_irq.hdr.opcode = AFE_SVC_CMD_EVENT_CFG; wakeup_irq.event_id = AFE_EVENT_ID_MBHC_DETECTION_SW_WA; wakeup_irq.reg_flag = enable; - pr_debug("%s: cmd device start opcode[0x%x] register:%d\n", + pr_debug("%s: cmd wakeup register opcode[0x%x] register:%d\n", __func__, wakeup_irq.hdr.opcode, wakeup_irq.reg_flag); ret = afe_apr_send_pkt(&wakeup_irq, &this_afe.wait_wakeup); - if (ret) { + if (ret) pr_err("%s: AFE wakeup command register %d failed %d\n", __func__, enable, ret); - } else if (this_afe.task != current) { - this_afe.task = current; - pr_debug("task_name = %s pid = %d\n", - this_afe.task->comm, this_afe.task->pid); - } return ret; } @@ -2861,14 +2849,9 @@ static int afe_send_cmd_port_start(u16 port_id) __func__, start.hdr.opcode, start.port_id); ret = afe_apr_send_pkt(&start, &this_afe.wait[index]); - if (ret) { + if (ret) pr_err("%s: AFE enable for port 0x%x failed %d\n", __func__, port_id, ret); - } else if (this_afe.task != current) { - this_afe.task = current; - pr_debug("task_name = %s pid = %d\n", - this_afe.task->comm, this_afe.task->pid); - } return ret; }