Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4513508pxj; Wed, 12 May 2021 07:15:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLjkwUs5JKyPITvoWXK6MtR6XpOUrPDaZ2O7GNyw6cCXkYbcYHSE7ZCioVLoQJZBkifEOD X-Received: by 2002:a9d:37a1:: with SMTP id x30mr25257489otb.141.1620828935137; Wed, 12 May 2021 07:15:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620828935; cv=none; d=google.com; s=arc-20160816; b=QYAtl+H612lduNGZk0xzX24F84TUbnefLtYEDsyDbZ6nrb4SX9JXVP2ZutEtZY+vjj RCyUSw47+l6uGf9AYI42oMfK+VuDDzXn98gT7Ixm0eBADO4t6cugGj6w0t7pvMPrOu7G tcf8Lk1e6jIClDMJOg7Wrk+W4VlqOBjX6XOe4Cf3UV+NWaCZOg4X0tV7fI/9x62AQv7F B3Ssgme1Yl7MRvMM2MwiwlrQRZdU0whUCthfHQbDbyqfY5dhoABFP1sgx57/NpgPnyNI dbVHOmit5QJAkxm82Wa+zEG5bGdREHnweVGnZqhwPkJGm57lONBb2uI0nk/FQTMI8IDh r6vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rmpSNgM9mDURcLAQ47HsvC3UAZc1p3XAcKNA/nVD8AM=; b=VhkkQsRR86QuOOasULKCsCiFrLyvpNaRyVdL4GLgH4kBwPj6VuC8tLhwER3w8gR/ZW RSKSds8hpBzfninogNY7Nz+0r8QrLzXIs3k9BHdvk8Jh7oOlzyB/dsHf/jeUa/6WfIzi 07rWzRnmu8k3cF2ocs4K98enRBdBze4j73uK70vlsIj9B9iuMSopT6ZUPDYLRy6/j3V3 Fn2cGaVeEkkPt9qBPUOOj6iE6SuJSuI1vdy1FZuw2agJGu72qpl59Ges5EbsMt4KO9xg yGHNfQyc89UcQeeXmshR5u2wsx9NIACP2OvPADPWXi7RvW0UfduAECUukX3Z3CulJAXm yt8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=g0FZ8yC+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q206si82585oib.141.2021.05.12.07.15.21; Wed, 12 May 2021 07:15:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=g0FZ8yC+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231494AbhELOOw (ORCPT + 99 others); Wed, 12 May 2021 10:14:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231404AbhELOOQ (ORCPT ); Wed, 12 May 2021 10:14:16 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50753C061574; Wed, 12 May 2021 07:13:08 -0700 (PDT) Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 91B6922260; Wed, 12 May 2021 16:13:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1620828786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rmpSNgM9mDURcLAQ47HsvC3UAZc1p3XAcKNA/nVD8AM=; b=g0FZ8yC+UVxgMDUpDWgSLlBu+Q5/gXbzStzZSwB/ndTFR87N2slxxqwgxx7kR4uAm05++B 71MfvgjNmg2Pmi2f5x/IcVct7Ndzqtz/w5B50PoNRWll4P6oWS+IVeoDEf35TBVOcEx528 DDAjW74vz92Y9vAiP1jHsoAHqFJNXw8= From: Michael Walle To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Angelo Dureghello , Johan Hovold , Philippe Schenker , Michael Walle Subject: [PATCH v2 3/9] serial: fsl_lpuart: don't restore interrupt state in ISR Date: Wed, 12 May 2021 16:12:49 +0200 Message-Id: <20210512141255.18277-4-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210512141255.18277-1-michael@walle.cc> References: <20210512141255.18277-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From commit 75f4e830fa9c ("serial: do not restore interrupt state in sysrq helper"): Since commit 81e2073c175b ("genirq: Disable interrupts for force threaded handlers") interrupt handlers that are not explicitly requested as threaded are always called with interrupts disabled and there is no need to save the interrupt state when taking the port lock. Apply this also to fsl_lpuart in prepartion for sysrq handling with uart_unlock_and_check_sysrq(). Signed-off-by: Michael Walle --- drivers/tty/serial/fsl_lpuart.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index b76ddc0d8edc..37e02d992c0b 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -824,21 +824,18 @@ static unsigned int lpuart32_tx_empty(struct uart_port *port) static void lpuart_txint(struct lpuart_port *sport) { - unsigned long flags; - - spin_lock_irqsave(&sport->port.lock, flags); + spin_lock(&sport->port.lock); lpuart_transmit_buffer(sport); - spin_unlock_irqrestore(&sport->port.lock, flags); + spin_unlock(&sport->port.lock); } static void lpuart_rxint(struct lpuart_port *sport) { unsigned int flg, ignored = 0, overrun = 0; struct tty_port *port = &sport->port.state->port; - unsigned long flags; unsigned char rx, sr; - spin_lock_irqsave(&sport->port.lock, flags); + spin_lock(&sport->port.lock); while (!(readb(sport->port.membase + UARTSFIFO) & UARTSFIFO_RXEMPT)) { flg = TTY_NORMAL; @@ -896,28 +893,25 @@ static void lpuart_rxint(struct lpuart_port *sport) writeb(UARTSFIFO_RXOF, sport->port.membase + UARTSFIFO); } - spin_unlock_irqrestore(&sport->port.lock, flags); + spin_unlock(&sport->port.lock); tty_flip_buffer_push(port); } static void lpuart32_txint(struct lpuart_port *sport) { - unsigned long flags; - - spin_lock_irqsave(&sport->port.lock, flags); + spin_lock(&sport->port.lock); lpuart32_transmit_buffer(sport); - spin_unlock_irqrestore(&sport->port.lock, flags); + spin_unlock(&sport->port.lock); } static void lpuart32_rxint(struct lpuart_port *sport) { unsigned int flg, ignored = 0; struct tty_port *port = &sport->port.state->port; - unsigned long flags; unsigned long rx, sr; - spin_lock_irqsave(&sport->port.lock, flags); + spin_lock(&sport->port.lock); while (!(lpuart32_read(&sport->port, UARTFIFO) & UARTFIFO_RXEMPT)) { flg = TTY_NORMAL; @@ -965,7 +959,7 @@ static void lpuart32_rxint(struct lpuart_port *sport) } out: - spin_unlock_irqrestore(&sport->port.lock, flags); + spin_unlock(&sport->port.lock); tty_flip_buffer_push(port); } -- 2.20.1