From 7329bd7e91008827b29f58b2cb12a4af5c08fd64 Mon Sep 17 00:00:00 2001 From: Kedareswara rao Appana Date: Thu, 28 May 2015 11:26:21 +0530 Subject: [PATCH] mcap: linux: Fix race condition while programming bitfiles During programming the bit files as per flow in case of errors need to do a full reset of mcap config space. This patch fixes this issue. Signed-off-by: Kedareswara rao Appana --- mcap/linux/mcap_lib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mcap/linux/mcap_lib.c b/mcap/linux/mcap_lib.c index ad540525..f7766123 100644 --- a/mcap/linux/mcap_lib.c +++ b/mcap/linux/mcap_lib.c @@ -275,6 +275,7 @@ static int MCapWritePartialBitStream(struct mcap_dev *mdev, u32 *data, if (IsErrSet(mdev) || IsFifoOverflow(mdev)) { pr_err("Failed to Write Bitstream\n"); MCapRegWrite(mdev, MCAP_CONTROL, restore); + MCapFullReset(mdev); return -EMCAPWRITE; } @@ -340,6 +341,7 @@ static int MCapWriteBitStream(struct mcap_dev *mdev, u32 *data, if (IsErrSet(mdev) || IsFifoOverflow(mdev)) { pr_err("Failed to Write Bitstream\n"); MCapRegWrite(mdev, MCAP_CONTROL, restore); + MCapFullReset(mdev); return -EMCAPWRITE; }