From patchwork Tue Oct 30 22:11:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 991136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42l5Kj5q3Fz9sBj for ; Wed, 31 Oct 2018 09:11:53 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BOyMZrSf"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42l5Kj3xNGzF1XR for ; Wed, 31 Oct 2018 09:11:53 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BOyMZrSf"; dkim-atps=neutral X-Original-To: linux-aspeed@lists.ozlabs.org Delivered-To: linux-aspeed@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::642; helo=mail-pl1-x642.google.com; envelope-from=dianders@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="BOyMZrSf"; dkim-atps=neutral Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42l5KX5SBrzDrbn for ; Wed, 31 Oct 2018 09:11:44 +1100 (AEDT) Received: by mail-pl1-x642.google.com with SMTP id t6-v6so6219782plo.9 for ; Tue, 30 Oct 2018 15:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=456uG5PlWBnfGUDyET8jKISVXeQZt6ggTh3gygckLP0=; b=BOyMZrSf0rDdTl6nQ87KKVm4mipKJOEpXnTSeLRqAacNT8A+mGPuzJT5RlQ5KEma86 vCK7u5ZxaOWf+wT+U99ktUD7wkcogFKmkbQizZ5GSvhJOG8ld1pAAT0a1u6T1wPrdvpu TK9gy3tPlJKCKO6mY0nvyBrhY4xHwsECJABTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=456uG5PlWBnfGUDyET8jKISVXeQZt6ggTh3gygckLP0=; b=QVZrCAFaGlyk453FPHBCSw30WU0BOGc8DFBhI+SjywcAvt8xEyIKWYoLwR6mHYHVhH MYgm1hwOvWvQwi5r0bePqRGFqjvSLn22b5KvQ3f1EBDdWzZo+gL7InmxonV96+qcDfhZ c0xFItxFDEVWqOIl44UPYm8+QMuJf+w8HOTAisipMPTj9Pco856IUpbdHqOkdRezWgiz ZOm5vwEiKns+xUvJdBzh+0Y7lv2a0s7UTCOYadJrn6GMjdaY+KstGxtAu4EuSZJGQRYq l9t8p7qp7Y+Y238cQNygY3sRH+CEDIzwaefxOvZ+uS1HxdhQGSl65S+N2xW9R7pmmDfW aFWA== X-Gm-Message-State: AGRZ1gIFvez0tunVf2sE+rOIepRtmjmH9IIxqp0UScwPkIO0WL98n1Eq cFn9yOWsncvhYt662NLwet34WQ== X-Google-Smtp-Source: AJdET5dNw5dl4KoW1C3gIRAymO5X3IH4UK1BUJscMzsym9F+sRJkSiHYwKcLxq0iCeAQ8NRIcQ6Sqw== X-Received: by 2002:a17:902:47:: with SMTP id 65-v6mr545840pla.112.1540937502633; Tue, 30 Oct 2018 15:11:42 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:c8e0:70d7:4be7:a36]) by smtp.gmail.com with ESMTPSA id b11-v6sm12844491pgi.10.2018.10.30.15.11.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 15:11:41 -0700 (PDT) From: Douglas Anderson To: Greg Kroah-Hartman , Jiri Slaby Subject: [PATCH v2 1/5] serial: qcom_geni_serial: Finish supporting sysrq Date: Tue, 30 Oct 2018 15:11:03 -0700 Message-Id: <20181030221107.79758-2-dianders@chromium.org> X-Mailer: git-send-email 2.19.1.568.g152ad8e336-goog In-Reply-To: <20181030221107.79758-1-dianders@chromium.org> References: <20181030221107.79758-1-dianders@chromium.org> MIME-Version: 1.0 X-BeenThere: linux-aspeed@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux ASPEED SoC development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dan.carpenter@oracle.com, vigneshr@ti.com, linux-aspeed@lists.ozlabs.org, linux-arm-msm@vger.kernel.org, Douglas Anderson , tony@atomide.com, linux-serial@vger.kernel.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, jk@ozlabs.org Errors-To: linux-aspeed-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Linux-aspeed" 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 --- 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 1515074e18fb..b83e3554bced 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 #include #include @@ -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); }