Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull powerpc fixes from Paul Mackerras:
"Two small fixes for powerpc:
- a fix for a regression since 3.2 that causes 4-second (or longer)
pauses
- a fix for a potential oops when loading kernel modules on 32-bit
embedded systems."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: Fix kernel panic during kernel module load
powerpc/time: Sanity check of decrementer expiration is necessary

+16 -9
+5 -6
arch/powerpc/kernel/module_32.c
··· 176 176 177 177 static inline int entry_matches(struct ppc_plt_entry *entry, Elf32_Addr val) 178 178 { 179 - if (entry->jump[0] == 0x3d600000 + ((val + 0x8000) >> 16) 180 - && entry->jump[1] == 0x396b0000 + (val & 0xffff)) 179 + if (entry->jump[0] == 0x3d800000 + ((val + 0x8000) >> 16) 180 + && entry->jump[1] == 0x398c0000 + (val & 0xffff)) 181 181 return 1; 182 182 return 0; 183 183 } ··· 204 204 entry++; 205 205 } 206 206 207 - /* Stolen from Paul Mackerras as well... */ 208 - entry->jump[0] = 0x3d600000+((val+0x8000)>>16); /* lis r11,sym@ha */ 209 - entry->jump[1] = 0x396b0000 + (val&0xffff); /* addi r11,r11,sym@l*/ 210 - entry->jump[2] = 0x7d6903a6; /* mtctr r11 */ 207 + entry->jump[0] = 0x3d800000+((val+0x8000)>>16); /* lis r12,sym@ha */ 208 + entry->jump[1] = 0x398c0000 + (val&0xffff); /* addi r12,r12,sym@l*/ 209 + entry->jump[2] = 0x7d8903a6; /* mtctr r12 */ 211 210 entry->jump[3] = 0x4e800420; /* bctr */ 212 211 213 212 DEBUGP("Initialized plt for 0x%x at %p\n", val, entry);
+11 -3
arch/powerpc/kernel/time.c
··· 475 475 struct pt_regs *old_regs; 476 476 u64 *next_tb = &__get_cpu_var(decrementers_next_tb); 477 477 struct clock_event_device *evt = &__get_cpu_var(decrementers); 478 + u64 now; 478 479 479 480 /* Ensure a positive value is written to the decrementer, or else 480 481 * some CPUs will continue to take decrementer exceptions. ··· 510 509 irq_work_run(); 511 510 } 512 511 513 - *next_tb = ~(u64)0; 514 - if (evt->event_handler) 515 - evt->event_handler(evt); 512 + now = get_tb_or_rtc(); 513 + if (now >= *next_tb) { 514 + *next_tb = ~(u64)0; 515 + if (evt->event_handler) 516 + evt->event_handler(evt); 517 + } else { 518 + now = *next_tb - now; 519 + if (now <= DECREMENTER_MAX) 520 + set_dec((int)now); 521 + } 516 522 517 523 #ifdef CONFIG_PPC64 518 524 /* collect purr register values often, for accurate calculations */