From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933059AbdAGXGj (ORCPT ); Sat, 7 Jan 2017 18:06:39 -0500 Received: from mail.pqgruber.com ([178.189.19.235]:48271 "EHLO mail.pqgruber.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752519AbdAGXG2 (ORCPT ); Sat, 7 Jan 2017 18:06:28 -0500 Date: Sun, 8 Jan 2017 00:06:24 +0100 From: Clemens Gruber To: Fabio Estevam Cc: linux-serial@vger.kernel.org, Greg Kroah-Hartman , Sascha Hauer , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Nandor Han , Lucas Stach , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: imx: RS-485 problems during TX, maybe DMA related Message-ID: <20170107230624.GA21729@archie.localdomain> References: <20170104160024.GA13442@archie.localdomain> <20170106225026.GA3804@archie.localdomain> <20170107134557.GA12299@archie.localdomain> <20170107153434.GA13307@archie.localdomain> <20170107205930.GA12367@archie.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fabio, On Sat, Jan 07, 2017 at 07:43:48PM -0200, Fabio Estevam wrote: > Hi Clemens, > > On Sat, Jan 7, 2017 at 6:59 PM, Clemens Gruber > wrote: > > > Great! > > > > Did you observe the same effect I described, with the doubling of > > characters in the front and the leftovers from previous transmissions at > > the end? > > No, I don't observe these errors when I use 'rts-gpios' in the device tree. > > Maybe you could try to use 'rts-gpios' for a quick test by applying > the patches I have just sent. > > If you run this test, please remove 'uart-has-rtscts' from your dts. > According to Documentation/devicetree/bindings/serial/serial.txt they > are mutually-exclusive. Just remuxed GPIO signals to these pads, applied your two patches and used rts-gpios in the DT but I still see the same problem :/ When transmit something, I get doubled characters, then zeros and at the end garbled data of previous transmissions, same as described in my first post (Logic analyzer: https://pqgruber.com/rs485_results.png) The data is always 4096 bytes long, this explains why the echo command is blocking for about 4 seconds (<- 4096 bytes at a baudrate of 9600). The TE line is also high until all 4096 bytes are sent. I think this comes from the UART_XMIT_SIZE which is defined to the page size. Maybe there is something wrong in imx_transmit_buffer and leads to the whole circular buffer being sent out all the time, not stopping.. Do these debug logs tell you anything? https://gist.github.com/clemensg/1ac5ee8a8ea32acc9145c5aa8407aea5 I am analyzing the signals coming directly from the i.MX6Q, so this must be a software problem, but I don't understand why it works for you, if we use the same software. Do you use any other patches on top of mainline and do you use the SDMA scripts from the ROM? Thanks, Clemens