All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Anderson <dianders@chromium.org>
To: Jason Wessel <jason.wessel@windriver.com>,
	Daniel Thompson <daniel.thompson@linaro.org>,
	tglx@linutronix.de, mingo@kernel.org, gregkh@linuxfoundation.org
Cc: linux-arm-msm@vger.kernel.org,
	kgdb-bugreport@lists.sourceforge.net,
	Douglas Anderson <dianders@chromium.org>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	jslaby@suse.com
Subject: [PATCH 1/7] serial: qcom_geni_serial: Finish supporting sysrq
Date: Mon, 29 Oct 2018 11:07:01 -0700	[thread overview]
Message-ID: <20181029180707.207546-2-dianders@chromium.org> (raw)
In-Reply-To: <20181029180707.207546-1-dianders@chromium.org>

The geni serial driver already had some sysrq code in it, but since
SUPPORT_SYSRQ wasn't defined the code didn't do anything useful.
Let's make it useful by adding that define using the same formula
found in other serial drivers.

In order to prevent deadlock, we'll take a page from the
'msm_serial.c' where the spinlock is released around
uart_handle_sysrq_char().  This seemed better than copying from
'8250_port.c' where we skip locking in the console_write function
since the '8250_port.c' method can cause lockdep warnings when
dropping into kgdb.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
---

 drivers/tty/serial/qcom_geni_serial.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
index d3b5261ee80a..3c8e0202da8b 100644
--- a/drivers/tty/serial/qcom_geni_serial.c
+++ b/drivers/tty/serial/qcom_geni_serial.c
@@ -1,6 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0
 // Copyright (c) 2017-2018, The Linux foundation. All rights reserved.
 
+#if defined(CONFIG_SERIAL_QCOM_GENI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+# define SUPPORT_SYSRQ
+#endif
+
 #include <linux/clk.h>
 #include <linux/console.h>
 #include <linux/io.h>
@@ -495,7 +499,10 @@ static int handle_rx_console(struct uart_port *uport, u32 bytes, bool drop)
 					continue;
 			}
 
+			spin_unlock(&uport->lock);
 			sysrq = uart_handle_sysrq_char(uport, buf[c]);
+			spin_lock(&uport->lock);
+
 			if (!sysrq)
 				tty_insert_flip_char(tport, buf[c], TTY_NORMAL);
 		}
-- 
2.19.1.568.g152ad8e336-goog

  reply	other threads:[~2018-10-29 18:07 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 18:07 [PATCH 0/7] serial: Finish kgdb on qcom_geni; fix many lockdep splats w/ kgdb Douglas Anderson
2018-10-29 18:07 ` Douglas Anderson
2018-10-29 18:07 ` Douglas Anderson
2018-10-29 18:07 ` Douglas Anderson
2018-10-29 18:07 ` Douglas Anderson
2018-10-29 18:07 ` Douglas Anderson
2018-10-29 18:07 ` Douglas Anderson [this message]
2018-11-02 16:47   ` [PATCH 1/7] serial: qcom_geni_serial: Finish supporting sysrq Stephen Boyd
2018-11-02 16:47     ` Stephen Boyd
2018-10-29 18:07 ` [PATCH 2/7] serial: core: Allow processing sysrq at port unlock time Douglas Anderson
2018-10-30  5:31   ` Doug Anderson
2018-10-29 18:07 ` [PATCH 3/7] serial: qcom_geni_serial: Process " Douglas Anderson
2018-10-29 18:07 ` [PATCH 4/7] serial: core: Include console.h from serial_core.h Douglas Anderson
2018-10-29 18:07 ` [PATCH 5/7] serial: 8250: Process sysrq at port unlock time Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07 ` [PATCH 6/7] smp: Don't yell about IRQs disabled in kgdb_roundup_cpus() Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-30  8:25   ` Peter Zijlstra
2018-10-30  8:25     ` Peter Zijlstra
2018-10-30  8:25     ` Peter Zijlstra
2018-10-30  8:25     ` Peter Zijlstra
2018-10-30  8:25     ` Peter Zijlstra
2018-10-30  9:41   ` Daniel Thompson
2018-10-30  9:41     ` Daniel Thompson
2018-10-30  9:41     ` Daniel Thompson
2018-10-30  9:41     ` Daniel Thompson
2018-10-30  9:41     ` Daniel Thompson
2018-10-30 22:21     ` Doug Anderson
2018-10-30 22:21       ` Doug Anderson
2018-10-30 22:21       ` Doug Anderson
2018-10-30 22:21       ` Doug Anderson
2018-10-30 22:21       ` Doug Anderson
2018-10-29 18:07 ` [PATCH 7/7] kgdb: Remove irq flags and local_irq_enable/disable from roundup Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-29 18:07   ` Douglas Anderson
2018-10-30 11:46   ` Daniel Thompson
2018-10-30 11:46     ` Daniel Thompson
2018-10-30 11:46     ` Daniel Thompson
2018-10-30 11:46     ` Daniel Thompson
2018-10-30 11:46     ` Daniel Thompson
2018-10-30 11:46     ` Daniel Thompson
2018-10-30 22:22     ` Doug Anderson
2018-10-30 22:22       ` Doug Anderson
2018-10-30 22:22       ` Doug Anderson
2018-10-30 22:22       ` Doug Anderson
2018-10-30 22:22       ` Doug Anderson
2018-10-30 22:22       ` Doug Anderson
2018-10-30 11:56 ` [PATCH 0/7] serial: Finish kgdb on qcom_geni; fix many lockdep splats w/ kgdb Daniel Thompson
2018-10-30 11:56   ` Daniel Thompson
2018-10-30 11:56   ` Daniel Thompson
2018-10-30 11:56   ` Daniel Thompson
2018-10-30 12:31   ` Russell King - ARM Linux
2018-10-30 12:31     ` Russell King - ARM Linux
2018-10-30 12:31     ` Russell King - ARM Linux
2018-10-30 12:31     ` Russell King - ARM Linux
2018-10-30 22:20   ` Doug Anderson
2018-10-30 22:20     ` Doug Anderson
2018-10-30 22:20     ` Doug Anderson
2018-10-30 22:20     ` Doug Anderson
2018-10-30 12:36 ` Andy Shevchenko
2018-10-30 12:36   ` Andy Shevchenko
2018-10-30 12:36   ` Andy Shevchenko
2018-10-30 12:36   ` Andy Shevchenko
2018-10-30 12:36   ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181029180707.207546-2-dianders@chromium.org \
    --to=dianders@chromium.org \
    --cc=daniel.thompson@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jason.wessel@windriver.com \
    --cc=jslaby@suse.com \
    --cc=kgdb-bugreport@lists.sourceforge.net \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.