Re: [PATCH] serial: Fix incorrect rs485 polarity on uart open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2022-08-04 at 17:52 +0200, Lukas Wunner wrote:
> On Thu, Aug 04, 2022 at 02:38:23PM +0000, Roosen Henri wrote:
> > unfortunately this commit, which has been backported to v5.4.x,
> > seems
> > to break RS485 functionality on our iMX boards.
> 
> What exactly broke?  Are you seeing incorrect polarity after opening
> the tty but correct polarity after the first send?  Or is polarity
> always incorrect?

I'm not sure about the state before opening, I have to measure that
when I'm back at the office.

After opening, the polarity is always incorrect (inverted) when this
patch is applied. We open the tty and try to receive, which now fails
because the rs485 transmitter is on.

Before the patch, the transmitter was only on during sending (before
and after opening). This is the way it should be, because a system
should only 'be on the bus' during transmit. In all other cases, like
for instance at startup (closed tty), the transmitter should be off, so
other devices can take the bus to send.

> 
> There have been reports about incorrect polarity after open and
> before the first send as a result of that committ, but they only
> concern a subset of drivers using the "em485" software emulation
> in 8250_port.c:
> 
>  
> https://lore.kernel.org/linux-serial/20220329085050.311408-1-matthias.schiffer@xxxxxxxxxxxxxxx/
> 
> imx.c does not use the em485 software emulation but rather a
> dedicated GPIO, and the way you've set it up looks correct to me.
> 
> Some transceivers have both a DE and a !DE pin.  Is the GPIO
> connected to the former?

The board design uses the GPIO directly to the DE and also directly to
the !RE (see SN65HVD82 datasheet).

> 
> Thanks,
> 
> Lukas

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux