[Cbe-oss-dev] [PATCH] spufs: Avoid restarting MFC in context saving
Kazunori Asayama
asayama at sm.sony.co.jp
Mon Jul 2 21:31:40 EST 2007
The current SPU context saving procedure in SPUFS unexpectedly
restarts MFC when halting decrementer, because MFC_CNTL[Dh] is set
without MFC_CNTL[Sm]. This bug causes, for example, saving broken DMA
queues. This is a patch to fix the problem.
Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>
---
arch/powerpc/platforms/cell/spufs/switch.c | 3 ++-
include/asm-powerpc/spu.h | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
Index: b/arch/powerpc/platforms/cell/spufs/switch.c
===================================================================
--- a/arch/powerpc/platforms/cell/spufs/switch.c 2007-06-29 17:15:14.000000000 +0900
+++ b/arch/powerpc/platforms/cell/spufs/switch.c 2007-06-29 19:32:17.000000000 +0900
@@ -271,7 +271,8 @@ static inline void halt_mfc_decr(struct
* Write MFC_CNTL[Dh] set to a '1' to halt
* the decrementer.
*/
- out_be64(&priv2->mfc_control_RW, MFC_CNTL_DECREMENTER_HALTED);
+ out_be64(&priv2->mfc_control_RW,
+ MFC_CNTL_DECREMENTER_HALTED | MFC_CNTL_SUSPEND_DMA_QUEUE_DISABLED);
eieio();
}
Index: b/include/asm-powerpc/spu.h
===================================================================
--- a/include/asm-powerpc/spu.h 2007-06-18 15:42:02.000000000 +0900
+++ b/include/asm-powerpc/spu.h 2007-06-29 17:17:34.000000000 +0900
@@ -380,6 +380,7 @@ struct spu_priv2 {
#define MFC_CNTL_RESUME_DMA_QUEUE (0ull << 0)
#define MFC_CNTL_SUSPEND_DMA_QUEUE (1ull << 0)
#define MFC_CNTL_SUSPEND_DMA_QUEUE_MASK (1ull << 0)
+#define MFC_CNTL_SUSPEND_DMA_QUEUE_DISABLED (1ull << 4)
#define MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION (0ull << 8)
#define MFC_CNTL_SUSPEND_IN_PROGRESS (1ull << 8)
#define MFC_CNTL_SUSPEND_COMPLETE (3ull << 8)
More information about the cbe-oss-dev
mailing list