powerpc/cell: Use system_wq in cpufreq_spudemand
[pandora-kernel.git] / arch / powerpc / kernel / time.c
index 09e4dea..09d31db 100644 (file)
@@ -265,11 +265,26 @@ void accumulate_stolen_time(void)
 {
        u64 sst, ust;
 
-       sst = scan_dispatch_log(get_paca()->starttime_user);
-       ust = scan_dispatch_log(get_paca()->starttime);
-       get_paca()->system_time -= sst;
-       get_paca()->user_time -= ust;
-       get_paca()->stolen_time += ust + sst;
+       u8 save_soft_enabled = local_paca->soft_enabled;
+       u8 save_hard_enabled = local_paca->hard_enabled;
+
+       /* We are called early in the exception entry, before
+        * soft/hard_enabled are sync'ed to the expected state
+        * for the exception. We are hard disabled but the PACA
+        * needs to reflect that so various debug stuff doesn't
+        * complain
+        */
+       local_paca->soft_enabled = 0;
+       local_paca->hard_enabled = 0;
+
+       sst = scan_dispatch_log(local_paca->starttime_user);
+       ust = scan_dispatch_log(local_paca->starttime);
+       local_paca->system_time -= sst;
+       local_paca->user_time -= ust;
+       local_paca->stolen_time += ust + sst;
+
+       local_paca->soft_enabled = save_soft_enabled;
+       local_paca->hard_enabled = save_hard_enabled;
 }
 
 static inline u64 calculate_stolen_time(u64 stop_tb)