[Cbe-oss-dev] [PATCH 1:3] spusched: fix the saving of the mfc control register

Luke Browning lukebr at linux.vnet.ibm.com
Fri Apr 25 09:04:03 EST 2008


Fix the save of the mfc-control-register in context switch code

Regardless of whether the context switch code initally detects 
the state of the mfc as being suspend-in-progress or suspend-complete, 
the mfc needs to be resumed with a mfc restart command.  The state 
transitions from normal-> suspending -> suspended is performed 
automatically by the hardware on a fault. The mfc restart command
puts the mfc back into normal execution mode.  The routine 
restore_mfc_cntl in the restore code path checks for the flag 
MFC_CNTL_SUSPEND_DMA_QUEUE in the csa as a trigger for invoking 
the restart command.  It needs to be set for both mfc states: 
suspend-in-progress and suspend-complete.

Signed-off-by: Luke Browning <lukebr at linux.vnet.ibm.com>

---

Index: spufs/arch/powerpc/platforms/cell/spufs/switch.c
===================================================================
--- spufs.orig/arch/powerpc/platforms/cell/spufs/switch.c
+++ spufs/arch/powerpc/platforms/cell/spufs/switch.c
@@ -184,17 +184,13 @@ static inline void save_mfc_cntl(struct 
 		POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) &
 				  MFC_CNTL_SUSPEND_DMA_STATUS_MASK) ==
 				 MFC_CNTL_SUSPEND_COMPLETE);
+	/* Fall through */
+	case MFC_CNTL_SUSPEND_COMPLETE:
 		if (csa)
 			csa->priv2.mfc_control_RW =
 				in_be64(&priv2->mfc_control_RW) |
 				MFC_CNTL_SUSPEND_DMA_QUEUE |
 				MFC_CNTL_SUSPEND_MASK;
-
-		break;
-	case MFC_CNTL_SUSPEND_COMPLETE:
-		if (csa)
-			csa->priv2.mfc_control_RW =
-				in_be64(&priv2->mfc_control_RW);
 		break;
 	case MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION:
 		out_be64(&priv2->mfc_control_RW, MFC_CNTL_SUSPEND_DMA_QUEUE);





More information about the cbe-oss-dev mailing list