]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
power: reset: set arm_pm_restart hook in msm-poweroff driver
authorLothar Waßmann <LW@KARO-electronics.de>
Tue, 7 Mar 2017 14:09:26 +0000 (15:09 +0100)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 7 Mar 2017 14:09:26 +0000 (15:09 +0100)
For some yet unknown reason the system fails to restart via the PSCI
subsystem. Setup the arm_pm_restart hook to restart the system via
do_msm_restart().
This may not be the ultimately correct solution, but it at least makes
the system rebootable.

drivers/power/reset/msm-poweroff.c

index 4702efdfe466626f97f2b887868e47f611107d17..082ec66018d114ac138bdceb0abe790bc0fdae94 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/reboot.h>
 #include <linux/pm.h>
+#include <asm/system_misc.h>
 
 static void __iomem *msm_ps_hold;
 static int do_msm_restart(struct notifier_block *nb, unsigned long action,
@@ -37,6 +38,11 @@ static struct notifier_block restart_nb = {
        .priority = 128,
 };
 
+static inline void __do_msm_restart(enum reboot_mode reboot_mode, const char *cmd)
+{
+       do_msm_restart(&restart_nb, 0, NULL);
+}
+
 static void do_msm_poweroff(void)
 {
        /* TODO: Add poweroff capability */
@@ -55,6 +61,7 @@ static int msm_restart_probe(struct platform_device *pdev)
 
        register_restart_handler(&restart_nb);
 
+       arm_pm_restart = __do_msm_restart;
        pm_power_off = do_msm_poweroff;
 
        return 0;
@@ -62,7 +69,7 @@ static int msm_restart_probe(struct platform_device *pdev)
 
 static const struct of_device_id of_msm_restart_match[] = {
        { .compatible = "qcom,pshold", },
-       {},
+       {}
 };
 MODULE_DEVICE_TABLE(of, of_msm_restart_match);