lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 8 Jan 2017 00:30:24 -0200
From:   Fabio Estevam <festevam@...il.com>
To:     Clemens Gruber <clemens.gruber@...ruber.com>
Cc:     "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Uwe Kleine-K├Ânig 
        <u.kleine-koenig@...gutronix.de>, Nandor Han <nandor.han@...com>,
        Lucas Stach <l.stach@...gutronix.de>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: imx: RS-485 problems during TX, maybe DMA related

Hi Clemens,

On Sat, Jan 7, 2017 at 9:06 PM, Clemens Gruber
<clemens.gruber@...ruber.com> wrote:

> 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?

No, I use the original 4.9 + the two patches I sent. Yes, I do use the
SDMA scripts from ROM.

Here is the procedure I did to try to reproduce the issue you reported:

(The rs485conf is available at:
https://github.com/mniestroj/rs485conf/blob/master/main.c )

First of all I enable rs485 for ttymxc3 using the rs485conf application:

root@...6qsabresd:/home# ./rs485conf  /dev/ttymxc3 -e 1
[   27.106517] random: crng init done
= Current configuration:
RS485 enabled:                false
RTS on send:                  high
RTS after send:               low
RTS delay before send:        0
RTS delay after send:         0
Receive during sending data:  true

= New configuration:
RS485 enabled:                true
RTS on send:                  high
RTS after send:               low
RTS delay before send:        0
RTS delay after send:         0
Receive during sending data:  true

= Saved configuration:
RS485 enabled:                true
RTS on send:                  high
RTS after send:               low
RTS delay before send:        0
RTS delay after send:         0
Receive during sending data:  true
root@...6qsabresd:/ho

Then

root@...6qsabresd:/home# echo A > /dev/ttymxc3

(wait 10 seconds)

root@...6qsabresd:/home# echo B > /dev/ttymxc3

(wait 10 seconds)

root@...6qsabresd:/home# echo C > /dev/ttymxc3

On the serial console at 9600bps only the:
A
B
C

are seen, so not duplicated characters, nor noise is seen on the console.

Regards,

Fabio Estevam

Powered by blists - more mailing lists