Skip to content

Commit

Permalink
powerpc/83xx: Fix build failure with FPU=n
Browse files Browse the repository at this point in the history
Building eg. 83xx/mpc832x_rdb_defconfig with FPU=n, fails with:

  arch/powerpc/platforms/83xx/suspend.c: In function 'mpc83xx_suspend_enter':
  arch/powerpc/platforms/83xx/suspend.c:209:17: error: implicit declaration of function 'enable_kernel_fp'
    209 |                 enable_kernel_fp();

Fix it by providing an enable_kernel_fp() stub for FPU=n builds,
which allows using IS_ENABLED(CONFIG_PPC_FPU) around the call to
enable_kernel_fp().

Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/[email protected]
  • Loading branch information
mpe committed Mar 7, 2024
1 parent 329105c commit c2e5d70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions arch/powerpc/include/asm/switch_to.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ static inline void disable_kernel_fp(void)
#else
static inline void save_fpu(struct task_struct *t) { }
static inline void flush_fp_to_thread(struct task_struct *t) { }
static inline void enable_kernel_fp(void)
{
BUILD_BUG();
}
#endif

#ifdef CONFIG_ALTIVEC
Expand Down
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/83xx/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ static int mpc83xx_suspend_enter(suspend_state_t state)
out_be32(&pmc_regs->config1,
in_be32(&pmc_regs->config1) | PMCCR1_POWER_OFF);

enable_kernel_fp();
if (IS_ENABLED(CONFIG_PPC_FPU))
enable_kernel_fp();

mpc83xx_enter_deep_sleep(immrbase);

Expand Down

0 comments on commit c2e5d70

Please sign in to comment.