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

Merge tag 'powerpc-4.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"It turns out our single-fix pull from last week was too good to be
true. I missed a few fixes in that pull that had already come in
because I was on leave, but also we hadn't found the bugs yet. So this
week it's a bit bigger, though not ridiculous. Hopefully things will
settle down from here on.

Four fixes for the new instruction emulation code. A fix for CPU
offline on bare metal machines when certain idle states are not
supported, and a fix for a device_node refcounting oops during CPU
hotplug, caused by recent changes.

Going to stable are a fix for an oops during core dump on machines
that have TM (Transactional Memory) disabled. Reordering some EEH
initialisation to avoid trashing memory, and another device_node
refcounting fix.

And a few other minor things.

Thanks to: Anton Blanchard, Benjamin Herrenschmidt, Cyril Bur, Gautham
R. Shenoy, Gustavo Romero, Kamalesh Babulal, Matthew Weber, Matt Weber,
Naveen N. Rao, Nicholas Piggin, Pavithra Prakash, Ravi Bangoria, Ronak
Desai, Scott Wood, Tyrel Datwyler"

* tag 'powerpc-4.14-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/pseries: Fix parent_dn reference leak in add_dt_node()
powerpc/pseries: Fix "OF: ERROR: Bad of_node_put() on /cpus" during DLPAR
powerpc/eeh: Create PHB PEs after EEH is initialized
powerpc/kprobes: Update optprobes to use emulate_update_regs()
powerpc/powernv: Clear LPCR[PECE1] via stop-api only for deep state offline
powerpc/sstep: mullw should calculate a 64 bit signed result
powerpc/sstep: Fix issues with mcrf
powerpc/sstep: Fix issues with set_cr0()
powerpc/tm: Flush TM only if CPU has TM feature
powerpc/sysrq: Fix oops whem ppmu is not registered
powerpc/configs: Update for CONFIG_SND changes
powerpc/e6500: Update machine check for L1D cache err

