History

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

Linus Torvalds committed 13 years ago

Commit fc16e882 parents f94d4fe 689dfa86 files · +33 −5Browse files

Unified · Split

6 files
  1. arch/powerpc/kernel/entry_32.S +2 −0
  2. arch/powerpc/kernel/entry_64.S +13 −0
  3. arch/powerpc/kernel/kgdb.c +3 −2
  4. arch/powerpc/kernel/time.c +7 −2
  5. arch/powerpc/oprofile/op_model_power4.c +1 −1
  6. arch/powerpc/platforms/pasemi/cpufreq.c +7 −0
arch/powerpc/kernel/entry_32.S+2−0
@@ -439,6 +439,8 @@ ret_from_fork: · 438 unmodified lines
439439 ret_from_kernel_thread:
440440 REST_NVGPRS(r1)
441441 bl schedule_tail
442+ li r3,0
443+ stw r3,0(r1)
442444 mtlr r14
443445 mr r3,r15
444446 PPC440EP_ERR42
arch/powerpc/kernel/entry_64.S+13−0
@@ -664,6 +664,19 @@ resume_kernel: · 663 unmodified lines
664664 ld r4,TI_FLAGS(r9)
665665 andi. r0,r4,_TIF_NEED_RESCHED
666666 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 */
667680 #endif /* CONFIG_PREEMPT */
668681
669682 .globl fast_exc_return_irq
arch/powerpc/kernel/kgdb.c+3−2
@@ -154,12 +154,12 @@ static int kgdb_handle_breakpoint(struct pt_regs *regs) · 153 unmodified lines
154154 static int kgdb_singlestep(struct pt_regs *regs)
155155 {
156156 struct thread_info *thread_info, *exception_thread_info;
157− struct thread_info *backup_current_thread_info = \
158− (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
157+ struct thread_info *backup_current_thread_info;
159158
160159 if (user_mode(regs))
161160 return 0;
162161
162+ backup_current_thread_info = (struct thread_info *)kmalloc(sizeof(struct thread_info), GFP_KERNEL);
163163 /*
164164 * On Book E and perhaps other processors, singlestep is handled on
165165 * the critical exception stack. This causes current_thread_info()
@@ -185,6 +185,7 @@ static int kgdb_singlestep(struct pt_regs *regs) · 19 unmodified lines
185185 /* Restore current_thread_info lastly. */
186186 memcpy(exception_thread_info, backup_current_thread_info, sizeof *thread_info);
187187
188+ kfree(backup_current_thread_info);
188189 return 1;
189190 }
190191
arch/powerpc/kernel/time.c+7−2
@@ -494,10 +494,15 @@ void timer_interrupt(struct pt_regs * regs) · 493 unmodified lines
494494 set_dec(DECREMENTER_MAX);
495495
496496 /* 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 :(
498501 */
499− if (!cpu_online(smp_processor_id()))
502+ if (!cpu_online(smp_processor_id())) {
503+ *next_tb = ~(u64)0;
500504 return;
505+ }
501506
502507 /* Conditionally hard-enable interrupts now that the DEC has been
503508 * bumped to its maximum value
arch/powerpc/oprofile/op_model_power4.c+1−1
@@ -52,7 +52,7 @@ static int power7_marked_instr_event(u64 mmcr1) · 51 unmodified lines
5252 for (pmc = 0; pmc < 4; pmc++) {
5353 psel = mmcr1 & (OPROFILE_PM_PMCSEL_MSK
5454 << (OPROFILE_MAX_PMC_NUM - pmc)
55− * OPROFILE_MAX_PMC_NUM);
55+ * OPROFILE_PMSEL_FIELD_WIDTH);
5656 psel = (psel >> ((OPROFILE_MAX_PMC_NUM - pmc)
5757 * OPROFILE_PMSEL_FIELD_WIDTH)) & ~1ULL;
5858 unit = mmcr1 & (OPROFILE_PM_UNIT_MSK
arch/powerpc/platforms/pasemi/cpufreq.c+7−0
@@ -236,6 +236,13 @@ out: · 235 unmodified lines
236236
237237 static int pas_cpufreq_cpu_exit(struct cpufreq_policy *policy)
238238 {
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+
239246 if (sdcasr_mapbase)
240247 iounmap(sdcasr_mapbase);
241248 if (sdcpwr_mapbase)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t