Commit fc16e884 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

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
parents f94d4fe0 689dfa89
...@@ -439,6 +439,8 @@ ret_from_fork: ...@@ -439,6 +439,8 @@ ret_from_fork:
ret_from_kernel_thread: ret_from_kernel_thread:
REST_NVGPRS(r1) REST_NVGPRS(r1)
bl schedule_tail bl schedule_tail
li r3,0
stw r3,0(r1)
mtlr r14 mtlr r14
mr r3,r15 mr r3,r15
PPC440EP_ERR42 PPC440EP_ERR42
......
...@@ -664,6 +664,19 @@ resume_kernel: ...@@ -664,6 +664,19 @@ resume_kernel:
ld r4,TI_FLAGS(r9) ld r4,TI_FLAGS(r9)
andi. r0,r4,_TIF_NEED_RESCHED andi. r0,r4,_TIF_NEED_RESCHED
bne 1b bne 1b
/*
* arch_local_irq_restore() from preempt_schedule_irq above may
* enable hard interrupt but we really should disable interrupts
* when we return from the interrupt, and so that we don't get
* interrupted after loading SRR0/1.
*/
#ifdef CONFIG_PPC_BOOK3E
wrteei 0
#else
ld r10,PACAKMSR(r13) /* Get kernel MSR without EE */
mtmsrd r10,1 /* Update machine state */
#endif /* CONFIG_PPC_BOOK3E */
#endif /* CONFIG_PREEMPT */ #endif /* CONFIG_PREEMPT */
.globl fast_exc_return_irq .globl fast_exc_return_irq
......
...@@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs) ...@@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs)
static int kgdb_singlestep(struct pt_regs *regs) static int kgdb_singlestep(struct pt_regs *regs)
{ {
struct thread_info *thread_info, *exception_thread_info; struct thread_info *thread_info, *exception_thread_info;
struct thread_info *backup_current_thread_info = \ struct thread_info *backup_current_thread_info;
(struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
if (user_mode(regs)) if (user_mode(regs))
return 0; return 0;
backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
/* /*
* On Book E and perhaps other processors, singlestep is handled on * On Book E and perhaps other processors, singlestep is handled on
* the critical exception stack. This causes current_thread_info() * the critical exception stack. This causes current_thread_info()
...@@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs) ...@@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs)
/* Restore current_thread_info lastly. */ /* Restore current_thread_info lastly. */
memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info); memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
kfree(backup_current_thread_info);
return 1; return 1;
} }
......
...@@ -494,10 +494,15 @@ void timer_interrupt(struct pt_regs * regs) ...@@ -494,10 +494,15 @@ void timer_interrupt(struct pt_regs * regs)
set_dec(DECREMENTER_MAX); set_dec(DECREMENTER_MAX);
/* Some implementations of hotplug will get timer interrupts while /* Some implementations of hotplug will get timer interrupts while
* offline, just ignore these * offline, just ignore these and we also need to set
* decrementers_next_tb as MAX to make sure __check_irq_replay
* don't replay timer interrupt when return, otherwise we'll trap
* here infinitely :(
*/ */
if (!cpu_online(smp_processor_id())) if (!cpu_online(smp_processor_id())) {
*next_tb = ~(u64)0;
return; return;
}
/* Conditionally hard-enable interrupts now that the DEC has been /* Conditionally hard-enable interrupts now that the DEC has been
* bumped to its maximum value * bumped to its maximum value
......
...@@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1) ...@@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1)
for (pmc = 0; pmc < 4; pmc++) { for (pmc = 0; pmc < 4; pmc++) {
psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK
<< (OPROFILE_MAX_PMC_NUM - pmc) << (OPROFILE_MAX_PMC_NUM - pmc)
* OPROFILE_MAX_PMC_NUM); * OPROFILE_PMSEL_FIELD_WIDTH);
psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc) psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc)
* OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL; * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL;
unit = mmcr1 & (OPROFILE_PM_UNIT_MSK unit = mmcr1 & (OPROFILE_PM_UNIT_MSK
......
...@@ -236,6 +236,13 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -236,6 +236,13 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy) static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy)
{ {
/*
* We don't support CPU hotplug. Don't unmap after the system
* has already made it to a running state.
*/
if (system_state != SYSTEM_BOOTING)
return 0;
if (sdcasr_mapbase) if (sdcasr_mapbase)
iounmap(sdcasr_mapbase); iounmap(sdcasr_mapbase);
if (sdcpwr_mapbase) if (sdcpwr_mapbase)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment