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: 10661687 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 C857813A4 for ; Tue, 30 Oct 2018 22:12:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B85452A89E for ; Tue, 30 Oct 2018 22:12:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABFB42AA78; Tue, 30 Oct 2018 22:12:37 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 536DE2A89E for ; Tue, 30 Oct 2018 22:12:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=For6jqTSE7fMQOAPvy/kwgGFW4RXMo+HfDGVM1fJ5Q4=; b=PQsV+vs/GVfWF1 f/euSViHFq/NT3MdsJtDjwFqb0mhmp2+rMN7w4nO2pBTsAkS9z3HjW+XSNSQvt1+gI0P9844+iW+G cGkY8I0Icy7aGHA3Kw3rxg5loydfdsFWwsSY339LVJMUOxWRICVyx/cIZ90Wl3j2yn2vgD6L5j0Ic ko9dhu9fwIoQgW6NGxx2qfUiEJex07xyE3vMGB53O6m+pgXxrgHRNM+H2Ju3ZmHjRJAxQpZInLkpn BvkHq0pjCtZveHFZr6a6s/FkOMvn/Dn9CAOItzq5ArzyTJ3WEYyZpdhFHsysyGrwYP7ZAcwHm4BWZ F2TNSrqXLiIDUnHW+RyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHcFW-0007rD-VN; Tue, 30 Oct 2018 22:12:34 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHcEu-00078e-Fd for linux-arm-kernel@lists.infradead.org; Tue, 30 Oct 2018 22:11:59 +0000 Received: by mail-pg1-x543.google.com with SMTP id c10-v6so6348518pgq.4 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=Gaulrt5KHB+OXSfe0Io4IE8sxciIg+WxjS5Z94O+05lBqoDLOiZV5c4FgwsZoxi9ye WHn5XdYBMK3KfGiUiVotxznqGPahKHPIxbSjFyxG9axoBTyFnP0wXNnG2L6wZwOIXOc4 FeQxIbF6HAaTP7jOX76nQ081doU8+T0nRt2uN2kwQNVxNrEIFJ1QxKVn5gLM301U4tnJ C46lP7TskFsNrZp9KRN9B9C5YM4AOUN3cCVUEceYxS9j77z2ZmJ0DwhAJXsee1xM4dJw ajeNX0niAb1dwxTcoAqIIhWqyI602tHIDSFpr9noxLqD4vbRxd687WqLA5monHR1d1WQ dUhQ== X-Gm-Message-State: AGRZ1gLaA3GM84PTdi4DK2uEKqNMPZE/2mWfOO0wMUJcTrpetUBpk2Dg kkX+dhu9rbGI4WE5XDYMM3kIyQ== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181030_151156_735829_B53A2602 X-CRM114-Status: GOOD ( 11.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dan.carpenter@oracle.com, vigneshr@ti.com, linux-aspeed@lists.ozlabs.org, andrew@aj.id.au, linux-arm-msm@vger.kernel.org, Douglas Anderson , tony@atomide.com, joel@jms.id.au, linux-serial@vger.kernel.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, jk@ozlabs.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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; }