Received: by 10.192.165.148 with SMTP id m20csp140038imm; Thu, 19 Apr 2018 14:40:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx48qUxBpw5MFTvW8zUoAzsIC7HlqJBPnAMnN/Tj723TOXTP1uNW8Ra5FeDgpoSzZVD93ke0V X-Received: by 10.99.104.71 with SMTP id d68mr6146770pgc.99.1524174046677; Thu, 19 Apr 2018 14:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524174046; cv=none; d=google.com; s=arc-20160816; b=xFUzNncxtZbOCT+I9CzPzI+zwA0Q458XqoOiUBO6vpXIWXGndJosxMkg9WSYMnwmwt GhavnuYDh9O9smx8xm60RSjkwRSjUMgZEoh4K8RGQpcrygqfpZWBraIU9r9iPu/eQ1T4 156OUrQlofpFgreLfp4ml9MX3AAYpt4/xnLOduDd6ybNKMAKOAlFMt2ugNuZ02EXpMAa aNB4SzScrEmEGQGpY/f8kE/iHdjapiwzysBPUgBJBat3Jn0tnPehG4rsWme8Lg7ab63Z huHzjU54qjkS9vTiAk+hx4X4gm44a14F+vjloqr3hMnX1XVPM811MhfQ+kSw8rGpRAy5 KZnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=trkMlrLOmFi2qspQvxAs3y4wuDUwQQTbMtsvqT5ya0M=; b=Uxmq1bghCUWcRvryv99+Lxw8iQBH3sMeBuEjEZVkarzrwAWQlT1p2vxy9buC3F17AT t3Am875lSlnu/HoLKU9AXi4imVrZ9RD+blLmQWj05RjzarmL4U4hJw7BOg3TaT2cNGpB 1OJvT+/6RnhQPGIifn6Tw/cnZve96PlOtezCni3LbTxVv6Js83irH44AS7qXG0jtU9Gu jmz9dWyl23K85fvqIHPWLVHDv+Y7k3tewOaAYK97rX2V2UJoMFSc9rMqqET9rRWk6mrq vY4aufxRs+7FD0IuNXNuCeFfYHT+JOPYjKq31wrh3up/0Mtzi+lWOp3REDnJN9l9AvAj rrBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=VMIyefpR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si4341892plb.272.2018.04.19.14.40.23; Thu, 19 Apr 2018 14:40:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=VMIyefpR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753529AbeDSVh3 (ORCPT + 99 others); Thu, 19 Apr 2018 17:37:29 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:54100 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752725AbeDSVh1 (ORCPT ); Thu, 19 Apr 2018 17:37:27 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 2F06B5C027B; Thu, 19 Apr 2018 23:37:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1524173846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=trkMlrLOmFi2qspQvxAs3y4wuDUwQQTbMtsvqT5ya0M=; b=VMIyefpRGf8RvmxSHirCaKOMBsCCkSjHQEmsJA7vBfbVIuhM6TaymW5z1lyEfMw5x5Ukzt cTvEfRcORgapXVX22CLH7YAl8s2nwqdsoqarZM9xt2Ksb+PhgUq1ORawsXdU4fbY9oFXkv vJjVlOF41UGjeUGa1tb0AYu0ghsbmxo= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Thu, 19 Apr 2018 23:37:23 +0200 From: Stefan Agner To: u.kleine-koenig@pengutronix.de Cc: gregkh@linuxfoundation.org, jslaby@suse.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: imx: fix cached UCR2 read on software reset In-Reply-To: <20180416153502.11814-1-stefan@agner.ch> References: <20180416153502.11814-1-stefan@agner.ch> Message-ID: <581f0f26d7191aa3355a6c63b531f876@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-2.88 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; RCPT_COUNT_FIVE(0.00)[5]; TO_DN_NONE(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-2.78)[99.05%]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Uwe, On 16.04.2018 17:35, Stefan Agner wrote: > To reset the UART the SRST needs be cleared (low active). According > to the documentation the bit will remain active for 4 module clocks > until it is cleared (set to 1). > > Hence the real register need to be read in case the cached register > indcates that the SRST bit is zero. > > This bug lead to wrong baudrate because the baud rate register got > restored before reset completed in imx_flush_buffer. Given that you reviewed my other patch rather quickly, you might have overlooked this one? Since it is a regression, this should go into v4.17 still... -- Stefan > > Fixes: 3a0ab62f43de ("serial: imx: implement shadow registers for UCRx > and UFCR") > Signed-off-by: Stefan Agner > --- > drivers/tty/serial/imx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c > index 91f3a1a5cb7f..4ff6bd6eb9ab 100644 > --- a/drivers/tty/serial/imx.c > +++ b/drivers/tty/serial/imx.c > @@ -316,7 +316,7 @@ static u32 imx_uart_readl(struct imx_port *sport, > u32 offset) > * differ from the value that was last written. As it only > * clears after being set, reread conditionally. > */ > - if (sport->ucr2 & UCR2_SRST) > + if (!(sport->ucr2 & UCR2_SRST)) > sport->ucr2 = readl(sport->port.membase + offset); > return sport->ucr2; > break;