Pull powerpc fixes from Benjamin Herrenschmidt: "Whenever you have a chance between two dives, you might want to consider pulling my merge branch to pickup a few fixes for 3.8 that have been accumulating for the last couple of weeks (I was myself travelling then on vacation). Nothing major, just a handful of powerpc bug fixes that I consider worth getting in before 3.8 goes final." And I'll have everybody know that I'm not diving for several days yet. Snif. * 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: powerpc: Max next_tb to prevent from replaying timer interrupt powerpc: kernel/kgdb.c: Fix memory leakage powerpc/book3e: Disable interrupt after preempt_schedule_irq powerpc/oprofile: Fix error in oprofile power7_marked_instr_event() function powerpc/pasemi: Fix crash on reboot powerpc: Fix MAX_STACK_TRACE_ENTRIES too low warning for ppc32
Unified · Split
| @@ -439,6 +439,8 @@ ret_from_fork: · 438 unmodified lines | |||
| 439 | ret_from_kernel_thread: | 439 | ret_from_kernel_thread: |
| 440 | REST_NVGPRS(r1) | 440 | REST_NVGPRS(r1) |
| 441 | bl schedule_tail | 441 | bl schedule_tail |
| 442 | li r3,0 | ||
| 443 | stw r3,0(r1) | ||
| 442 | mtlr r14 | 444 | mtlr r14 |
| 443 | mr r3,r15 | 445 | mr r3,r15 |
| 444 | PPC440EP_ERR42 | 446 | PPC440EP_ERR42 |
| @@ -664,6 +664,19 @@ resume_kernel: · 663 unmodified lines | |||
| 664 | ld r4,TI_FLAGS(r9) | 664 | ld r4,TI_FLAGS(r9) |
| 665 | andi. r0,r4,_TIF_NEED_RESCHED | 665 | andi. r0,r4,_TIF_NEED_RESCHED |
| 666 | bne 1b | 666 | bne 1b |
| 667 | |||
| 668 | /* | ||
| 669 | * arch_local_irq_restore() from preempt_schedule_irq above may | ||
| 670 | * enable hard interrupt but we really should disable interrupts | ||
| 671 | * when we return from the interrupt, and so that we don't get | ||
| 672 | * interrupted after loading SRR0/1. | ||
| 673 | */ | ||
| 674 | #ifdef CONFIG_PPC_BOOK3E | ||
| 675 | wrteei 0 | ||
| 676 | #else | ||
| 677 | ld r10,PACAKMSR(r13) /* Get kernel MSR without EE */ | ||
| 678 | mtmsrd r10,1 /* Update machine state */ | ||
| 679 | #endif /* CONFIG_PPC_BOOK3E */ | ||
| 667 | #endif /* CONFIG_PREEMPT */ | 680 | #endif /* CONFIG_PREEMPT */ |
| 668 | 681 | ||
| 669 | .globl fast_exc_return_irq | 682 | .globl fast_exc_return_irq |
| @@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs) · 153 unmodified lines | |||
| 154 | static int kgdb_singlestep(struct pt_regs *regs) | 154 | static int kgdb_singlestep(struct pt_regs *regs) |
| 155 | { | 155 | { |
| 156 | struct thread_info *thread_info, *exception_thread_info; | 156 | struct thread_info *thread_info, *exception_thread_info; |
| 157 | struct thread_info *backup_current_thread_info = \ | 157 | struct thread_info *backup_current_thread_info; |
| 158 | (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL); | ||
| 159 | 158 | ||
| 160 | if (user_mode(regs)) | 159 | if (user_mode(regs)) |
| 161 | return 0; | 160 | return 0; |
| 162 | 161 | ||
| 162 | backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL); | ||
| 163 | /* | 163 | /* |
| 164 | * On Book E and perhaps other processors, singlestep is handled on | 164 | * On Book E and perhaps other processors, singlestep is handled on |
| 165 | * the critical exception stack. This causes current_thread_info() | 165 | * the critical exception stack. This causes current_thread_info() |
| @@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs) · 19 unmodified lines | |||
| 185 | /* Restore current_thread_info lastly. */ | 185 | /* Restore current_thread_info lastly. */ |
| 186 | memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info); | 186 | memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info); |
| 187 | 187 | ||
| 188 | kfree(backup_current_thread_info); | ||
| 188 | return 1; | 189 | return 1; |
| 189 | } | 190 | } |
| 190 | 191 | ||
| @@ -494,10 +494,15 @@ void timer_interrupt(struct pt_regs * regs) · 493 unmodified lines | |||
| 494 | set_dec(DECREMENTER_MAX); | 494 | set_dec(DECREMENTER_MAX); |
| 495 | 495 | ||
| 496 | /* Some implementations of hotplug will get timer interrupts while | 496 | /* Some implementations of hotplug will get timer interrupts while |
| 497 | * offline, just ignore these | 497 | * offline, just ignore these and we also need to set |
| 498 | * decrementers_next_tb as MAX to make sure __check_irq_replay | ||
| 499 | * don't replay timer interrupt when return, otherwise we'll trap | ||
| 500 | * here infinitely :( | ||
| 498 | */ | 501 | */ |
| 499 | if (!cpu_online(smp_processor_id())) | 502 | if (!cpu_online(smp_processor_id())) { |
| 503 | *next_tb = ~(u64)0; | ||
| 500 | return; | 504 | return; |
| 505 | } | ||
| 501 | 506 | ||
| 502 | /* Conditionally hard-enable interrupts now that the DEC has been | 507 | /* Conditionally hard-enable interrupts now that the DEC has been |
| 503 | * bumped to its maximum value | 508 | * bumped to its maximum value |
| @@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1) · 51 unmodified lines | |||
| 52 | for (pmc = 0; pmc < 4; pmc++) { | 52 | for (pmc = 0; pmc < 4; pmc++) { |
| 53 | psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK | 53 | psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK |
| 54 | << (OPROFILE_MAX_PMC_NUM - pmc) | 54 | << (OPROFILE_MAX_PMC_NUM - pmc) |
| 55 | * OPROFILE_MAX_PMC_NUM); | 55 | * OPROFILE_PMSEL_FIELD_WIDTH); |
| 56 | psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc) | 56 | psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc) |
| 57 | * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL; | 57 | * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL; |
| 58 | unit = mmcr1 & (OPROFILE_PM_UNIT_MSK | 58 | unit = mmcr1 & (OPROFILE_PM_UNIT_MSK |
| @@ -236,6 +236,13 @@ out: · 235 unmodified lines | |||
| 236 | 236 | ||
| 237 | static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy) | 237 | static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy) |
| 238 | { | 238 | { |
| 239 | /* | ||
| 240 | * We don't support CPU hotplug. Don't unmap after the system | ||
| 241 | * has already made it to a running state. | ||
| 242 | */ | ||
| 243 | if (system_state != SYSTEM_BOOTING) | ||
| 244 | return 0; | ||
| 245 | |||
| 239 | if (sdcasr_mapbase) | 246 | if (sdcasr_mapbase) |
| 240 | iounmap(sdcasr_mapbase); | 247 | iounmap(sdcasr_mapbase); |
| 241 | if (sdcpwr_mapbase) | 248 | if (sdcpwr_mapbase) |