[PATCH 00/13] spufs fixes and cleanups

Geoff Levand geoffrey.levand at am.sony.com
Wed Jan 11 07:19:32 EST 2006


Arnd Bergmann wrote:
> In a review almost a month ago, Al Viro found numerous
> problems in the current spufs code. I now finally found
> some time to go through those and attempt to fix them.
> 
> There are also a few other changes in this series that
> should also help, in particular improved interrupt
> sending and an abstraction for priviledged register
> access (as suggested by  Masato Noguchi and Geoff Levand).
> 
> Please apply to powerpc.git before sending spufs upstream.
> 
> Al, could you have a look over this to see if it addresses
> all the concerns you had and if I broke it in new ways?
> 
> 	Arnd <><
> 
>  arch/powerpc/platforms/cell/Makefile         |    5
>  arch/powerpc/platforms/cell/interrupt.c      |   42 ++--
>  arch/powerpc/platforms/cell/interrupt.h      |    1
>  arch/powerpc/platforms/cell/spu_base.c       |   67 +++----
>  arch/powerpc/platforms/cell/spu_priv1.c      |  133 ++++++++++++++
>  arch/powerpc/platforms/cell/spufs/Makefile   |    2
>  arch/powerpc/platforms/cell/spufs/file.c     |  167 +----------------
>  arch/powerpc/platforms/cell/spufs/hw_ops.c   |   19 --
>  arch/powerpc/platforms/cell/spufs/inode.c    |  156 ++++++++-------
>  arch/powerpc/platforms/cell/spufs/run.c      |  131 ++++++++++++++
>  arch/powerpc/platforms/cell/spufs/sched.c    |   13 +
>  arch/powerpc/platforms/cell/spufs/spufs.h    |   35 +++
>  arch/powerpc/platforms/cell/spufs/switch.c   |  139 +++++----------
>  arch/powerpc/platforms/cell/spufs/syscalls.c |    5
>  arch/powerpc/platforms/cell/spufs/context.c  |   11 -
>  include/asm-powerpc/spu.h                    |   42 +++-
>   20 files changed, 565 insertions(+), 407 deletions(-)
> 
> 

Arnd,

I didn't see the fix I sent you (also below) to stop
DMA at spu context save in your latest patches.  You
mentioned that Mark may cover that fix in his
preemptive scheduler work.  Did he put it in a
routine called earlier?  Please let me know.

-Geoff

spufs: stop dma at context save.

There is no code to suspend dma queue on context save.
SPE Book4 shows that context save's step8 is required to suspend dma
and save MFC_CNTL.

Signed-off-by: Masato Noguchi <Masato.Noguchi at jp.sony.com>
Signed-off-by: Geoff Levand <geoff.levand at am.sony.com>


Index: linux-2.6.15-cell/arch/powerpc/platforms/cell/spufs/switch.c
===================================================================
--- linux-2.6.15-cell.orig/arch/powerpc/platforms/cell/spufs/switch.c	2005-12-02 15:59:28.000000000 -0800
+++ linux-2.6.15-cell/arch/powerpc/platforms/cell/spufs/switch.c	2005-12-02 16:06:11.000000000 -0800
@@ -174,11 +174,33 @@
 	struct spu_priv2 __iomem *priv2 = spu->priv2;

 	/* Save, Step 8:
-	 *     Read and save MFC_CNTL[Ss].
+	 *     Suspend DMA and save MFC_CNTL.
 	 */
-	if (csa) {
-		csa->priv2.mfc_control_RW = in_be64(&priv2->mfc_control_RW) &
-		    MFC_CNTL_SUSPEND_DMA_STATUS_MASK;
+	switch (in_be64(&priv2->mfc_control_RW) &
+	       MFC_CNTL_SUSPEND_DMA_STATUS_MASK) {
+	case MFC_CNTL_SUSPEND_IN_PROGRESS:
+		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;
+		}
+		break;
+	case MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION:
+		out_be64(&priv2->mfc_control_RW, MFC_CNTL_SUSPEND_DMA_QUEUE);
+		POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) &
+				  MFC_CNTL_SUSPEND_DMA_STATUS_MASK) ==
+				 MFC_CNTL_SUSPEND_COMPLETE);
+		if (csa) {
+			csa->priv2.mfc_control_RW =
+				in_be64(&priv2->mfc_control_RW) &
+				~MFC_CNTL_SUSPEND_DMA_QUEUE;
+		}
+		break;
 	}
 }

@@ -244,6 +266,8 @@
 		eieio();
 		csa->spu_chnldata_RW[7] = in_be64(&priv2->spu_chnldata_RW);
 		eieio();
+	} else {
+		csa->priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING;
 	}
 }





More information about the Linuxppc64-dev mailing list