[Cbe-oss-dev] [PATCH 1/2]MARS/base: retry mbox read

Yuji Mano yuji.mano at am.sony.com
Wed Feb 18 09:56:00 EST 2009


From: Kazunori Asayama <asayama at sm.sony.co.jp>

Retry to read mbox on error

This patch modifies handler thread to retry access to mailboxes on
error so that handler thread doesn't fail with debugger.

Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>
---
 base/src/host/lib/mpu_cell.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

Index: b/base/src/host/lib/mpu_cell.c
===================================================================
--- a/base/src/host/lib/mpu_cell.c	2009-02-16 15:34:20.000000000 +0900
+++ b/base/src/host/lib/mpu_cell.c	2009-02-16 15:43:24.000000000 +0900
@@ -115,12 +115,16 @@ static void *mpu_handler_thread(void *ar
 
 		ret = spe_out_intr_mbox_read(spe, &ea_l, 1,
 					     SPE_MBOX_ANY_BLOCKING);
-		if (ret < 1)
+		if (ret == 0)
 			goto error;
+		else if (ret == -1)
+			continue;
 
-		ret = spe_out_mbox_read(spe, &ea_h, 1);
-		if (ret != 1)
-			goto error;
+		do {
+			ret = spe_out_mbox_read(spe, &ea_h, 1);
+			if (ret == -1 && errno != EINTR)
+				goto error;
+		} while (ret != 1);
 
 		ea = ((uint64_t)ea_h << 32) | ea_l;
 		if (ea == MARS_HOST_SIGNAL_EXIT)






More information about the cbe-oss-dev mailing list