Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3715841pxb; Mon, 24 Jan 2022 16:09:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgnHGKjwC8Hhy3RtDmBWo4+0YLF68zVqPdXOuO9UOtZQKcjZRAnm+Fn4dDY6zD8hTHjwX0 X-Received: by 2002:a63:7f4d:: with SMTP id p13mr13119623pgn.29.1643069382657; Mon, 24 Jan 2022 16:09:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069382; cv=none; d=google.com; s=arc-20160816; b=V/+YEVN6BjiUmuksdjOhitKJ+Zd8xtkP+RVHA2+HIMuo2fDv6qy7c83o2i6aDKzIi8 1R4Z7nAVqDJpSCAUz/Thf2lXbuNe9AS3URGV99oMishoSfZExa3SCPKGGZVy0SYwSUDc l9su2AbdXOPYyGQMRz3vs78opq23OoQ/2guRVDBPqR3hr4/0ioOalNW2u5SLpxOXsRw8 Xb93gORrdh8jTIUgswzUHZaGvnh5IkO48cNbpMqZRrrc7QYcYFvNxHGYg65Qg3xdbUUK 2mTOJky9aNkeoeaC6qLRDfC1fgyc7q1jC6boBG3CVcUatZQUdWe0WXJvSAAmIfpQUY+4 uQPQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Vf8Pes8TADFTxKje7b/hyiG2uT3EY0gyx18iE+WxM0A=; b=tWro7dgfZu+DLEBY32iFkQoxAiPieoTFC9cj9ty4JrkrMDTsX69mb1b6cpnfdqtY9C jpIRa/t/VeRKlq1oiB2QnqmXIW/Qstpx6fvGD5ynFidhs0lZX1BU1TDEq5e62iRBzBRn Jq3UYk1M/3sZ8l3GDhWKD5lpb6JP2+YuxgAltPFf0207jW/8cxpfsHDR0fA1mQIR9M1Y kYEyiURvPXPRFREs/kqhbTaRHWvG/Bi8y77q9vuvXyZuRTFIwflWtKY8NTEY6vUytQPF Re6TnNP6GKk5MQABNfw3Um+UA7+xjsnmnAQy0Td/TDGoQCwcB0WZhGMmkmzAip4Xb+ID Nqog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eqKxOf3F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n68si14934647pga.305.2022.01.24.16.09.29; Mon, 24 Jan 2022 16:09:42 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=eqKxOf3F; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2371642AbiAYAJZ (ORCPT + 99 others); Mon, 24 Jan 2022 19:09:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1848451AbiAXXWc (ORCPT ); Mon, 24 Jan 2022 18:22:32 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDAE3C073083; Mon, 24 Jan 2022 13:29:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 96229B81061; Mon, 24 Jan 2022 21:29:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA497C33EA1; Mon, 24 Jan 2022 21:29:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059754; bh=AouQkowWMbLpCiSc9HCHcAG0xZ3v+aO3HmXSlgFIZUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eqKxOf3FCPHldMv8tW7t82HItXUfqlWOdHkShvbgdqzuXn1A83moP43F7cmvv9MVv WocVstRxU7qYCXMexUToclehWQX38kx/kelRsnBwI6EkGnHU0TggMwyiaPzBSt8zjH LJzi5/StWAwbnXmc0HBaVTegPYcaqZf+39d3gSKU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Russell King , Lukas Wunner , Sasha Levin Subject: [PATCH 5.16 0721/1039] serial: pl010: Drop CR register reset on set_termios Date: Mon, 24 Jan 2022 19:41:50 +0100 Message-Id: <20220124184149.564971629@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lukas Wunner [ Upstream commit 08a0c6dff91c965e39905cf200d22db989203ccb ] pl010_set_termios() briefly resets the CR register to zero. Where does this register write come from? The PL010 driver's IRQ handler ambauart_int() originally modified the CR register without holding the port spinlock. ambauart_set_termios() also modified that register. To prevent concurrent read-modify-writes by the IRQ handler and to prevent transmission while changing baudrate, ambauart_set_termios() had to disable interrupts. That is achieved by writing zero to the CR register. However in 2004 the PL010 driver was amended to acquire the port spinlock in the IRQ handler, obviating the need to disable interrupts in ->set_termios(): https://git.kernel.org/history/history/c/157c0342e591 That rendered the CR register write obsolete. Drop it. Cc: Russell King Signed-off-by: Lukas Wunner Link: https://lore.kernel.org/r/fcaff16e5b1abb4cc3da5a2879ac13f278b99ed0.1641128728.git.lukas@wunner.de Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/amba-pl010.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c index e744b953ca346..47654073123d6 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -446,14 +446,11 @@ pl010_set_termios(struct uart_port *port, struct ktermios *termios, if ((termios->c_cflag & CREAD) == 0) uap->port.ignore_status_mask |= UART_DUMMY_RSR_RX; - /* first, disable everything */ old_cr = readb(uap->port.membase + UART010_CR) & ~UART010_CR_MSIE; if (UART_ENABLE_MS(port, termios->c_cflag)) old_cr |= UART010_CR_MSIE; - writel(0, uap->port.membase + UART010_CR); - /* Set baud rate */ quot -= 1; writel((quot & 0xf00) >> 8, uap->port.membase + UART010_LCRM); -- 2.34.1