Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3562819pxb; Mon, 24 Jan 2022 12:17:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzioEQvjb7oiVeE65P02kEZ/1yfOHDqku8k61stHUaDG71aGqsYCMu5bOajUb7PIJLNrJFa X-Received: by 2002:a62:7e82:0:b0:4c7:2228:8d8f with SMTP id z124-20020a627e82000000b004c722288d8fmr15370518pfc.57.1643055434036; Mon, 24 Jan 2022 12:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055434; cv=none; d=google.com; s=arc-20160816; b=hlq1leaTVvs/rxB1hXu0ZHkXV/wBrRG5NhHaI2o5Tqtv7xVn5DJ21hoKFSdvxHmsjE nme3+697l2Il9PpmSPfbz0NMk1YOx4tPZOg8zblCnW/ha1mbyDBGiCuRXqdbBGOvYfpI /6APV2MfgYeC0Hxxnyxby8mWB8dAzMz9TfnpU1KY7X+9iCcCQBLFVdxgPGMRKPp7wWb1 tvMDmFONXRK4H+8XHZPLxfUQ/KC9Z56Up5Qbli2/gj8kJtAXxxStvdnlp8r3TKXNteao lp99v+Ji0LCvsMmiu9e6HKdZDiLaUGLiZ19pjqTZR40N2QMNp5hPqgciyj7OgH0rLsFo dl+w== 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=2iSv7YDQSVT2syOgwBrcar6rLzaqfVav+4Vy8TG3iXg=; b=SyWqZvsm5RBUhcBbuPg7+SdGd0JfVmTFsQA6znCyVXh9KImhJ41bR8Oq8s4RNznyid slJsBO98veLqhiNGNGdIbdBMsKW3aVUtj8A5NOBZlfqlzckFcdcnaW5JJzsHfWg7/fm5 E9P4dmypTNCIWsoykAD8xgQJahBmdopq8zvP6xCqWNCeiLaizRUda4JXGqJz5WVK0Zvn AjxFZg1Hl6G1agNawE1PnKl4i7IHtIl/Dq4dOEM9AM3ayKTx6ebFp7t7TJ1FF/ZFN9m0 I43YS/GI0feSNqQSLQzAwMy5SECOG23qfDT62iE4i/brWKi8CoOwQO8NKgwlzzsl9dJn 150A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o5ykQ+TZ; 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 f8si15514336pgp.820.2022.01.24.12.17.02; Mon, 24 Jan 2022 12:17:14 -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=o5ykQ+TZ; 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 S1345449AbiAXTST (ORCPT + 99 others); Mon, 24 Jan 2022 14:18:19 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:38694 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345263AbiAXTJA (ORCPT ); Mon, 24 Jan 2022 14:09:00 -0500 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 77B5D60909; Mon, 24 Jan 2022 19:08:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3BAE2C340E5; Mon, 24 Jan 2022 19:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643051337; bh=zgJycrBY7VvfgIA9nrpGkp89cc0lhlwKiFUFwBPoQBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o5ykQ+TZBjh924/I9WSqs4AZUMsN7dHkvDUQLw+6/G8HhkopvX74I0SIXCmUkfBZZ geTdnbG7OYEnNJuNlhNJc/GFe0B2tOsS4z/Yy8g5fOAPVGEPniO2CjJwqQF7BFxH/C nUgYszdcfdE4tjjfxw7joSadRdNyv+FqScvA0VvU= 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 4.14 129/186] serial: pl010: Drop CR register reset on set_termios Date: Mon, 24 Jan 2022 19:43:24 +0100 Message-Id: <20220124183941.259925606@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 9ec4b8d2879f7..0698fbf3b6d61 100644 --- a/drivers/tty/serial/amba-pl010.c +++ b/drivers/tty/serial/amba-pl010.c @@ -465,14 +465,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