From b92543291c187dcc985f85692ee34b252d29193a Mon Sep 17 00:00:00 2001 From: "vwan@ti.com" Date: Fri, 14 Feb 2014 17:33:27 -0800 Subject: [PATCH] VAYU QNX: Prevent race condition when host is slow to clear interrupts from IPU This commit prevents the same race condition that was fixed in commit id feb7a8486ed537033c5aed5b170f52f758bddabe, this time for the IPUs as the other commit only dealt with the DSP. Signed-off-by: VW --- packages/ti/sdo/ipc/family/vayu/InterruptIpu.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/ti/sdo/ipc/family/vayu/InterruptIpu.c b/packages/ti/sdo/ipc/family/vayu/InterruptIpu.c index 899be76..615fd73 100644 --- a/packages/ti/sdo/ipc/family/vayu/InterruptIpu.c +++ b/packages/ti/sdo/ipc/family/vayu/InterruptIpu.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Texas Instruments Incorporated + * Copyright (c) 2013-2014, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -467,9 +467,11 @@ Void InterruptIpu_intSend(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo, else { index = MBX_TABLE_IDX(MultiProc_self(), remoteProcId); key = Hwi_disable(); - if (REG32(MAILBOX_STATUS(index)) == 0) { - REG32(MAILBOX_MESSAGE(index)) = arg; + while (REG32(MAILBOX_STATUS(index)) != 0) { + Hwi_restore(key); + key = Hwi_disable(); } + REG32(MAILBOX_MESSAGE(index)) = arg; Hwi_restore(key); } } @@ -488,9 +490,11 @@ Void InterruptIpu_intSend(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo, else { index = MBX_TABLE_IDX(MultiProc_self(), remoteProcId); key = Hwi_disable(); - if (REG32(MAILBOX_STATUS(index)) == 0) { - REG32(MAILBOX_MESSAGE(index)) = arg; + while (REG32(MAILBOX_STATUS(index)) != 0) { + Hwi_restore(key); + key = Hwi_disable(); } + REG32(MAILBOX_MESSAGE(index)) = arg; Hwi_restore(key); } } -- 2.39.2