diff mbox series

[2/2,DO,NOT,MERGE] tty/vt: add some logging to vt error path

Message ID 20220504114808.1578304-2-andrzej.hajda@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915/fbdev: print error in case drm_fb_helper_initial_config fails | expand

Commit Message

Andrzej Hajda May 4, 2022, 11:48 a.m. UTC
Intel CI contains machine which permanently fails with
fb initialization with crashes. Add extra logs to debug the issue.

Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com>
---
 drivers/tty/vt/vt.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index f8c87c4d739955..430d9639d9fd20 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3627,6 +3627,8 @@  int __init vty_init(const struct file_operations *console_fops)
 
 static struct class *vtconsole_class;
 
+#define ERR(__err) ({ void *err = ERR_PTR(__err); pr_err("%s:%d: err=%pe\n", __func__, __LINE__, err); PTR_ERR(err); })
+
 static int do_bind_con_driver(const struct consw *csw, int first, int last,
 			   int deflt)
 {
@@ -3636,7 +3638,7 @@  static int do_bind_con_driver(const struct consw *csw, int first, int last,
 	int i, j = -1, k = -1, retval = -ENODEV;
 
 	if (!try_module_get(owner))
-		return -ENODEV;
+		return ERR(-ENODEV);
 
 	WARN_CONSOLE_UNLOCKED();
 
@@ -3651,7 +3653,7 @@  static int do_bind_con_driver(const struct consw *csw, int first, int last,
 		}
 	}
 
-	if (retval)
+	if (retval && ERR(retval))
 		goto err;
 
 	if (!(con_driver->flag & CON_DRIVER_FLAG_INIT)) {
@@ -4111,21 +4113,21 @@  static int do_register_con_driver(const struct consw *csw, int first, int last)
 	WARN_CONSOLE_UNLOCKED();
 
 	if (!try_module_get(owner))
-		return -ENODEV;
+		return ERR(-ENODEV);
 
 	for (i = 0; i < MAX_NR_CON_DRIVER; i++) {
 		con_driver = &registered_con_driver[i];
 
 		/* already registered */
 		if (con_driver->con == csw) {
-			retval = -EBUSY;
+			retval = ERR(-EBUSY);
 			goto err;
 		}
 	}
 
 	desc = csw->con_startup();
 	if (!desc) {
-		retval = -ENODEV;
+		retval = ERR(-ENODEV);
 		goto err;
 	}
 
@@ -4148,7 +4150,7 @@  static int do_register_con_driver(const struct consw *csw, int first, int last)
 		}
 	}
 
-	if (retval)
+	if (retval && ERR(retval))
 		goto err;
 
 	con_driver->dev =