Commit 183b73ae authored by Jordi Caubet's avatar Jordi Caubet Committed by Paul Mackerras

[PATCH] spufs: fix context-switch decrementer code

We found that when the 'decrementer' is saved, the PPE saves the current
time 'csa->suspend_time'. When restoring the 'decrementer', (Step 34)
decrementer seems to be adjusted with the number of cycles th= at a spu
thread has not been running.

In that code it is missing a substract ('-') because 'delta_time' is
assigned a not substracted(see bellow).
Acked-by: default avatarMark Nutter <mnutter@us.ibm.com>
Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent f48b8296
...@@ -1297,7 +1297,7 @@ static inline void setup_decr(struct spu_state *csa, struct spu *spu) ...@@ -1297,7 +1297,7 @@ static inline void setup_decr(struct spu_state *csa, struct spu *spu)
cycles_t resume_time = get_cycles(); cycles_t resume_time = get_cycles();
cycles_t delta_time = resume_time - csa->suspend_time; cycles_t delta_time = resume_time - csa->suspend_time;
csa->lscsa->decr.slot[0] = delta_time; csa->lscsa->decr.slot[0] -= delta_time;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment