Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5253347imm; Tue, 12 Jun 2018 05:12:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ+mNKPt1DHYqVrLjJpwcpHKH9bmpJFzrpJHXLXCnK3gUf3EdZM8uNa2mSKqm8Mj96A9hkc X-Received: by 2002:a62:494f:: with SMTP id w76-v6mr137135pfa.152.1528805549243; Tue, 12 Jun 2018 05:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528805549; cv=none; d=google.com; s=arc-20160816; b=AzKXiNK8yLj9FWO+kAl6LvWIQftnx8lWSxy7oYQhQONJWDLxv/puZG2Kshd3n1eZUo 95h0oFG20X/DQVIt8R3mEj8S12v4O9WaVvF1JEyYlZBk+FSyXJwt9l3HYWWYZEKyA3Kd lwR7a1mAsZdmV4OQmwy7V1AHe7GFfUyFPP0KRXFsIeDZt7sovlR79dEgxq3rg+yMSroN vwRD+waIpRtZS4pCyPxvyZJtZw56jJxRSC8F3o6LP5US/GY6Fb7nPk0jd7EOLcLO1gj/ RUwasiPDqN55aa7cbcJW9Ckn8/zk94vgbcFU8fdIjNztRi53XAqIA6Jj6UxUGw2kYx+j hSIA== 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=E8AukCerDvBdieQFF4Aby5TkP1atSf5ItPL/oIkkS3Q=; b=CLIulsOSb8cVy2qeaPd6ktLwvB4+6k0QhBFRoVgWJkoqSaZtmgDKDcLd0EQPkNghCA wy7QNSVOb8cv535aMNYyUzjF+zK9VitiJkU00BanWk2ALtuvVrYMsv4nBSUZltlADaDG 41imDNYjrv7MTRsCcp7Tm7J4u+DtPcTbvf0ySPbRil2ryTPjEZBl7YPRAhniiIZcZH2F ggDE/jZJPJ6uBBNH4I7IpyCgO0snwVqPp3Q920rKng7ROezKkjzsVsyMxWO3ZIhADhH+ nHbC40NjbrHYzIERutjfj7VFIyV9n9gRAXAZRLEgAHpz3++RT5vE5lwP2yCSa9CWxNH9 V/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=bpIUL1Wh; 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 m3-v6si13981plb.27.2018.06.12.05.12.14; Tue, 12 Jun 2018 05:12:29 -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=bpIUL1Wh; 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 S933510AbeFLMLt (ORCPT + 99 others); Tue, 12 Jun 2018 08:11:49 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:48186 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932543AbeFLMLp (ORCPT ); Tue, 12 Jun 2018 08:11:45 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 74A565C11DF; Tue, 12 Jun 2018 14:11:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1528805504; 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=E8AukCerDvBdieQFF4Aby5TkP1atSf5ItPL/oIkkS3Q=; b=bpIUL1WhaIUbPjsRgciN0b0vxBHvPgXsSNUSOvacrGghQn0hKzn1cfIqRbPJrqVRXLXTsd Xw57XJxn+McJ55xkABPPLgEQHNJDM9MGmvc/R/iukNRjs9kY3Wogggp965sBK2FtVGflm8 Okwvi8oHpb1vAL5kvPH9BF//ob9CPfk= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: Tue, 12 Jun 2018 14:11:44 +0200 From: Stefan Agner To: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= Cc: gregkh@linuxfoundation.org, festevam@gmail.com, jslaby@suse.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] serial: imx: fix cached UCR2 read on software reset In-Reply-To: <20180607075633.y3tm245jv7nkdrqx@pengutronix.de> References: <20180420124407.12892-1-stefan@agner.ch> <20180607075633.y3tm245jv7nkdrqx@pengutronix.de> Message-ID: X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 X-Spamd-Result: default: False [-3.06 / 15.00]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; ASN(0.00)[asn:29691, ipnet:2a02:418::/29, country:CH]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-2.96)[99.84%]; ARC_NA(0.00)[] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07.06.2018 09:56, Uwe Kleine-König wrote: > On Fri, Apr 20, 2018 at 02:44:07PM +0200, 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 >> indicates 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. >> >> Fixes: 3a0ab62f43de ("serial: imx: implement shadow registers for UCRx and UFCR") >> Signed-off-by: Stefan Agner >> Reviewed-by: Fabio Estevam >> Reviewed-by: Uwe Kleine-König > > For the record, there is a customer of mine who reports that this commit > breaks rs485 communication on i.MX25 because RTS stops to toggle as > intended. > > (Some details: uart3, fsl,uart-has-rtscts, fsl,dte-mode, > linux,rs485-enabled-at-boot-time, native RTS.) > > I didn't debug this yet. I have seen your patch today "serial: imx: fix comment about UCR2_SRST and its handling for shadowing" so I assume you looked into this issue? Was it related to that change? -- Stefan