+77 -56
+3 -2
arch/powerpc/configs/g5_defconfig
··· 138 138 CONFIG_LOGO=y 139 139 CONFIG_SOUND=m 140 140 CONFIG_SND=m 141 - CONFIG_SND_SEQUENCER=m 141 + CONFIG_SND_OSSEMUL=y 142 142 CONFIG_SND_MIXER_OSS=m 143 143 CONFIG_SND_PCM_OSS=m 144 - CONFIG_SND_SEQUENCER_OSS=y 144 + CONFIG_SND_SEQUENCER=m 145 + CONFIG_SND_SEQUENCER_OSS=m 145 146 CONFIG_SND_POWERMAC=m 146 147 CONFIG_SND_AOA=m 147 148 CONFIG_SND_AOA_FABRIC_LAYOUT=m
+3 -2
arch/powerpc/configs/gamecube_defconfig
··· 64 64 # CONFIG_LOGO_LINUX_CLUT224 is not set 65 65 CONFIG_SOUND=y 66 66 CONFIG_SND=y 67 - CONFIG_SND_SEQUENCER=y 67 + CONFIG_SND_OSSEMUL=y 68 68 CONFIG_SND_MIXER_OSS=y 69 69 CONFIG_SND_PCM_OSS=y 70 - CONFIG_SND_SEQUENCER_OSS=y 71 70 # CONFIG_SND_VERBOSE_PROCFS is not set 71 + CONFIG_SND_SEQUENCER=y 72 + CONFIG_SND_SEQUENCER_OSS=y 72 73 # CONFIG_USB_SUPPORT is not set 73 74 CONFIG_RTC_CLASS=y 74 75 CONFIG_RTC_DRV_GENERIC=y
+2 -1
arch/powerpc/configs/pasemi_defconfig
··· 115 115 CONFIG_LOGO=y 116 116 CONFIG_SOUND=y 117 117 CONFIG_SND=y 118 - CONFIG_SND_SEQUENCER=y 118 + CONFIG_SND_OSSEMUL=y 119 119 CONFIG_SND_MIXER_OSS=y 120 120 CONFIG_SND_PCM_OSS=y 121 + CONFIG_SND_SEQUENCER=y 121 122 CONFIG_SND_SEQUENCER_OSS=y 122 123 CONFIG_SND_USB_AUDIO=y 123 124 CONFIG_SND_USB_USX2Y=y
+4 -3
arch/powerpc/configs/pmac32_defconfig
··· 227 227 CONFIG_LOGO=y 228 228 CONFIG_SOUND=m 229 229 CONFIG_SND=m 230 - CONFIG_SND_SEQUENCER=m 231 - CONFIG_SND_SEQ_DUMMY=m 230 + CONFIG_SND_OSSEMUL=y 232 231 CONFIG_SND_MIXER_OSS=m 233 232 CONFIG_SND_PCM_OSS=m 234 - CONFIG_SND_SEQUENCER_OSS=y 233 + CONFIG_SND_SEQUENCER=m 234 + CONFIG_SND_SEQ_DUMMY=m 235 + CONFIG_SND_SEQUENCER_OSS=m 235 236 CONFIG_SND_DUMMY=m 236 237 CONFIG_SND_POWERMAC=m 237 238 CONFIG_SND_AOA=m
+4 -3
arch/powerpc/configs/ppc64_defconfig
··· 222 222 CONFIG_LOGO=y 223 223 CONFIG_SOUND=m 224 224 CONFIG_SND=m 225 - CONFIG_SND_SEQUENCER=m 226 - CONFIG_SND_SEQ_DUMMY=m 225 + CONFIG_SND_OSSEMUL=y 227 226 CONFIG_SND_MIXER_OSS=m 228 227 CONFIG_SND_PCM_OSS=m 229 - CONFIG_SND_SEQUENCER_OSS=y 228 + CONFIG_SND_SEQUENCER=m 229 + CONFIG_SND_SEQ_DUMMY=m 230 + CONFIG_SND_SEQUENCER_OSS=m 230 231 CONFIG_SND_POWERMAC=m 231 232 CONFIG_SND_AOA=m 232 233 CONFIG_SND_AOA_FABRIC_LAYOUT=m
+4 -3
arch/powerpc/configs/ppc64e_defconfig
··· 141 141 CONFIG_LOGO=y 142 142 CONFIG_SOUND=m 143 143 CONFIG_SND=m 144 - CONFIG_SND_SEQUENCER=m 145 - CONFIG_SND_SEQ_DUMMY=m 144 + CONFIG_SND_OSSEMUL=y 146 145 CONFIG_SND_MIXER_OSS=m 147 146 CONFIG_SND_PCM_OSS=m 148 - CONFIG_SND_SEQUENCER_OSS=y 147 + CONFIG_SND_SEQUENCER=m 148 + CONFIG_SND_SEQ_DUMMY=m 149 + CONFIG_SND_SEQUENCER_OSS=m 149 150 CONFIG_HID_DRAGONRISE=y 150 151 CONFIG_HID_GYRATION=y 151 152 CONFIG_HID_TWINHAN=y
+4 -3
arch/powerpc/configs/ppc6xx_defconfig
··· 789 789 # CONFIG_LOGO_LINUX_VGA16 is not set 790 790 CONFIG_SOUND=m 791 791 CONFIG_SND=m 792 - CONFIG_SND_SEQUENCER=m 793 - CONFIG_SND_SEQ_DUMMY=m 792 + CONFIG_SND_OSSEMUL=y 794 793 CONFIG_SND_MIXER_OSS=m 795 794 CONFIG_SND_PCM_OSS=m 796 - CONFIG_SND_SEQUENCER_OSS=y 797 795 CONFIG_SND_DYNAMIC_MINORS=y 798 796 # CONFIG_SND_SUPPORT_OLD_API is not set 799 797 CONFIG_SND_VERBOSE_PRINTK=y 800 798 CONFIG_SND_DEBUG=y 801 799 CONFIG_SND_DEBUG_VERBOSE=y 802 800 CONFIG_SND_PCM_XRUN_DEBUG=y 801 + CONFIG_SND_SEQUENCER=m 802 + CONFIG_SND_SEQ_DUMMY=m 803 + CONFIG_SND_SEQUENCER_OSS=m 803 804 CONFIG_SND_DUMMY=m 804 805 CONFIG_SND_VIRMIDI=m 805 806 CONFIG_SND_MTPAV=m
+3 -2
arch/powerpc/configs/wii_defconfig
··· 79 79 CONFIG_FRAMEBUFFER_CONSOLE=y 80 80 CONFIG_SOUND=y 81 81 CONFIG_SND=y 82 - CONFIG_SND_SEQUENCER=y 82 + CONFIG_SND_OSSEMUL=y 83 83 CONFIG_SND_MIXER_OSS=y 84 84 CONFIG_SND_PCM_OSS=y 85 - CONFIG_SND_SEQUENCER_OSS=y 86 85 # CONFIG_SND_VERBOSE_PROCFS is not set 86 + CONFIG_SND_SEQUENCER=y 87 + CONFIG_SND_SEQUENCER_OSS=y 87 88 CONFIG_HID_APPLE=m 88 89 CONFIG_HID_WACOM=m 89 90 CONFIG_MMC=y
+4
arch/powerpc/kernel/eeh.c
··· 1019 1019 } else if ((ret = eeh_ops->init())) 1020 1020 return ret; 1021 1021 1022 + /* Initialize PHB PEs */ 1023 + list_for_each_entry_safe(hose, tmp, &hose_list, list_node) 1024 + eeh_dev_phb_init_dynamic(hose); 1025 + 1022 1026 /* Initialize EEH event */ 1023 1027 ret = eeh_event_init(); 1024 1028 if (ret)
-18
arch/powerpc/kernel/eeh_dev.c
··· 78 78 /* EEH PE for PHB */ 79 79 eeh_phb_pe_create(phb); 80 80 } 81 - 82 - /** 83 - * eeh_dev_phb_init - Create EEH devices for devices included in existing PHBs 84 - * 85 - * Scan all the existing PHBs and create EEH devices for their OF 86 - * nodes and their children OF nodes 87 - */ 88 - static int __init eeh_dev_phb_init(void) 89 - { 90 - struct pci_controller *phb, *tmp; 91 - 92 - list_for_each_entry_safe(phb, tmp, &hose_list, list_node) 93 - eeh_dev_phb_init_dynamic(phb); 94 - 95 - return 0; 96 - } 97 - 98 - core_initcall(eeh_dev_phb_init);
+3 -1
arch/powerpc/kernel/optprobes.c
··· 104 104 * and that can be emulated. 105 105 */ 106 106 if (!is_conditional_branch(*p->ainsn.insn) && 107 - analyse_instr(&op, &regs, *p->ainsn.insn)) 107 + analyse_instr(&op, &regs, *p->ainsn.insn) == 1) { 108 + emulate_update_regs(&regs, &op); 108 109 nip = regs.nip; 110 + } 109 111 110 112 return nip; 111 113 }
+1 -1
arch/powerpc/kernel/ptrace.c
··· 131 131 * in the appropriate thread structures from live. 132 132 */ 133 133 134 - if (tsk != current) 134 + if ((!cpu_has_feature(CPU_FTR_TM)) || (tsk != current)) 135 135 return; 136 136 137 137 if (MSR_TM_SUSPENDED(mfmsr())) {
+10 -2
arch/powerpc/kernel/traps.c
··· 437 437 int machine_check_e500mc(struct pt_regs *regs) 438 438 { 439 439 unsigned long mcsr = mfspr(SPRN_MCSR); 440 + unsigned long pvr = mfspr(SPRN_PVR); 440 441 unsigned long reason = mcsr; 441 442 int recoverable = 1; 442 443 ··· 479 478 * may still get logged and cause a machine check. We should 480 479 * only treat the non-write shadow case as non-recoverable. 481 480 */ 482 - if (!(mfspr(SPRN_L1CSR2) & L1CSR2_DCWS)) 483 - recoverable = 0; 481 + /* On e6500 core, L1 DCWS (Data cache write shadow mode) bit 482 + * is not implemented but L1 data cache always runs in write 483 + * shadow mode. Hence on data cache parity errors HW will 484 + * automatically invalidate the L1 Data Cache. 485 + */ 486 + if (PVR_VER(pvr) != PVR_VER_E6500) { 487 + if (!(mfspr(SPRN_L1CSR2) & L1CSR2_DCWS)) 488 + recoverable = 0; 489 + } 484 490 } 485 491 486 492 if (reason & MCSR_L2MMU_MHIT) {
+12 -11
arch/powerpc/lib/sstep.c
··· 944 944 : "r" (addr), "i" (-EFAULT), "0" (err)) 945 945 946 946 static nokprobe_inline void set_cr0(const struct pt_regs *regs, 947 - struct instruction_op *op, int rd) 947 + struct instruction_op *op) 948 948 { 949 - long val = regs->gpr[rd]; 949 + long val = op->val; 950 950 951 951 op->type |= SETCC; 952 952 op->ccval = (regs->ccr & 0x0fffffff) | ((regs->xer >> 3) & 0x10000000); ··· 1326 1326 case 13: /* addic. */ 1327 1327 imm = (short) instr; 1328 1328 add_with_carry(regs, op, rd, regs->gpr[ra], imm, 0); 1329 - set_cr0(regs, op, rd); 1329 + set_cr0(regs, op); 1330 1330 return 1; 1331 1331 1332 1332 case 14: /* addi */ ··· 1397 1397 1398 1398 case 28: /* andi. */ 1399 1399 op->val = regs->gpr[rd] & (unsigned short) instr; 1400 - set_cr0(regs, op, ra); 1400 + set_cr0(regs, op); 1401 1401 goto logical_done_nocc; 1402 1402 1403 1403 case 29: /* andis. */ 1404 1404 imm = (unsigned short) instr; 1405 1405 op->val = regs->gpr[rd] & (imm << 16); 1406 - set_cr0(regs, op, ra); 1406 + set_cr0(regs, op); 1407 1407 goto logical_done_nocc; 1408 1408 1409 1409 #ifdef __powerpc64__ ··· 1513 1513 op->type = COMPUTE + SETCC; 1514 1514 imm = 0xf0000000UL; 1515 1515 val = regs->gpr[rd]; 1516 - op->val = regs->ccr; 1516 + op->ccval = regs->ccr; 1517 1517 for (sh = 0; sh < 8; ++sh) { 1518 1518 if (instr & (0x80000 >> sh)) 1519 - op->val = (op->val & ~imm) | 1519 + op->ccval = (op->ccval & ~imm) | 1520 1520 (val & imm); 1521 1521 imm >>= 4; 1522 1522 } ··· 1651 1651 goto arith_done; 1652 1652 1653 1653 case 235: /* mullw */ 1654 - op->val = (unsigned int) regs->gpr[ra] * 1655 - (unsigned int) regs->gpr[rb]; 1654 + op->val = (long)(int) regs->gpr[ra] * 1655 + (int) regs->gpr[rb]; 1656 + 1656 1657 goto arith_done; 1657 1658 1658 1659 case 266: /* add */ ··· 2527 2526 2528 2527 logical_done: 2529 2528 if (instr & 1) 2530 - set_cr0(regs, op, ra); 2529 + set_cr0(regs, op); 2531 2530 logical_done_nocc: 2532 2531 op->reg = ra; 2533 2532 op->type |= SETREG; ··· 2535 2534 2536 2535 arith_done: 2537 2536 if (instr & 1) 2538 - set_cr0(regs, op, rd); 2537 + set_cr0(regs, op); 2539 2538 compute_done: 2540 2539 op->reg = rd; 2541 2540 op->type |= SETREG;
+5
arch/powerpc/perf/core-book3s.c
··· 793 793 u32 pmcs[MAX_HWEVENTS]; 794 794 int i; 795 795 796 + if (!ppmu) { 797 + pr_info("Performance monitor hardware not registered.\n"); 798 + return; 799 + } 800 + 796 801 if (!ppmu->n_counter) 797 802 return; 798 803
+7 -1
arch/powerpc/platforms/powernv/idle.c
··· 393 393 u64 pir = get_hard_smp_processor_id(cpu); 394 394 395 395 mtspr(SPRN_LPCR, lpcr_val); 396 - opal_slw_set_reg(pir, SPRN_LPCR, lpcr_val); 396 + 397 + /* 398 + * Program the LPCR via stop-api only if the deepest stop state 399 + * can lose hypervisor context. 400 + */ 401 + if (supported_cpuidle_states & OPAL_PM_LOSE_FULL_CONTEXT) 402 + opal_slw_set_reg(pir, SPRN_LPCR, lpcr_val); 397 403 } 398 404 399 405 /*
-1
arch/powerpc/platforms/pseries/dlpar.c
··· 266 266 return rc; 267 267 } 268 268 269 - of_node_put(dn->parent); 270 269 return 0; 271 270 } 272 271
+5 -1
arch/powerpc/platforms/pseries/hotplug-cpu.c
··· 462 462 } 463 463 464 464 dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); 465 - of_node_put(parent); 466 465 if (!dn) { 467 466 pr_warn("Failed call to configure-connector, drc index: %x\n", 468 467 drc_index); 469 468 dlpar_release_drc(drc_index); 469 + of_node_put(parent); 470 470 return -EINVAL; 471 471 } 472 472 473 473 rc = dlpar_attach_node(dn, parent); 474 + 475 + /* Regardless we are done with parent now */ 476 + of_node_put(parent); 477 + 474 478 if (rc) { 475 479 saved_rc = rc; 476 480 pr_warn("Failed to attach node %s, rc: %d, drc index: %x\n",
+3 -1
arch/powerpc/platforms/pseries/mobility.c
··· 226 226 return -ENOENT; 227 227 228 228 dn = dlpar_configure_connector(drc_index, parent_dn); 229 - if (!dn) 229 + if (!dn) { 230 + of_node_put(parent_dn); 230 231 return -ENOENT; 232 + } 231 233 232 234 rc = dlpar_attach_node(dn, parent_dn); 233 235 if (rc)