Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3676634pxb; Mon, 24 Jan 2022 15:06:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMz3VWTe3mT3w4dvhIsoOrlW4uV7WMN1LVVB9xDwvF4UKrfu3b4wsRvpAyJOOko3A6pFNZ X-Received: by 2002:a17:902:9a08:b0:149:7da0:b7ad with SMTP id v8-20020a1709029a0800b001497da0b7admr16489594plp.84.1643065590235; Mon, 24 Jan 2022 15:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643065590; cv=none; d=google.com; s=arc-20160816; b=Np1a5mCf4ZqZTR36NypvWvrD1p90h9sxol0wtFKLJARKynzohA7i0jn8zbhRqoN+Hj Uwwiw8qD0KeydcE+ehMKDTUG3Y/WqO9eEql/Cm/sgGY8tBDFoFlRfsrCjqsJ2gUEMKQQ VXWoTYSdGBuxp8cwWo+gVeUXfBW+Z6e54L0OOtJif/Ar2y5KS8wH8p4Pj5n1/Lst7KFm oLR4wdZlw56AGZuLkJeBSjTp4uXqyelCmBxLoMax2QMppU7vd45asYUBCaDSvYQUjIfj 762PpVE14Yx+B5KANTqv6Sp5RWc3L6qbcDBxvzwjh6hEt2LPeCgFRr8UHcIKfbiGcKXI /Z1w== 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=E4BIiYstfTRBzPMb0iLdT6mhpKZ0V/prF/qfmsjvSpt+00V1evvInd22IhrXycXp2n 7xhNk6fnYmebVdqTqU1YukhGaknbir0yoXWPGh+4mMOswrKcT4xkEdOQS/kGmSoc0o6C B5ogMM1nS/TfdvLHdOWMlf7sDgwAA6GlY0JmbMwtaM/0/i5qQucujgBfQloSwTTDorQ2 zmzwdtXF4n1nZopkgI8KjBXzL2vjpMrzqcBQIOs8Lhxg2OgaAvbUMS+HtliMxXMBRxAi hIZqVOVZhD4e87T9H+0P/hhQyiU7tJPCl/Ht97AlktwHnA0Tzu4dVR1K77lJQIAFbt9B h9Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XzrsR16f; 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 n63si14600382pfn.298.2022.01.24.15.06.18; Mon, 24 Jan 2022 15:06:30 -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=XzrsR16f; 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 S1842446AbiAXXBw (ORCPT + 99 others); Mon, 24 Jan 2022 18:01:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1577998AbiAXWBY (ORCPT ); Mon, 24 Jan 2022 17:01:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD7FCC02416B; Mon, 24 Jan 2022 12:41: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 dfw.source.kernel.org (Postfix) with ESMTPS id 4CADB615A2; Mon, 24 Jan 2022 20:41:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B43E2C340EB; Mon, 24 Jan 2022 20:41:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643056874; bh=AouQkowWMbLpCiSc9HCHcAG0xZ3v+aO3HmXSlgFIZUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XzrsR16fP2gljAd4nZmdzg+9U4saLs/izDGZLEI2d7EmQgnJECT2m7pPwhsvVFi4z 35C8dCGJmhSI6O2vbZQhjZ+IK1X9hBz39FPppwd5U+Pp0x5ovGzHYbctxvXQjeEvCX L3BfeFmde6LKKBa1M16GCOAbIt5pVA2c0seJ3lis= 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.15 611/846] serial: pl010: Drop CR register reset on set_termios Date: Mon, 24 Jan 2022 19:42:08 +0100 Message-Id: <20220124184122.109708891@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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