diff options
author | Kazunori Asayama <asayama@sm.sony.co.jp> | 2007-06-28 20:58:09 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-07-03 01:24:47 -0400 |
commit | 8d038e0433e3164e460c2daeca1ec6947a08f81a (patch) | |
tree | 577aa1a6aedfe1a16a01352ab25b07bfcac94514 | |
parent | 933b0e35247ef0dbd1a078a0ba3705ddbbda129f (diff) |
[POWERPC] spufs: Save dma_tagstatus_R in CSA
The function backing_ops->read_mfc_tagstatus() doesn't return a
correct value because the dma_tagstatus_R register isn't saved in
CSA. This fixes the problem.
Signed-off-by: Kazunori Asayama <asayama@sm.sony.co.jp>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/backing_ops.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/switch.c | 14 |
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/backing_ops.c b/arch/powerpc/platforms/cell/spufs/backing_ops.c index d32db9ffc6eb..07a0e815abf5 100644 --- a/arch/powerpc/platforms/cell/spufs/backing_ops.c +++ b/arch/powerpc/platforms/cell/spufs/backing_ops.c | |||
@@ -320,6 +320,12 @@ static int spu_backing_set_mfc_query(struct spu_context * ctx, u32 mask, | |||
320 | /* FIXME: what are the side-effects of this? */ | 320 | /* FIXME: what are the side-effects of this? */ |
321 | prob->dma_querymask_RW = mask; | 321 | prob->dma_querymask_RW = mask; |
322 | prob->dma_querytype_RW = mode; | 322 | prob->dma_querytype_RW = mode; |
323 | /* In the current implementation, the SPU context is always | ||
324 | * acquired in runnable state when new bits are added to the | ||
325 | * mask (tagwait), so it's sufficient just to mask | ||
326 | * dma_tagstatus_R with the 'mask' parameter here. | ||
327 | */ | ||
328 | ctx->csa.prob.dma_tagstatus_R &= mask; | ||
323 | out: | 329 | out: |
324 | spin_unlock(&ctx->csa.register_lock); | 330 | spin_unlock(&ctx->csa.register_lock); |
325 | 331 | ||
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c index 881485847ac0..9c506ba08cdc 100644 --- a/arch/powerpc/platforms/cell/spufs/switch.c +++ b/arch/powerpc/platforms/cell/spufs/switch.c | |||
@@ -387,6 +387,19 @@ static inline void save_ppu_querytype(struct spu_state *csa, struct spu *spu) | |||
387 | csa->prob.dma_querytype_RW = in_be32(&prob->dma_querytype_RW); | 387 | csa->prob.dma_querytype_RW = in_be32(&prob->dma_querytype_RW); |
388 | } | 388 | } |
389 | 389 | ||
390 | static inline void save_ppu_tagstatus(struct spu_state *csa, struct spu *spu) | ||
391 | { | ||
392 | struct spu_problem __iomem *prob = spu->problem; | ||
393 | |||
394 | /* Save the Prxy_TagStatus register in the CSA. | ||
395 | * | ||
396 | * It is unnecessary to restore dma_tagstatus_R, however, | ||
397 | * dma_tagstatus_R in the CSA is accessed via backing_ops, so | ||
398 | * we must save it. | ||
399 | */ | ||
400 | csa->prob.dma_tagstatus_R = in_be32(&prob->dma_tagstatus_R); | ||
401 | } | ||
402 | |||
390 | static inline void save_mfc_csr_tsq(struct spu_state *csa, struct spu *spu) | 403 | static inline void save_mfc_csr_tsq(struct spu_state *csa, struct spu *spu) |
391 | { | 404 | { |
392 | struct spu_priv2 __iomem *priv2 = spu->priv2; | 405 | struct spu_priv2 __iomem *priv2 = spu->priv2; |
@@ -1812,6 +1825,7 @@ static void save_csa(struct spu_state *prev, struct spu *spu) | |||
1812 | save_mfc_queues(prev, spu); /* Step 19. */ | 1825 | save_mfc_queues(prev, spu); /* Step 19. */ |
1813 | save_ppu_querymask(prev, spu); /* Step 20. */ | 1826 | save_ppu_querymask(prev, spu); /* Step 20. */ |
1814 | save_ppu_querytype(prev, spu); /* Step 21. */ | 1827 | save_ppu_querytype(prev, spu); /* Step 21. */ |
1828 | save_ppu_tagstatus(prev, spu); /* NEW. */ | ||
1815 | save_mfc_csr_tsq(prev, spu); /* Step 22. */ | 1829 | save_mfc_csr_tsq(prev, spu); /* Step 22. */ |
1816 | save_mfc_csr_cmd(prev, spu); /* Step 23. */ | 1830 | save_mfc_csr_cmd(prev, spu); /* Step 23. */ |
1817 | save_mfc_csr_ato(prev, spu); /* Step 24. */ | 1831 | save_mfc_csr_ato(prev, spu); /* Step 24. */ |