drm/amdgpu: Do error injection even vram reserve fails
[linux-2.6-microblaze.git] / kernel / reboot.c
index e1b79b6..c4d472b 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  *  linux/kernel/reboot.c
  *
@@ -31,6 +32,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 +521,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 +530,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 +564,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':