Merge tag 'tegra-for-5.2-arm64-dt-fixes' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / kernel / reboot.c
index e1b79b6a273550516a57d3f7db10c236fcdf0305..b9e79e8c722654e84cc90407f3dfc8322d4ffe23 100644 (file)
@@ -31,6 +31,7 @@ EXPORT_SYMBOL(cad_pid);
 #define DEFAULT_REBOOT_MODE
 #endif
 enum reboot_mode reboot_mode DEFAULT_REBOOT_MODE;
+enum reboot_mode panic_reboot_mode = REBOOT_UNDEFINED;
 
 /*
  * This variable is used privately to keep track of whether or not
@@ -519,6 +520,8 @@ EXPORT_SYMBOL_GPL(orderly_reboot);
 static int __init reboot_setup(char *str)
 {
        for (;;) {
+               enum reboot_mode *mode;
+
                /*
                 * Having anything passed on the command line via
                 * reboot= will cause us to disable DMI checking
@@ -526,17 +529,24 @@ static int __init reboot_setup(char *str)
                 */
                reboot_default = 0;
 
+               if (!strncmp(str, "panic_", 6)) {
+                       mode = &panic_reboot_mode;
+                       str += 6;
+               } else {
+                       mode = &reboot_mode;
+               }
+
                switch (*str) {
                case 'w':
-                       reboot_mode = REBOOT_WARM;
+                       *mode = REBOOT_WARM;
                        break;
 
                case 'c':
-                       reboot_mode = REBOOT_COLD;
+                       *mode = REBOOT_COLD;
                        break;
 
                case 'h':
-                       reboot_mode = REBOOT_HARD;
+                       *mode = REBOOT_HARD;
                        break;
 
                case 's':
@@ -553,11 +563,11 @@ static int __init reboot_setup(char *str)
                                if (rc)
                                        return rc;
                        } else
-                               reboot_mode = REBOOT_SOFT;
+                               *mode = REBOOT_SOFT;
                        break;
                }
                case 'g':
-                       reboot_mode = REBOOT_GPIO;
+                       *mode = REBOOT_GPIO;
                        break;
 
                case 'b':