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

Merge branch 'topic/pm-power-off' into next

+66 -58
-1
arch/powerpc/include/asm/machdep.h
··· 142 142 #endif 143 143 144 144 void (*restart)(char *cmd); 145 - void (*power_off)(void); 146 145 void (*halt)(void); 147 146 void (*panic)(char *str); 148 147 void (*cpu_die)(void);
+3 -3
arch/powerpc/kernel/setup-common.c
··· 139 139 void machine_power_off(void) 140 140 { 141 141 machine_shutdown(); 142 - if (ppc_md.power_off) 143 - ppc_md.power_off(); 142 + if (pm_power_off) 143 + pm_power_off(); 144 144 #ifdef CONFIG_SMP 145 145 smp_send_stop(); 146 146 #endif ··· 151 151 /* Used by the G5 thermal driver */ 152 152 EXPORT_SYMBOL_GPL(machine_power_off); 153 153 154 - void (*pm_power_off)(void) = machine_power_off; 154 + void (*pm_power_off)(void); 155 155 EXPORT_SYMBOL_GPL(pm_power_off); 156 156 157 157 void machine_halt(void)
+1 -1
arch/powerpc/platforms/44x/ppc476.c
··· 94 94 { 95 95 avr_i2c_client = client; 96 96 ppc_md.restart = avr_reset_system; 97 - ppc_md.power_off = avr_power_off_system; 97 + pm_power_off = avr_power_off_system; 98 98 return 0; 99 99 } 100 100
+2 -1
arch/powerpc/platforms/52xx/efika.c
··· 212 212 DMA_MODE_READ = 0x44; 213 213 DMA_MODE_WRITE = 0x48; 214 214 215 + pm_power_off = rtas_power_off; 216 + 215 217 return 1; 216 218 } 217 219 ··· 227 225 .init_IRQ = mpc52xx_init_irq, 228 226 .get_irq = mpc52xx_get_irq, 229 227 .restart = rtas_restart, 230 - .power_off = rtas_power_off, 231 228 .halt = rtas_halt, 232 229 .set_rtc_time = rtas_set_rtc_time, 233 230 .get_rtc_time = rtas_get_rtc_time,
+4 -4
arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
··· 167 167 if (ret) 168 168 goto err; 169 169 170 - /* XXX: this is potentially racy, but there is no lock for ppc_md */ 171 - if (!ppc_md.power_off) { 170 + /* XXX: this is potentially racy, but there is no lock for pm_power_off */ 171 + if (!pm_power_off) { 172 172 glob_mcu = mcu; 173 - ppc_md.power_off = mcu_power_off; 173 + pm_power_off = mcu_power_off; 174 174 dev_info(&client->dev, "will provide power-off service\n"); 175 175 } 176 176 ··· 197 197 device_remove_file(&client->dev, &dev_attr_status); 198 198 199 199 if (glob_mcu == mcu) { 200 - ppc_md.power_off = NULL; 200 + pm_power_off = NULL; 201 201 glob_mcu = NULL; 202 202 } 203 203
+1 -1
arch/powerpc/platforms/85xx/corenet_generic.c
··· 170 170 171 171 ppc_md.get_irq = ehv_pic_get_irq; 172 172 ppc_md.restart = fsl_hv_restart; 173 - ppc_md.power_off = fsl_hv_halt; 173 + pm_power_off = fsl_hv_halt; 174 174 ppc_md.halt = fsl_hv_halt; 175 175 #ifdef CONFIG_SMP 176 176 /*
+2 -2
arch/powerpc/platforms/85xx/sgy_cts1000.c
··· 120 120 121 121 /* Register our halt function */ 122 122 ppc_md.halt = gpio_halt_cb; 123 - ppc_md.power_off = gpio_halt_cb; 123 + pm_power_off = gpio_halt_cb; 124 124 125 125 printk(KERN_INFO "gpio-halt: registered GPIO %d (%d trigger, %d" 126 126 " irq).\n", gpio, trigger, irq); ··· 137 137 free_irq(irq, halt_node); 138 138 139 139 ppc_md.halt = NULL; 140 - ppc_md.power_off = NULL; 140 + pm_power_off = NULL; 141 141 142 142 gpio_free(gpio); 143 143
+2 -2
arch/powerpc/platforms/cell/celleb_setup.c
··· 142 142 powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS 143 143 | FW_FEATURE_BEAT | FW_FEATURE_LPAR; 144 144 hpte_init_beat_v3(); 145 + pm_power_off = beat_power_off; 145 146 146 147 return 1; 147 148 } ··· 191 190 192 191 powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS; 193 192 hpte_init_native(); 193 + pm_power_off = rtas_power_off; 194 194 195 195 return 1; 196 196 } ··· 206 204 .setup_arch = celleb_setup_arch_beat, 207 205 .show_cpuinfo = celleb_show_cpuinfo, 208 206 .restart = beat_restart, 209 - .power_off = beat_power_off, 210 207 .halt = beat_halt, 211 208 .get_rtc_time = beat_get_rtc_time, 212 209 .set_rtc_time = beat_set_rtc_time, ··· 231 230 .setup_arch = celleb_setup_arch_native, 232 231 .show_cpuinfo = celleb_show_cpuinfo, 233 232 .restart = rtas_restart, 234 - .power_off = rtas_power_off, 235 233 .halt = rtas_halt, 236 234 .get_boot_time = rtas_get_boot_time, 237 235 .get_rtc_time = rtas_get_rtc_time,
+1 -1
arch/powerpc/platforms/cell/qpace_setup.c
··· 127 127 return 0; 128 128 129 129 hpte_init_native(); 130 + pm_power_off = rtas_power_off; 130 131 131 132 return 1; 132 133 } ··· 138 137 .setup_arch = qpace_setup_arch, 139 138 .show_cpuinfo = qpace_show_cpuinfo, 140 139 .restart = rtas_restart, 141 - .power_off = rtas_power_off, 142 140 .halt = rtas_halt, 143 141 .get_boot_time = rtas_get_boot_time, 144 142 .get_rtc_time = rtas_get_rtc_time,
+1 -1
arch/powerpc/platforms/cell/setup.c
··· 259 259 return 0; 260 260 261 261 hpte_init_native(); 262 + pm_power_off = rtas_power_off; 262 263 263 264 return 1; 264 265 } ··· 270 269 .setup_arch = cell_setup_arch, 271 270 .show_cpuinfo = cell_show_cpuinfo, 272 271 .restart = rtas_restart, 273 - .power_off = rtas_power_off, 274 272 .halt = rtas_halt, 275 273 .get_boot_time = rtas_get_boot_time, 276 274 .get_rtc_time = rtas_get_rtc_time,
+2 -1
arch/powerpc/platforms/chrp/setup.c
··· 585 585 DMA_MODE_READ = 0x44; 586 586 DMA_MODE_WRITE = 0x48; 587 587 588 + pm_power_off = rtas_power_off; 589 + 588 590 return 1; 589 591 } 590 592 ··· 599 597 .show_cpuinfo = chrp_show_cpuinfo, 600 598 .init_IRQ = chrp_init_IRQ, 601 599 .restart = rtas_restart, 602 - .power_off = rtas_power_off, 603 600 .halt = rtas_halt, 604 601 .time_init = chrp_time_init, 605 602 .set_rtc_time = chrp_set_rtc_time,
+2 -1
arch/powerpc/platforms/embedded6xx/gamecube.c
··· 67 67 if (!of_flat_dt_is_compatible(dt_root, "nintendo,gamecube")) 68 68 return 0; 69 69 70 + pm_power_off = gamecube_power_off; 71 + 70 72 return 1; 71 73 } 72 74 ··· 82 80 .probe = gamecube_probe, 83 81 .init_early = gamecube_init_early, 84 82 .restart = gamecube_restart, 85 - .power_off = gamecube_power_off, 86 83 .halt = gamecube_halt, 87 84 .init_IRQ = flipper_pic_probe, 88 85 .get_irq = flipper_pic_get_irq,
+3 -1
arch/powerpc/platforms/embedded6xx/linkstation.c
··· 147 147 148 148 if (!of_flat_dt_is_compatible(root, "linkstation")) 149 149 return 0; 150 + 151 + pm_power_off = linkstation_power_off; 152 + 150 153 return 1; 151 154 } 152 155 ··· 161 158 .show_cpuinfo = linkstation_show_cpuinfo, 162 159 .get_irq = mpic_get_irq, 163 160 .restart = linkstation_restart, 164 - .power_off = linkstation_power_off, 165 161 .halt = linkstation_halt, 166 162 .calibrate_decr = generic_calibrate_decr, 167 163 };
+2 -1
arch/powerpc/platforms/embedded6xx/wii.c
··· 211 211 if (!of_flat_dt_is_compatible(dt_root, "nintendo,wii")) 212 212 return 0; 213 213 214 + pm_power_off = wii_power_off; 215 + 214 216 return 1; 215 217 } 216 218 ··· 228 226 .init_early = wii_init_early, 229 227 .setup_arch = wii_setup_arch, 230 228 .restart = wii_restart, 231 - .power_off = wii_power_off, 232 229 .halt = wii_halt, 233 230 .init_IRQ = wii_pic_probe, 234 231 .get_irq = flipper_pic_get_irq,
+2 -2
arch/powerpc/platforms/maple/setup.c
··· 169 169 if (rtas_service_present("system-reboot") && 170 170 rtas_service_present("power-off")) { 171 171 ppc_md.restart = rtas_restart; 172 - ppc_md.power_off = rtas_power_off; 172 + pm_power_off = rtas_power_off; 173 173 ppc_md.halt = rtas_halt; 174 174 } 175 175 } ··· 312 312 alloc_dart_table(); 313 313 314 314 hpte_init_native(); 315 + pm_power_off = maple_power_off; 315 316 316 317 return 1; 317 318 } ··· 326 325 .pci_irq_fixup = maple_pci_irq_fixup, 327 326 .pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq, 328 327 .restart = maple_restart, 329 - .power_off = maple_power_off, 330 328 .halt = maple_halt, 331 329 .get_boot_time = maple_get_boot_time, 332 330 .set_rtc_time = maple_set_rtc_time,
+2 -1
arch/powerpc/platforms/powermac/setup.c
··· 632 632 smu_cmdbuf_abs = memblock_alloc_base(4096, 4096, 0x80000000UL); 633 633 #endif /* CONFIG_PMAC_SMU */ 634 634 635 + pm_power_off = pmac_power_off; 636 + 635 637 return 1; 636 638 } 637 639 ··· 665 663 .get_irq = NULL, /* changed later */ 666 664 .pci_irq_fixup = pmac_pci_irq_fixup, 667 665 .restart = pmac_restart, 668 - .power_off = pmac_power_off, 669 666 .halt = pmac_halt, 670 667 .time_init = pmac_time_init, 671 668 .get_boot_time = pmac_get_boot_time,
+2 -2
arch/powerpc/platforms/powernv/setup.c
··· 268 268 ppc_md.get_rtc_time = opal_get_rtc_time; 269 269 ppc_md.set_rtc_time = opal_set_rtc_time; 270 270 ppc_md.restart = pnv_restart; 271 - ppc_md.power_off = pnv_power_off; 271 + pm_power_off = pnv_power_off; 272 272 ppc_md.halt = pnv_halt; 273 273 ppc_md.machine_check_exception = opal_machine_check; 274 274 ppc_md.mce_check_early_recovery = opal_mce_check_early_recovery; ··· 285 285 ppc_md.set_rtc_time = rtas_set_rtc_time; 286 286 } 287 287 ppc_md.restart = rtas_restart; 288 - ppc_md.power_off = rtas_power_off; 288 + pm_power_off = rtas_power_off; 289 289 ppc_md.halt = rtas_halt; 290 290 } 291 291 #endif /* CONFIG_PPC_POWERNV_RTAS */
+1 -1
arch/powerpc/platforms/ps3/setup.c
··· 248 248 ps3_mm_init(); 249 249 ps3_mm_vas_create(&htab_size); 250 250 ps3_hpte_init(htab_size); 251 + pm_power_off = ps3_power_off; 251 252 252 253 DBG(" <- %s:%d\n", __func__, __LINE__); 253 254 return 1; ··· 279 278 .calibrate_decr = ps3_calibrate_decr, 280 279 .progress = ps3_progress, 281 280 .restart = ps3_restart, 282 - .power_off = ps3_power_off, 283 281 .halt = ps3_halt, 284 282 #if defined(CONFIG_KEXEC) 285 283 .kexec_cpu_down = ps3_kexec_cpu_down,
+30 -29
arch/powerpc/platforms/pseries/setup.c
··· 659 659 pr_debug(" <- pSeries_init_early()\n"); 660 660 } 661 661 662 + /** 663 + * pseries_power_off - tell firmware about how to power off the system. 664 + * 665 + * This function calls either the power-off rtas token in normal cases 666 + * or the ibm,power-off-ups token (if present & requested) in case of 667 + * a power failure. If power-off token is used, power on will only be 668 + * possible with power button press. If ibm,power-off-ups token is used 669 + * it will allow auto poweron after power is restored. 670 + */ 671 + static void pseries_power_off(void) 672 + { 673 + int rc; 674 + int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups"); 675 + 676 + if (rtas_flash_term_hook) 677 + rtas_flash_term_hook(SYS_POWER_OFF); 678 + 679 + if (rtas_poweron_auto == 0 || 680 + rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) { 681 + rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1); 682 + printk(KERN_INFO "RTAS power-off returned %d\n", rc); 683 + } else { 684 + rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL); 685 + printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc); 686 + } 687 + for (;;); 688 + } 689 + 662 690 /* 663 691 * Called very early, MMU is off, device-tree isn't unflattened 664 692 */ ··· 769 741 else 770 742 hpte_init_native(); 771 743 744 + pm_power_off = pseries_power_off; 745 + 772 746 pr_debug("Machine is%s LPAR !\n", 773 747 (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not"); 774 748 ··· 782 752 if (firmware_has_feature(FW_FEATURE_LPAR)) 783 753 return PCI_PROBE_DEVTREE; 784 754 return PCI_PROBE_NORMAL; 785 - } 786 - 787 - /** 788 - * pSeries_power_off - tell firmware about how to power off the system. 789 - * 790 - * This function calls either the power-off rtas token in normal cases 791 - * or the ibm,power-off-ups token (if present & requested) in case of 792 - * a power failure. If power-off token is used, power on will only be 793 - * possible with power button press. If ibm,power-off-ups token is used 794 - * it will allow auto poweron after power is restored. 795 - */ 796 - static void pSeries_power_off(void) 797 - { 798 - int rc; 799 - int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups"); 800 - 801 - if (rtas_flash_term_hook) 802 - rtas_flash_term_hook(SYS_POWER_OFF); 803 - 804 - if (rtas_poweron_auto == 0 || 805 - rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) { 806 - rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1); 807 - printk(KERN_INFO "RTAS power-off returned %d\n", rc); 808 - } else { 809 - rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL); 810 - printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc); 811 - } 812 - for (;;); 813 755 } 814 756 815 757 #ifndef CONFIG_PCI ··· 798 796 .pcibios_fixup = pSeries_final_fixup, 799 797 .pci_probe_mode = pSeries_pci_probe_mode, 800 798 .restart = rtas_restart, 801 - .power_off = pSeries_power_off, 802 799 .halt = rtas_halt, 803 800 .panic = rtas_os_term, 804 801 .get_boot_time = rtas_get_boot_time,
+1 -1
arch/powerpc/sysdev/fsl_soc.c
··· 238 238 /* 239 239 * Halt the current partition 240 240 * 241 - * This function should be assigned to the ppc_md.power_off and ppc_md.halt 241 + * This function should be assigned to the pm_power_off and ppc_md.halt 242 242 * function pointers, to shut down the partition when we're running under 243 243 * the Freescale hypervisor. 244 244 */
+2 -1
arch/powerpc/xmon/xmon.c
··· 981 981 else if (cmd == 'h') 982 982 ppc_md.halt(); 983 983 else if (cmd == 'p') 984 - ppc_md.power_off(); 984 + if (pm_power_off) 985 + pm_power_off(); 985 986 } 986 987 987 988 static int cpu_cmd(void)