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/benh/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
powerpc/powermac: Build fix with SMP and CPU hotplug
powerpc/perf_event: Skip updating kernel counters if register value shrinks
powerpc: Don't write protect kernel text with CONFIG_DYNAMIC_FTRACE enabled
powerpc: Fix oops if scan_dispatch_log is called too early
powerpc/pseries: Use a kmem cache for DTL buffers
powerpc/kexec: Fix regression causing compile failure on UP
powerpc/85xx: disable Suspend support if SMP enabled
powerpc/e500mc: Remove CPU_FTR_MAYBE_CAN_NAP/CPU_FTR_MAYBE_CAN_DOZE
powerpc/book3e: Fix CPU feature handling on 64-bit e5500
powerpc: Check device status before adding serial device
powerpc/85xx: Don't add disabled PCIe devices

+81 -26
+1 -1
arch/powerpc/Kconfig
··· 209 209 config ARCH_SUSPEND_POSSIBLE 210 210 def_bool y 211 211 depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx || \ 212 - PPC_85xx || PPC_86xx || PPC_PSERIES || 44x || 40x 212 + (PPC_85xx && !SMP) || PPC_86xx || PPC_PSERIES || 44x || 40x 213 213 214 214 config PPC_DCR_NATIVE 215 215 bool
+14 -2
arch/powerpc/include/asm/cputable.h
··· 382 382 #define CPU_FTRS_E500_2 (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ 383 383 CPU_FTR_SPE_COMP | CPU_FTR_MAYBE_CAN_NAP | \ 384 384 CPU_FTR_NODSISRALIGN | CPU_FTR_NOEXECUTE) 385 - #define CPU_FTRS_E500MC (CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \ 386 - CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN | \ 385 + #define CPU_FTRS_E500MC (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \ 387 386 CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \ 388 387 CPU_FTR_DBELL) 388 + #define CPU_FTRS_E5500 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN | \ 389 + CPU_FTR_L2CSR | CPU_FTR_LWSYNC | CPU_FTR_NOEXECUTE | \ 390 + CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD) 389 391 #define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) 390 392 391 393 /* 64-bit CPUs */ ··· 437 435 #define CPU_FTRS_COMPATIBLE (CPU_FTR_USE_TB | CPU_FTR_PPCAS_ARCH_V2) 438 436 439 437 #ifdef __powerpc64__ 438 + #ifdef CONFIG_PPC_BOOK3E 439 + #define CPU_FTRS_POSSIBLE (CPU_FTRS_E5500) 440 + #else 440 441 #define CPU_FTRS_POSSIBLE \ 441 442 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \ 442 443 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_POWER6 | \ 443 444 CPU_FTRS_POWER7 | CPU_FTRS_CELL | CPU_FTRS_PA6T | \ 444 445 CPU_FTR_1T_SEGMENT | CPU_FTR_VSX) 446 + #endif 445 447 #else 446 448 enum { 447 449 CPU_FTRS_POSSIBLE = ··· 479 473 #endif 480 474 #ifdef CONFIG_E500 481 475 CPU_FTRS_E500 | CPU_FTRS_E500_2 | CPU_FTRS_E500MC | 476 + CPU_FTRS_E5500 | 482 477 #endif 483 478 0, 484 479 }; 485 480 #endif /* __powerpc64__ */ 486 481 487 482 #ifdef __powerpc64__ 483 + #ifdef CONFIG_PPC_BOOK3E 484 + #define CPU_FTRS_ALWAYS (CPU_FTRS_E5500) 485 + #else 488 486 #define CPU_FTRS_ALWAYS \ 489 487 (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \ 490 488 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_POWER6 & \ 491 489 CPU_FTRS_POWER7 & CPU_FTRS_CELL & CPU_FTRS_PA6T & CPU_FTRS_POSSIBLE) 490 + #endif 492 491 #else 493 492 enum { 494 493 CPU_FTRS_ALWAYS = ··· 524 513 #endif 525 514 #ifdef CONFIG_E500 526 515 CPU_FTRS_E500 & CPU_FTRS_E500_2 & CPU_FTRS_E500MC & 516 + CPU_FTRS_E5500 & 527 517 #endif 528 518 CPU_FTRS_POSSIBLE, 529 519 };
+1 -1
arch/powerpc/include/asm/pte-common.h
··· 162 162 * on platforms where such control is possible. 163 163 */ 164 164 #if defined(CONFIG_KGDB) || defined(CONFIG_XMON) || defined(CONFIG_BDI_SWITCH) ||\ 165 - defined(CONFIG_KPROBES) 165 + defined(CONFIG_KPROBES) || defined(CONFIG_DYNAMIC_FTRACE) 166 166 #define PAGE_KERNEL_TEXT PAGE_KERNEL_X 167 167 #else 168 168 #define PAGE_KERNEL_TEXT PAGE_KERNEL_ROX
+1 -1
arch/powerpc/kernel/cputable.c
··· 1973 1973 .pvr_mask = 0xffff0000, 1974 1974 .pvr_value = 0x80240000, 1975 1975 .cpu_name = "e5500", 1976 - .cpu_features = CPU_FTRS_E500MC, 1976 + .cpu_features = CPU_FTRS_E5500, 1977 1977 .cpu_user_features = COMMON_USER_BOOKE, 1978 1978 .mmu_features = MMU_FTR_TYPE_FSL_E | MMU_FTR_BIG_PHYS | 1979 1979 MMU_FTR_USE_TLBILX,
+6 -6
arch/powerpc/kernel/crash.c
··· 163 163 } 164 164 165 165 /* wait for all the CPUs to hit real mode but timeout if they don't come in */ 166 - #if defined(CONFIG_PPC_STD_MMU_64) && defined(CONFIG_SMP) 166 + #ifdef CONFIG_PPC_STD_MMU_64 167 167 static void crash_kexec_wait_realmode(int cpu) 168 168 { 169 169 unsigned int msecs; ··· 188 188 } 189 189 mb(); 190 190 } 191 - #else 192 - static inline void crash_kexec_wait_realmode(int cpu) {} 193 - #endif 191 + #endif /* CONFIG_PPC_STD_MMU_64 */ 194 192 195 193 /* 196 194 * This function will be called by secondary cpus or by kexec cpu ··· 233 235 crash_ipi_callback(regs); 234 236 } 235 237 236 - #else 238 + #else /* ! CONFIG_SMP */ 239 + static inline void crash_kexec_wait_realmode(int cpu) {} 240 + 237 241 static void crash_kexec_prepare_cpus(int cpu) 238 242 { 239 243 /* ··· 255 255 { 256 256 cpus_in_sr = CPU_MASK_NONE; 257 257 } 258 - #endif 258 + #endif /* CONFIG_SMP */ 259 259 260 260 /* 261 261 * Register a function to be called on shutdown. Only use this if you
+5 -3
arch/powerpc/kernel/legacy_serial.c
··· 330 330 if (!parent) 331 331 continue; 332 332 if (of_match_node(legacy_serial_parents, parent) != NULL) { 333 - index = add_legacy_soc_port(np, np); 334 - if (index >= 0 && np == stdout) 335 - legacy_serial_console = index; 333 + if (of_device_is_available(np)) { 334 + index = add_legacy_soc_port(np, np); 335 + if (index >= 0 && np == stdout) 336 + legacy_serial_console = index; 337 + } 336 338 } 337 339 of_node_put(parent); 338 340 }
+30 -7
arch/powerpc/kernel/perf_event.c
··· 398 398 return 0; 399 399 } 400 400 401 + static u64 check_and_compute_delta(u64 prev, u64 val) 402 + { 403 + u64 delta = (val - prev) & 0xfffffffful; 404 + 405 + /* 406 + * POWER7 can roll back counter values, if the new value is smaller 407 + * than the previous value it will cause the delta and the counter to 408 + * have bogus values unless we rolled a counter over. If a coutner is 409 + * rolled back, it will be smaller, but within 256, which is the maximum 410 + * number of events to rollback at once. If we dectect a rollback 411 + * return 0. This can lead to a small lack of precision in the 412 + * counters. 413 + */ 414 + if (prev > val && (prev - val) < 256) 415 + delta = 0; 416 + 417 + return delta; 418 + } 419 + 401 420 static void power_pmu_read(struct perf_event *event) 402 421 { 403 422 s64 val, delta, prev; ··· 435 416 prev = local64_read(&event->hw.prev_count); 436 417 barrier(); 437 418 val = read_pmc(event->hw.idx); 419 + delta = check_and_compute_delta(prev, val); 420 + if (!delta) 421 + return; 438 422 } while (local64_cmpxchg(&event->hw.prev_count, prev, val) != prev); 439 423 440 - /* The counters are only 32 bits wide */ 441 - delta = (val - prev) & 0xfffffffful; 442 424 local64_add(delta, &event->count); 443 425 local64_sub(delta, &event->hw.period_left); 444 426 } ··· 469 449 val = (event->hw.idx == 5) ? pmc5 : pmc6; 470 450 prev = local64_read(&event->hw.prev_count); 471 451 event->hw.idx = 0; 472 - delta = (val - prev) & 0xfffffffful; 473 - local64_add(delta, &event->count); 452 + delta = check_and_compute_delta(prev, val); 453 + if (delta) 454 + local64_add(delta, &event->count); 474 455 } 475 456 } 476 457 ··· 479 458 unsigned long pmc5, unsigned long pmc6) 480 459 { 481 460 struct perf_event *event; 482 - u64 val; 461 + u64 val, prev; 483 462 int i; 484 463 485 464 for (i = 0; i < cpuhw->n_limited; ++i) { 486 465 event = cpuhw->limited_counter[i]; 487 466 event->hw.idx = cpuhw->limited_hwidx[i]; 488 467 val = (event->hw.idx == 5) ? pmc5 : pmc6; 489 - local64_set(&event->hw.prev_count, val); 468 + prev = local64_read(&event->hw.prev_count); 469 + if (check_and_compute_delta(prev, val)) 470 + local64_set(&event->hw.prev_count, val); 490 471 perf_event_update_userpage(event); 491 472 } 492 473 } ··· 1220 1197 1221 1198 /* we don't have to worry about interrupts here */ 1222 1199 prev = local64_read(&event->hw.prev_count); 1223 - delta = (val - prev) & 0xfffffffful; 1200 + delta = check_and_compute_delta(prev, val); 1224 1201 local64_add(delta, &event->count); 1225 1202 1226 1203 /*
+3
arch/powerpc/kernel/time.c
··· 229 229 u64 stolen = 0; 230 230 u64 dtb; 231 231 232 + if (!dtl) 233 + return 0; 234 + 232 235 if (i == vpa->dtl_idx) 233 236 return 0; 234 237 while (i < vpa->dtl_idx) {
+5 -3
arch/powerpc/platforms/powermac/smp.c
··· 842 842 mpic_setup_this_cpu(); 843 843 } 844 844 845 + #ifdef CONFIG_PPC64 845 846 #ifdef CONFIG_HOTPLUG_CPU 846 847 static int smp_core99_cpu_notify(struct notifier_block *self, 847 848 unsigned long action, void *hcpu) ··· 880 879 881 880 static void __init smp_core99_bringup_done(void) 882 881 { 883 - #ifdef CONFIG_PPC64 884 882 extern void g5_phy_disable_cpu1(void); 885 883 886 884 /* Close i2c bus if it was used for tb sync */ ··· 894 894 set_cpu_present(1, false); 895 895 g5_phy_disable_cpu1(); 896 896 } 897 - #endif /* CONFIG_PPC64 */ 898 - 899 897 #ifdef CONFIG_HOTPLUG_CPU 900 898 register_cpu_notifier(&smp_core99_cpu_nb); 901 899 #endif 900 + 902 901 if (ppc_md.progress) 903 902 ppc_md.progress("smp_core99_bringup_done", 0x349); 904 903 } 904 + #endif /* CONFIG_PPC64 */ 905 905 906 906 #ifdef CONFIG_HOTPLUG_CPU 907 907 ··· 975 975 struct smp_ops_t core99_smp_ops = { 976 976 .message_pass = smp_mpic_message_pass, 977 977 .probe = smp_core99_probe, 978 + #ifdef CONFIG_PPC64 978 979 .bringup_done = smp_core99_bringup_done, 980 + #endif 979 981 .kick_cpu = smp_core99_kick_cpu, 980 982 .setup_cpu = smp_core99_setup_cpu, 981 983 .give_timebase = smp_core99_give_timebase,
+10 -2
arch/powerpc/platforms/pseries/setup.c
··· 287 287 int cpu, ret; 288 288 struct paca_struct *pp; 289 289 struct dtl_entry *dtl; 290 + struct kmem_cache *dtl_cache; 290 291 291 292 if (!firmware_has_feature(FW_FEATURE_SPLPAR)) 292 293 return 0; 293 294 295 + dtl_cache = kmem_cache_create("dtl", DISPATCH_LOG_BYTES, 296 + DISPATCH_LOG_BYTES, 0, NULL); 297 + if (!dtl_cache) { 298 + pr_warn("Failed to create dispatch trace log buffer cache\n"); 299 + pr_warn("Stolen time statistics will be unreliable\n"); 300 + return 0; 301 + } 302 + 294 303 for_each_possible_cpu(cpu) { 295 304 pp = &paca[cpu]; 296 - dtl = kmalloc_node(DISPATCH_LOG_BYTES, GFP_KERNEL, 297 - cpu_to_node(cpu)); 305 + dtl = kmem_cache_alloc(dtl_cache, GFP_KERNEL); 298 306 if (!dtl) { 299 307 pr_warn("Failed to allocate dispatch trace log for cpu %d\n", 300 308 cpu);
+5
arch/powerpc/sysdev/fsl_pci.c
··· 324 324 struct resource rsrc; 325 325 const int *bus_range; 326 326 327 + if (!of_device_is_available(dev)) { 328 + pr_warning("%s: disabled\n", dev->full_name); 329 + return -ENODEV; 330 + } 331 + 327 332 pr_debug("Adding PCI host bridge %s\n", dev->full_name); 328 333 329 334 /* Fetch host bridge registers address */