]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
powerpc: handle new __get_cpu_var calls in 3.14
authorChristoph Lameter <cl@linux.com>
Thu, 6 Mar 2014 00:05:29 +0000 (11:05 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 6 Mar 2014 07:13:53 +0000 (18:13 +1100)
Signed-off-by: Christoph Lameter <cl@linux.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/powerpc/kernel/irq.c
arch/powerpc/kernel/kgdb.c
arch/powerpc/kernel/mce.c
arch/powerpc/kernel/time.c
arch/powerpc/mm/hugetlbpage-book3e.c

index ab6ece12d2e5bfa7f8d88c4bd4693402819b10e7..53f9f28657b19335c3d6f3e2fa3ee7f377b1bfc9 100644 (file)
@@ -486,7 +486,7 @@ void __do_irq(struct pt_regs *regs)
 
        /* And finally process it */
        if (unlikely(irq == NO_IRQ))
-               __get_cpu_var(irq_stat).spurious_irqs++;
+               __this_cpu_inc(irq_stat.spurious_irqs);
        else {
                desc = irq_to_desc(irq);
                if (likely(desc))
index 8504657379f13fe7858f08b9f4f61ea4e23ecb92..e77c3ccf8dcfe432c6f7e7b761cb64a67afa3bed 100644 (file)
@@ -155,7 +155,7 @@ static int kgdb_singlestep(struct pt_regs *regs)
 {
        struct thread_info *thread_info, *exception_thread_info;
        struct thread_info *backup_current_thread_info =
-               &__get_cpu_var(kgdb_thread_info);
+               this_cpu_ptr(&kgdb_thread_info);
 
        if (user_mode(regs))
                return 0;
index cadef7e64e4245e816f0878c63ebab43855c15c2..a9bf88affe79d11ba530f3582e894bfc53a7a117 100644 (file)
@@ -73,8 +73,8 @@ void save_mce_event(struct pt_regs *regs, long handled,
                    uint64_t addr)
 {
        uint64_t srr1;
-       int index = __get_cpu_var(mce_nest_count)++;
-       struct machine_check_event *mce = &__get_cpu_var(mce_event[index]);
+       int index = __this_cpu_inc_return(mce_nest_count);
+       struct machine_check_event *mce = __this_cpu_read(mce_event[index]);
 
        /*
         * Return if we don't have enough space to log mce event.
@@ -143,7 +143,7 @@ void save_mce_event(struct pt_regs *regs, long handled,
  */
 int get_mce_event(struct machine_check_event *mce, bool release)
 {
-       int index = __get_cpu_var(mce_nest_count) - 1;
+       int index = __this_cpu_read(mce_nest_count) - 1;
        struct machine_check_event *mc_evt;
        int ret = 0;
 
@@ -153,7 +153,7 @@ int get_mce_event(struct machine_check_event *mce, bool release)
 
        /* Check if we have MCE info to process. */
        if (index < MAX_MC_EVT) {
-               mc_evt = &__get_cpu_var(mce_event[index]);
+               mc_evt = __this_cpu_read(mce_event[index]);
                /* Copy the event structure and release the original */
                if (mce)
                        *mce = *mc_evt;
@@ -163,7 +163,7 @@ int get_mce_event(struct machine_check_event *mce, bool release)
        }
        /* Decrement the count to free the slot. */
        if (release)
-               __get_cpu_var(mce_nest_count)--;
+               __this_cpu_dec(mce_nest_count);
 
        return ret;
 }
@@ -184,13 +184,13 @@ void machine_check_queue_event(void)
        if (!get_mce_event(&evt, MCE_EVENT_RELEASE))
                return;
 
-       index = __get_cpu_var(mce_queue_count)++;
+       index = __this_cpu_inc_return(mce_queue_count);
        /* If queue is full, just return for now. */
        if (index >= MAX_MC_EVT) {
-               __get_cpu_var(mce_queue_count)--;
+               __this_cpu_dec(mce_queue_count);
                return;
        }
-       __get_cpu_var(mce_event_queue[index]) = evt;
+       __this_cpu_write(mce_event_queue[index], evt);
 
        /* Queue irq work to process this event later. */
        irq_work_queue(&mce_event_process_work);
@@ -208,11 +208,11 @@ static void machine_check_process_queued_event(struct irq_work *work)
         * For now just print it to console.
         * TODO: log this error event to FSP or nvram.
         */
-       while (__get_cpu_var(mce_queue_count) > 0) {
-               index = __get_cpu_var(mce_queue_count) - 1;
+       while (__this_cpu_read(mce_queue_count) > 0) {
+               index = __this_cpu_read(mce_queue_count) - 1;
                machine_check_print_event_info(
-                               &__get_cpu_var(mce_event_queue[index]));
-               __get_cpu_var(mce_queue_count)--;
+                               this_cpu_ptr(&mce_event_queue[index]));
+               __this_cpu_dec(mce_queue_count);
        }
 }
 
index 467197217be1b50e04e12bc87fa2988fdb31ba8a..5225d8679a835fb417c05b9310c5fab11dcca7e0 100644 (file)
@@ -531,7 +531,7 @@ void timer_interrupt(struct pt_regs * regs)
                *next_tb = ~(u64)0;
                if (evt->event_handler)
                        evt->event_handler(evt);
-               __get_cpu_var(irq_stat).timer_irqs_event++;
+               __this_cpu_inc(irq_stat.timer_irqs_event);
        } else {
                now = *next_tb - now;
                if (now <= DECREMENTER_MAX)
@@ -539,7 +539,7 @@ void timer_interrupt(struct pt_regs * regs)
                /* We may have raced with new irq work */
                if (test_irq_work_pending())
                        set_dec(1);
-               __get_cpu_var(irq_stat).timer_irqs_others++;
+               __this_cpu_inc(irq_stat.timer_irqs_others);
        }
 
 #ifdef CONFIG_PPC64
index 1d590e38ee03febaf6a37dd1b4bea8ee17e91dad..ba47aaf33a4bf19c19859fc0de1ed1ad05703c53 100644 (file)
@@ -33,7 +33,7 @@ static inline int tlb1_next(void)
 
        ncams = mfspr(SPRN_TLB1CFG) & TLBnCFG_N_ENTRY;
 
-       index = __get_cpu_var(next_tlbcam_idx);
+       index = this_cpu_read(next_tlbcam_idx);
 
        /* Just round-robin the entries and wrap when we hit the end */
        if (unlikely(index == ncams - 1))