Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4376918pxb; Tue, 18 Jan 2022 17:51:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV0vki3xJDRRdbTF6L56tyuMJxSPO1xIJH4nkWbpMGXN7RSMB4zNfGf2Yhb22VXDUNfBsD X-Received: by 2002:a17:902:bd4b:b0:149:4c30:6dd2 with SMTP id b11-20020a170902bd4b00b001494c306dd2mr29849722plx.93.1642557061433; Tue, 18 Jan 2022 17:51:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642557061; cv=none; d=google.com; s=arc-20160816; b=coQwvIH7pSyndVUsklqiOXgpqLR/tpRopIMdqycTTtR8PCKo71nuSjL6Ncs8lXq3ee MRYexYYjWAqUaBuIr1wCme8c6jJU3EvkI+cS0hVV5dinklT8s0RIWfzpbouS/uecGqed /IUM2F969xel8MON6UPiBFRpv3bIGv91e2VgUP2pg2hofBt59vsJDO7KI3WN2cbhG9AG q0+Dv9iPPGGpuhl9AvU18QDJRsyJivDC17OrHIWWGj4D87wf8Qc2lb0OhN2fEGd1tgNg KYUm0V1iCt219iygSqfwrZzmtYC3Esn+vMQ7tKr3+lJcW8zsymai3XMT9SHuKBrtcWa6 a2PA== 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=Vf8Pes8TADFTxKje7b/hyiG2uT3EY0gyx18iE+WxM0A=; b=JSPcWHbOtYdEsqL79EnRch9rxcKIdQHgQDEXhzm+J7GBw7h/RwH1NnLZe70hlf25xy YVBpfXu/VvEUStbfhIUmmcbXz3jmdcYBYuLJKoNpqCPRrQAfVl9iLi9tW08RbVrUfcWu IUYcR9PKtKSc0afsFGW+Wf3UCaI5xzDbTOwGGRNrBBPNA3s1f+2/dTDU3Q8TY/5ttq7W 3bpLduCNyIN7/VYOVWeh/lCeFMmjPTDVm36bAk5AjK9VBPZWH4L8SBEyvwNqsQ51qk+R c+AmhcnWvYB76d3+Kkml2JtiEdmEsNIfPdWHbKl0Kl9gcIG/TSKrt6mGmjJkCwmmyLjj tByA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="sKeIK/OL"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ip13si4971514pjb.132.2022.01.18.17.50.49; Tue, 18 Jan 2022 17:51:01 -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=@kernel.org header.s=k20201202 header.b="sKeIK/OL"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348047AbiARCon (ORCPT + 99 others); Mon, 17 Jan 2022 21:44:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345790AbiARCcD (ORCPT ); Mon, 17 Jan 2022 21:32:03 -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 512EAC06173E; Mon, 17 Jan 2022 18:31:19 -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 A0AFB61135; Tue, 18 Jan 2022 02:31:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 162CAC36AF4; Tue, 18 Jan 2022 02:31:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1642473078; bh=AouQkowWMbLpCiSc9HCHcAG0xZ3v+aO3HmXSlgFIZUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sKeIK/OLNYsXcJ4AMGebFHFTiGAfCCHfy1aA6g9m/ETfa7u8Rih/KqhzGIX/1a0jd BPdPqUeLnjcn25Ke8F9fWlV5yj9vzA+gmiW1XUwKLwHLZK8OEi6SBnL/JkA62aJf7Q Bxis0mspmNxw2JQCxna3pz2POGIyw5sSJySXiYEhwv1o1CUTdsVz6F6GdK18MzbFwZ rDk/HVQyXsjBvmnt58xkPWFUoIMhGnqUF3kgY78aNY47qy/yeV4LttN2e2XLZHeuMP 3qy1WRYQW/cxWhYTxFnb4TX/fiQycko/XfdlxETuizgDxHyMIFZd/ZvCM+4mah0RBf rzyNNl+QJVw9g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Lukas Wunner , Russell King , Greg Kroah-Hartman , Sasha Levin , linux@armlinux.org.uk, jirislaby@kernel.org, linux-serial@vger.kernel.org Subject: [PATCH AUTOSEL 5.16 205/217] serial: pl010: Drop CR register reset on set_termios Date: Mon, 17 Jan 2022 21:19:28 -0500 Message-Id: <20220118021940.1942199-205-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220118021940.1942199-1-sashal@kernel.org> References: <20220118021940.1942199-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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