Skip to content
Commit af5fb91a authored by Kai Vehmanen's avatar Kai Vehmanen Committed by Anas Nashif
Browse files

soc: intel_adsp: ipc: Do not send message until previous one is acked



Fix a bug where an IPC message is sent while the peer/host ack for
the previous message has not yet been processed. There is existing
logic to check 'idr' INTEL_ADSP_IPC_BUSY bit, but this leaves
the following race:

 - DSP: msg A sent by DSP to host
 - HOST: IRQ, msg A acked, host sets DONE bit -> ADSP_IPC_BUSY cleared
 - DSP: msg B sent by DSP to host, IPC_BUSY is clear so proceeding to send
	-> e.g. 'devdata->sem' is reset --> BUG!
 - DSP: IRQ, msg A done
	-> e.g. call to 'sem_give(&devdata->sem)' which is wrong as
	   the semaphore was just reset in previous step for msg B

Add additional state to track handling of the acks. This allows
to postpone sending message B (in above example), until message A
is fully processed.

Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
parent 10c37a3a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment