diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/switch.c | 34 |
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 | ||