mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
dsp: afe: Add new token to handle nowait cmds
Race condition is observed when sending afe cmd and afe nowait cmd one after other resulting in incorrect interpretation of the adsp responses received back to back. Handle this by adding a new data token for nowait commands to indentify the response recevied is for the same. Change-Id: I76bf810c23d1fd572cb496c62cbfaac1a5c349b5 Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
This commit is contained in:
parent
78fff06931
commit
c98cda65d3
1 changed files with 7 additions and 7 deletions
14
dsp/q6afe.c
14
dsp/q6afe.c
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#define WAKELOCK_TIMEOUT 5000
|
||||
#define AFE_CLK_TOKEN 1024
|
||||
#define AFE_NOWAIT_TOKEN 2048
|
||||
|
||||
#define SP_V4_NUM_MAX_SPKRS SP_V2_NUM_MAX_SPKRS
|
||||
|
||||
|
|
@ -1082,7 +1083,7 @@ static int32_t afe_callback(struct apr_client_data *data, void *priv)
|
|||
if(data->token == AFE_CLK_TOKEN) {
|
||||
atomic_set(&this_afe.clk_state, 0);
|
||||
wake_up(&this_afe.clk_wait);
|
||||
} else {
|
||||
} else if(data->token != AFE_NOWAIT_TOKEN) {
|
||||
atomic_set(&this_afe.state, 0);
|
||||
if (afe_token_is_valid(data->token))
|
||||
wake_up(&this_afe.wait[data->token]);
|
||||
|
|
@ -6932,7 +6933,7 @@ int afe_pseudo_port_start_nowait(u16 port_id)
|
|||
start.hdr.pkt_size = sizeof(start);
|
||||
start.hdr.src_port = 0;
|
||||
start.hdr.dest_port = 0;
|
||||
start.hdr.token = 0;
|
||||
start.hdr.token = AFE_NOWAIT_TOKEN;
|
||||
start.hdr.opcode = AFE_PSEUDOPORT_CMD_START;
|
||||
start.port_id = port_id;
|
||||
start.timing = 1;
|
||||
|
|
@ -7021,11 +7022,10 @@ int afe_pseudo_port_stop_nowait(u16 port_id)
|
|||
stop.hdr.pkt_size = sizeof(stop);
|
||||
stop.hdr.src_port = 0;
|
||||
stop.hdr.dest_port = 0;
|
||||
stop.hdr.token = 0;
|
||||
stop.hdr.token = AFE_NOWAIT_TOKEN;
|
||||
stop.hdr.opcode = AFE_PSEUDOPORT_CMD_STOP;
|
||||
stop.port_id = port_id;
|
||||
stop.reserved = 0;
|
||||
stop.hdr.token = index;
|
||||
|
||||
ret = afe_apr_send_pkt(&stop, NULL);
|
||||
if (ret)
|
||||
|
|
@ -7538,7 +7538,7 @@ int afe_cmd_memory_map_nowait(int port_id, phys_addr_t dma_addr_p,
|
|||
mregion->hdr.pkt_size = sizeof(mregion);
|
||||
mregion->hdr.src_port = 0;
|
||||
mregion->hdr.dest_port = 0;
|
||||
mregion->hdr.token = 0;
|
||||
mregion->hdr.token = AFE_NOWAIT_TOKEN;
|
||||
mregion->hdr.opcode = AFE_SERVICE_CMD_SHARED_MEM_MAP_REGIONS;
|
||||
mregion->mem_pool_id = ADSP_MEMORY_MAP_SHMEM8_4K_POOL;
|
||||
mregion->num_regions = 1;
|
||||
|
|
@ -7707,7 +7707,7 @@ int afe_cmd_memory_unmap_nowait(u32 mem_map_handle)
|
|||
mregion.hdr.pkt_size = sizeof(mregion);
|
||||
mregion.hdr.src_port = 0;
|
||||
mregion.hdr.dest_port = 0;
|
||||
mregion.hdr.token = 0;
|
||||
mregion.hdr.token = AFE_NOWAIT_TOKEN;
|
||||
mregion.hdr.opcode = AFE_SERVICE_CMD_SHARED_MEM_UNMAP_REGIONS;
|
||||
mregion.mem_map_handle = mem_map_handle;
|
||||
|
||||
|
|
@ -8848,7 +8848,7 @@ int afe_port_stop_nowait(int port_id)
|
|||
stop.hdr.pkt_size = sizeof(stop);
|
||||
stop.hdr.src_port = 0;
|
||||
stop.hdr.dest_port = 0;
|
||||
stop.hdr.token = 0;
|
||||
stop.hdr.token = AFE_NOWAIT_TOKEN;
|
||||
stop.hdr.opcode = AFE_PORT_CMD_DEVICE_STOP;
|
||||
stop.port_id = port_id;
|
||||
stop.reserved = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue