aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/crunch.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/crunch.c')
-rw-r--r--arch/arm/kernel/crunch.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/kernel/crunch.c b/arch/arm/kernel/crunch.c
index 99995c2b2312..769abe15cf91 100644
--- a/arch/arm/kernel/crunch.c
+++ b/arch/arm/kernel/crunch.c
@@ -31,7 +31,7 @@ void crunch_task_release(struct thread_info *thread)
31 31
32static int crunch_enabled(u32 devcfg) 32static int crunch_enabled(u32 devcfg)
33{ 33{
34 return !!(devcfg & EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE); 34 return !!(devcfg & EP93XX_SYSCON_DEVCFG_CPENA);
35} 35}
36 36
37static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t) 37static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
@@ -56,11 +56,16 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
56 break; 56 break;
57 57
58 case THREAD_NOTIFY_SWITCH: 58 case THREAD_NOTIFY_SWITCH:
59 devcfg = __raw_readl(EP93XX_SYSCON_DEVICE_CONFIG); 59 devcfg = __raw_readl(EP93XX_SYSCON_DEVCFG);
60 if (crunch_enabled(devcfg) || crunch_owner == crunch_state) { 60 if (crunch_enabled(devcfg) || crunch_owner == crunch_state) {
61 devcfg ^= EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE; 61 /*
62 * We don't use ep93xx_syscon_swlocked_write() here
63 * because we are on the context switch path and
64 * preemption is already disabled.
65 */
66 devcfg ^= EP93XX_SYSCON_DEVCFG_CPENA;
62 __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK); 67 __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
63 __raw_writel(devcfg, EP93XX_SYSCON_DEVICE_CONFIG); 68 __raw_writel(devcfg, EP93XX_SYSCON_DEVCFG);
64 } 69 }
65 break; 70 break;
66 } 71 }