Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3838436pxj; Tue, 11 May 2021 13:03:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzn7npgCAOWDZCy2KMB6ctzVP13txF23KLhBgAPAQZ7awEDI0aeSVZcct/3PpwFKepPEZbZ X-Received: by 2002:a17:906:254c:: with SMTP id j12mr3284868ejb.4.1620763421859; Tue, 11 May 2021 13:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620763421; cv=none; d=google.com; s=arc-20160816; b=maMd3pkAVbmwzZuWUjTg/E5umuLN4Bhtw8Kc9htJ+zvjYjXdsNITysdeMtT1//5HD+ YW9osgD8BHAYkcVnhA5aK6AVqQQMWQff9AKvFvnghbWUASPmXc1ti39QeJQWgbUCsng3 n+dle3zz2+efgaGEYGpaEt41PA1igRo7xZVL/621JS0k869ZLPi/AuGxHOSAoSZSj4aH uZlMMCVFx9Ppc+ZfEjLlErMbL8b+O95v3cVJBnyk0ZTa7l3uD7+icr+ZQS5lfm+Iu/z0 u3kdjZQ8noYFz3O9bY+Fq3H4xdr8ySqyBnTJZFTPCRHn2kE6lfZY3AOyGX/EM1UtDWsX lKNQ== 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=7FlC0W7hdmnwL8NVgZBzJs2VoBJbNxHEHPgAnImmTbw=; b=eeYhz/9j19zhDomdbw4U1aqIzbeR/Sv497ii5pna+xJ7cQE7981jyRn5dvZzziX4IL aKN3HvKffmPxQ78BUF5pdpj6lxDNTORERHtPUIKzBeefLfVHriqoZ4m88Th57b7DB4sM pJhSKNmK8RgqzkpvaonTI+mfL1UGmCtoAvbupejz+m8lHfI0GZfyszQOZUMjMrtKpCG5 JHqQRt09AfcS8/+BdmPWeygYdRckPLKxDlcWc0dBd/GhBrMFZGRrnlcVmMwYRTUXS9k8 UzgLmkKRNgXVVjEFNp+oXC83RO/sPcSi67vLFLlwoPo/r0Xvvao0anet0J/JkGL3GrM3 lggA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=tMxVUUrt; 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 w14si10187424edd.111.2021.05.11.13.03.18; Tue, 11 May 2021 13:03:41 -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=tMxVUUrt; 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 S230167AbhEKUDP (ORCPT + 99 others); Tue, 11 May 2021 16:03:15 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:47565 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbhEKUDL (ORCPT ); Tue, 11 May 2021 16:03:11 -0400 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 B78D922268; Tue, 11 May 2021 22:02:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1620763323; 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=7FlC0W7hdmnwL8NVgZBzJs2VoBJbNxHEHPgAnImmTbw=; b=tMxVUUrtU2hP9ul+M2wzZmUUIg3uf89rnMUjc/Hvdhvq188tzDy5iQuSCC02V0ipyKqD4N mNdaSu4S7M+TSUGzDpgpZo+AeIp/eV8F180TycrDIfHlI8UR4LpzoC+nWcpcrgxdq0clAa sG2qS6bf9rJNi1iy0iwwhC8O9I8chMo= From: Michael Walle To: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Angelo Dureghello , Fugang Duan , Philippe Schenker , Michael Walle Subject: [PATCH 3/8] serial: fsl_lpuart: don't restore interrupt state in ISR Date: Tue, 11 May 2021 22:01:43 +0200 Message-Id: <20210511200148.11934-4-michael@walle.cc> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210511200148.11934-1-michael@walle.cc> References: <20210511200148.11934-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. This is a preparation for sysrq handling which uses 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