aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ps3/ps3-sys-manager.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2008-03-26 20:38:31 -0400
committerPaul Mackerras <paulus@samba.org>2008-04-01 05:43:07 -0400
commitca052f7924141f34998ab440bb4d908dc021a46b (patch)
treef84280e5932f214794afcbbe95d866eabcf0a3a7 /drivers/ps3/ps3-sys-manager.c
parent5761eaa3a5ae3c7ea796add73b86176b7c963cca (diff)
[POWERPC] PS3: Save power in busy loops on halt
PS3 save power on halt: - Replace infinite busy loops by smarter loops calling lv1_pause() to save power. - Add ps3_halt() and ps3_sys_manager_halt(). - Add __noreturn annotations. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/ps3/ps3-sys-manager.c')
-rw-r--r--drivers/ps3/ps3-sys-manager.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/ps3/ps3-sys-manager.c b/drivers/ps3/ps3-sys-manager.c
index d4f6f960dd18..1260b01a5361 100644
--- a/drivers/ps3/ps3-sys-manager.c
+++ b/drivers/ps3/ps3-sys-manager.c
@@ -24,6 +24,7 @@
24#include <linux/reboot.h> 24#include <linux/reboot.h>
25 25
26#include <asm/firmware.h> 26#include <asm/firmware.h>
27#include <asm/lv1call.h>
27#include <asm/ps3.h> 28#include <asm/ps3.h>
28 29
29#include "vuart.h" 30#include "vuart.h"
@@ -581,6 +582,23 @@ fail_id:
581 return -EIO; 582 return -EIO;
582} 583}
583 584
585static void ps3_sys_manager_fin(struct ps3_system_bus_device *dev)
586{
587 ps3_sys_manager_send_request_shutdown(dev);
588
589 pr_emerg("System Halted, OK to turn off power\n");
590
591 while (ps3_sys_manager_handle_msg(dev)) {
592 /* pause until next DEC interrupt */
593 lv1_pause(0);
594 }
595
596 while (1) {
597 /* pause, ignoring DEC interrupt */
598 lv1_pause(1);
599 }
600}
601
584/** 602/**
585 * ps3_sys_manager_final_power_off - The final platform machine_power_off routine. 603 * ps3_sys_manager_final_power_off - The final platform machine_power_off routine.
586 * 604 *
@@ -602,12 +620,8 @@ static void ps3_sys_manager_final_power_off(struct ps3_system_bus_device *dev)
602 620
603 ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_SHUTDOWN, 621 ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_SHUTDOWN,
604 PS3_SM_WAKE_DEFAULT); 622 PS3_SM_WAKE_DEFAULT);
605 ps3_sys_manager_send_request_shutdown(dev);
606
607 pr_emerg("System Halted, OK to turn off power\n");
608 623
609 while (1) 624 ps3_sys_manager_fin(dev);
610 ps3_sys_manager_handle_msg(dev);
611} 625}
612 626
613/** 627/**
@@ -639,12 +653,8 @@ static void ps3_sys_manager_final_restart(struct ps3_system_bus_device *dev)
639 ps3_sys_manager_send_attr(dev, 0); 653 ps3_sys_manager_send_attr(dev, 0);
640 ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT, 654 ps3_sys_manager_send_next_op(dev, PS3_SM_NEXT_OP_SYS_REBOOT,
641 PS3_SM_WAKE_DEFAULT); 655 PS3_SM_WAKE_DEFAULT);
642 ps3_sys_manager_send_request_shutdown(dev);
643
644 pr_emerg("System Halted, OK to turn off power\n");
645 656
646 while (1) 657 ps3_sys_manager_fin(dev);
647 ps3_sys_manager_handle_msg(dev);
648} 658}
649 659
650/** 660/**