Re: [patch 32/38] powerpc/spufs: Use mftb() directly

From: Christophe Leroy (CS GROUP)

Date: Wed Apr 15 2026 - 02:42:03 EST




Le 10/04/2026 à 14:21, Thomas Gleixner a écrit :
There is no reason to indirect via get_cycles(), which is about to be
removed.

Use mftb() directly.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxx>
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Cc: linuxppc-dev@xxxxxxxxxxxxxxxx

Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@xxxxxxxxxx>

---
arch/powerpc/platforms/cell/spufs/switch.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -34,6 +34,7 @@
#include <asm/spu_priv1.h>
#include <asm/spu_csa.h>
#include <asm/mmu_context.h>
+#include <asm/time.h>
#include "spufs.h"
@@ -279,7 +280,7 @@ static inline void save_timebase(struct
* Read PPE Timebase High and Timebase low registers
* and save in CSA. TBD.
*/
- csa->suspend_time = get_cycles();
+ csa->suspend_time = mftb();
}
static inline void remove_other_spu_access(struct spu_state *csa,
@@ -1261,7 +1262,7 @@ static inline void setup_decr(struct spu
* in LSCSA.
*/
if (csa->priv2.mfc_control_RW & MFC_CNTL_DECREMENTER_RUNNING) {
- cycles_t resume_time = get_cycles();
+ cycles_t resume_time = mftb();
cycles_t delta_time = resume_time - csa->suspend_time;
csa->lscsa->decr_status.slot[0] = SPU_DECR_STATUS_RUNNING;