Patch "kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kgdb-make-kgdbcon-work-properly-with-kgdb_earlycon.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 29ee4d426eb57040461725ca55617f2869224af2
Author: Douglas Anderson <dianders@xxxxxxxxxxxx>
Date:   Tue Jun 30 15:14:38 2020 -0700

    kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"
    
    [ Upstream commit b18b099e04f450cdc77bec72acefcde7042bd1f3 ]
    
    On my system the kernel processes the "kgdb_earlycon" parameter before
    the "kgdbcon" parameter.  When we setup "kgdb_earlycon" we'll end up
    in kgdb_register_callbacks() and "kgdb_use_con" won't have been set
    yet so we'll never get around to starting "kgdbcon".  Let's remedy
    this by detecting that the IO module was already registered when
    setting "kgdb_use_con" and registering the console then.
    
    As part of this, to avoid pre-declaring things, move the handling of
    the "kgdbcon" further down in the file.
    
    Signed-off-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200630151422.1.I4aa062751ff5e281f5116655c976dff545c09a46@changeid
    Signed-off-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index b16dbc1bf0567..404d6d47a11da 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -94,14 +94,6 @@ int dbg_switch_cpu;
 /* Use kdb or gdbserver mode */
 int dbg_kdb_mode = 1;
 
-static int __init opt_kgdb_con(char *str)
-{
-	kgdb_use_con = 1;
-	return 0;
-}
-
-early_param("kgdbcon", opt_kgdb_con);
-
 module_param(kgdb_use_con, int, 0644);
 module_param(kgdbreboot, int, 0644);
 
@@ -920,6 +912,20 @@ static struct console kgdbcons = {
 	.index		= -1,
 };
 
+static int __init opt_kgdb_con(char *str)
+{
+	kgdb_use_con = 1;
+
+	if (kgdb_io_module_registered && !kgdb_con_registered) {
+		register_console(&kgdbcons);
+		kgdb_con_registered = 1;
+	}
+
+	return 0;
+}
+
+early_param("kgdbcon", opt_kgdb_con);
+
 #ifdef CONFIG_MAGIC_SYSRQ
 static void sysrq_handle_dbg(int key)
 {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux