aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2006-01-10 22:47:37 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-10 23:35:11 -0500
commit7f52eb009306b8047031eaf64169a7ce437a26e7 (patch)
tree35f7aed7a9305b8c5e6236b71a80cce7670589d5 /arch/powerpc
parentf6cc82fc0b2b6be9ab25f0bfc285e6358db3597a (diff)
[PATCH] spufs: Suspend/restore MFC DMA operations at SPU context switch.
The SPE Book IV indicates that MFC DMA operations must be suspended and restored on SPU context switch (in Step 8). This patch adds that operation, which is missing from the current spufs implementation. Signed-off-by: Masato Noguchi <Masato.Noguchi@jp.sony.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Acked-by: Arnd Bergmann <arndb@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 1061c12b2edb..212db28531fa 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -169,11 +169,33 @@ static inline void save_mfc_cntl(struct spu_state *csa, struct spu *spu)
169 struct spu_priv2 __iomem *priv2 = spu->priv2; 169 struct spu_priv2 __iomem *priv2 = spu->priv2;
170 170
171 /* Save, Step 8: 171 /* Save, Step 8:
172 * Read and save MFC_CNTL[Ss]. 172 * Suspend DMA and save MFC_CNTL.
173 */ 173 */
174 if (csa) { 174 switch (in_be64(&priv2->mfc_control_RW) &
175 csa->priv2.mfc_control_RW = in_be64(&priv2->mfc_control_RW) & 175 MFC_CNTL_SUSPEND_DMA_STATUS_MASK) {
176 MFC_CNTL_SUSPEND_DMA_STATUS_MASK; 176 case MFC_CNTL_SUSPEND_IN_PROGRESS:
177 POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) &
178 MFC_CNTL_SUSPEND_DMA_STATUS_MASK) ==
179 MFC_CNTL_SUSPEND_COMPLETE);
180 /* fall through */
181 case MFC_CNTL_SUSPEND_COMPLETE:
182 if (csa) {
183 csa->priv2.mfc_control_RW =
184 in_be64(&priv2->mfc_control_RW) |
185 MFC_CNTL_SUSPEND_DMA_QUEUE;
186 }
187 break;
188 case MFC_CNTL_NORMAL_DMA_QUEUE_OPERATION:
189 out_be64(&priv2->mfc_control_RW, MFC_CNTL_SUSPEND_DMA_QUEUE);
190 POLL_WHILE_FALSE((in_be64(&priv2->mfc_control_RW) &
191 MFC_CNTL_SUSPEND_DMA_STATUS_MASK) ==
192 MFC_CNTL_SUSPEND_COMPLETE);
193 if (csa) {
194 csa->priv2.mfc_control_RW =
195 in_be64(&priv2->mfc_control_RW) &
196 ~MFC_CNTL_SUSPEND_DMA_QUEUE;
197 }
198 break;
177 } 199 }
178} 200}
179 201
@@ -237,6 +259,8 @@ static inline void save_mfc_decr(struct spu_state *csa, struct spu *spu)
237 eieio(); 259 eieio();
238 csa->spu_chnldata_RW[7] = in_be64(&priv2->spu_chnldata_RW); 260 csa->spu_chnldata_RW[7] = in_be64(&priv2->spu_chnldata_RW);
239 eieio(); 261 eieio();
262 } else {
263 csa->priv2.mfc_control_RW &= ~MFC_CNTL_DECREMENTER_RUNNING;
240 } 264 }
241} 265}
242 266