From patchwork Tue Oct 30 22:11:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10661675 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F19913A4 for ; Tue, 30 Oct 2018 22:11:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F36832AA6A for ; Tue, 30 Oct 2018 22:11:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E78352AA7D; Tue, 30 Oct 2018 22:11:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A3262AA6A for ; Tue, 30 Oct 2018 22:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbeJaHHC (ORCPT ); Wed, 31 Oct 2018 03:07:02 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46045 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbeJaHHC (ORCPT ); Wed, 31 Oct 2018 03:07:02 -0400 Received: by mail-pf1-f195.google.com with SMTP id v5-v6so1645071pfm.12 for ; Tue, 30 Oct 2018 15:11:46 -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=94psJMyqz8IkfzVie06Fc1uYcJtaXinZcw3VnGuFFDk=; b=lsehY/L8EcTjAHcVmYw2kWgDuy0jhwcjzWfAnRWkA1CmkV/5uEz9tqmfB0zrJWi1DW vh3FZSEO5NcuNadT0CJX0Cm75uPCxo6Sr5VuKxcjrbY3v7GXEPEGlhAWiaT4ClOoneQp AFfyw0ZLvuSPYC/YzXRURJ377ViUey6Q3tyds= 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=94psJMyqz8IkfzVie06Fc1uYcJtaXinZcw3VnGuFFDk=; b=KO1aUEBpMOL7o8g39EVC1bo2FZTcU4suIoQT+KGlRaFHDDMvWnI9ymkOQsROrbeHYo kofzMbfosKPxS5JheerbMiKnS3dylxfZg/oZiPO6w3D6waZUh30ZSmDFIGtPNS0bOH5o 8YSMNzVv4gnz28mhskkaAUGvUl71mEj25JZl8bI0feeCAL6cPrRqe1vvz1acxtD5pNKZ 3+euCcgKF02z64uoCXtOHgw67gwW04s9Fn4cQXjeQyNj/PwM3ug+u4EpSS8+K8UhuSGa 12nOuEkCFb/+UWvb3eN2ruzblOU9+x0yD6+vMELmjBcmNO1zZc73BMxmGXVTQh8FwsK1 OR2g== X-Gm-Message-State: AGRZ1gLWwUgDJVDiEnq8D+1Aiifbnh7HnrIr15NGMzFedJCbRKbmQ+Ea WnelBI9Gsthkjl+dsBuZWpY9wQ== X-Google-Smtp-Source: AJdET5cgkvKnnP49uNC3FnivblVrxS6bINQFRUrAXaVXsY2Awh35LGm4zeqSp5GDOSBvVhqwYWyOzA== X-Received: by 2002:a63:a612:: with SMTP id t18-v6mr503544pge.338.1540937505696; Tue, 30 Oct 2018 15:11:45 -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.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 15:11:44 -0700 (PDT) From: Douglas Anderson To: Greg Kroah-Hartman , Jiri Slaby Cc: linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, linux-aspeed@lists.ozlabs.org, andrew@aj.id.au, tony@atomide.com, joel@jms.id.au, linux-serial@vger.kernel.org, linux-arm-msm@vger.kernel.org, andriy.shevchenko@linux.intel.com, dan.carpenter@oracle.com, jk@ozlabs.org, Douglas Anderson Subject: [PATCH v2 3/5] serial: qcom_geni_serial: Process sysrq at port unlock time Date: Tue, 30 Oct 2018 15:11:05 -0700 Message-Id: <20181030221107.79758-4-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 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Let's take advantage of the new ("serial: core: Allow processing sysrq at port unlock time") to handle sysrqs more cleanly. Signed-off-by: Douglas Anderson --- drivers/tty/serial/qcom_geni_serial.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index b83e3554bced..29ddc1fc65f8 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -499,9 +499,7 @@ 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); + sysrq = uart_prepare_sysrq_char(uport, buf[c]); if (!sysrq) tty_insert_flip_char(tport, buf[c], TTY_NORMAL); @@ -811,7 +809,8 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev) qcom_geni_serial_handle_rx(uport, drop_rx); out_unlock: - spin_unlock_irqrestore(&uport->lock, flags); + uart_unlock_and_check_sysrq(uport, flags); + return IRQ_HANDLED; }