Skip to contentSkip to conversation

spufs: fix context-switch decrementer code

PATCH New Arnd Bergmann 1 participant 1 message Apr 12, 2006

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spufs: fix context-switch decrementer code

From: Jordi Caubet <[email protected]>

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).

---

arch/powerpc/platforms/cell/spufs/switch.c +1 -1
Index: linus-2.6/arch/powerpc/platforms/cell/spufs/switch.c
===================================================================
@@ -1299,7 +1299,7 @@ static inline void setup_decr(struct spu
 		cycles_t resume_time = get_cycles();
 		cycles_t delta_time = resume_time - csa->suspend_time;
 
-		csa->lscsa->decr.slot[0] = delta_time;
+		csa->lscsa->decr.slot[0] -= delta_time;
 	}
 }