From 11f81b0d62b43e113ea6b04257f3edc063d2e6c6 Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Mon, 9 Feb 2015 13:36:14 -0700 Subject: [PATCH] dp: tx: Modified waiting on AUX reply to operate on REPLY_STATUS. AUX reply now makes use of the REPLY_STATUS register rather than INTERRUPT_STATUS. It seems that INTERRUPT_STATUS may be updated before REPLY_STATUS gets updated, resulting in a race condition. Signed-off-by: Andrei-Liviu Simion --- XilinxProcessorIPLib/drivers/dp/src/xdp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp.c b/XilinxProcessorIPLib/drivers/dp/src/xdp.c index 4af90d04..25a7354b 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp.c +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp.c @@ -3044,15 +3044,19 @@ static u32 XDp_TxAuxWaitReply(XDp *InstancePtr) while (0 < Timeout) { Status = XDp_ReadReg(InstancePtr->Config.BaseAddr, - XDP_TX_INTERRUPT_STATUS); + XDP_TX_REPLY_STATUS); - /* Check for a timeout. */ - if (Status & XDP_TX_INTERRUPT_STATUS_REPLY_TIMEOUT_MASK) { + /* Check for error. */ + if (Status & XDP_TX_REPLY_STATUS_REPLY_ERROR_MASK) { return XST_ERROR_COUNT_MAX; } /* Check for a reply. */ - if (Status & XDP_TX_INTERRUPT_STATUS_REPLY_RECEIVED_MASK) { + if ((Status & XDP_TX_REPLY_STATUS_REPLY_RECEIVED_MASK) && + !(Status & + XDP_TX_REPLY_STATUS_REQUEST_IN_PROGRESS_MASK) && + !(Status & + XDP_TX_REPLY_STATUS_REPLY_IN_PROGRESS_MASK)) { return XST_SUCCESS; }