Skip to content

Commit 2183aed

Browse files
committed
ipc: Fix false positive IPC dropped messages.
On receiving an IPC IRQ the handler currently does not check the IRQ mask. This means notification received ACKs (i.e. for trace updates) from the host may be reported as duplicate host command IPCs. Fix this by checking IPC IRQ mask. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
1 parent 894886a commit 2183aed

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/ipc/apl-ipc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,21 @@ static void irq_handler(void *arg)
5959
{
6060
uint32_t dipct;
6161
uint32_t dipcie;
62+
uint32_t dipcctl;
6263
uint32_t msg = 0;
6364

6465
dipct = ipc_read(IPC_DIPCT);
6566
dipcie = ipc_read(IPC_DIPCIE);
67+
dipcctl = ipc_read(IPC_DIPCCTL);
6668

67-
tracev_ipc("ipc: irq dipct 0x%x dipcie 0x%x", dipct, dipcie);
69+
tracev_ipc("ipc: irq dipct 0x%x dipcie 0x%x dipcctl 0x%x", dipct,
70+
dipcie, dipcctl);
6871

6972
/* new message from host */
70-
if (dipct & IPC_DIPCT_BUSY) {
73+
if (dipct & IPC_DIPCT_BUSY && dipcctl & IPC_DIPCCTL_IPCTBIE) {
7174

7275
/* mask Busy interrupt */
73-
ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) & ~IPC_DIPCCTL_IPCTBIE);
76+
ipc_write(IPC_DIPCCTL, dipcctl & ~IPC_DIPCCTL_IPCTBIE);
7477

7578
msg = dipct & IPC_DIPCT_MSG_MASK;
7679

src/ipc/cnl-ipc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,21 @@ static void irq_handler(void *arg)
6060
{
6161
uint32_t dipctdr;
6262
uint32_t dipcida;
63+
uint32_t dipcctl;
6364
uint32_t msg = 0;
6465

6566
dipctdr = ipc_read(IPC_DIPCTDR);
6667
dipcida = ipc_read(IPC_DIPCIDA);
68+
dipcctl = ipc_read(IPC_DIPCCTL);
6769

68-
tracev_ipc("ipc: irq dipctdr 0x%x dipcida 0x%x", dipctdr, dipcida);
70+
tracev_ipc("ipc: irq dipct 0x%x dipcie 0x%x dipcctl 0x%x", dipct,
71+
dipcie, dipcctl);
6972

7073
/* new message from host */
71-
if (dipctdr & IPC_DIPCTDR_BUSY) {
74+
if (dipctdr & IPC_DIPCTDR_BUSY && dipcctl & IPC_DIPCCTL_IPCTBIE) {
7275

7376
/* mask Busy interrupt */
74-
ipc_write(IPC_DIPCCTL, ipc_read(IPC_DIPCCTL) & ~IPC_DIPCCTL_IPCTBIE);
77+
ipc_write(IPC_DIPCCTL, dipcctl & ~IPC_DIPCCTL_IPCTBIE);
7578

7679
msg = dipctdr & IPC_DIPCTDR_MSG_MASK;
7780

0 commit comments

Comments
 (0)