From: Lukas Wunner <lukas@wunner.de>
To: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Cc: Roosen Henri <Henri.Roosen@ginzinger.com>,
linux-serial@vger.kernel.org,
Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>,
Jiri Slaby <jirislaby@kernel.org>,
Lino Sanfilippo <LinoSanfilippo@gmx.de>,
David Laight <David.Laight@aculab.com>,
Maarten Brock <m.brock@vanmierlo.com>,
Jan Kiszka <jan.kiszka@siemens.com>,
Su Bao Cheng <baocheng.su@siemens.com>,
Chao Zeng <chao.zeng@siemens.com>,
Peter Hung <hpeter+linux_kernel@gmail.com>,
Daniel Golle <daniel@makrotopia.org>,
"Codrin.Ciubotariu@microchip.com"
<Codrin.Ciubotariu@microchip.com>,
Sherry Sun <sherry.sun@nxp.com>,
Serge Semin <Sergey.Semin@baikalelectronics.ru>,
Ricardo Ribalda <ribalda@kernel.org>,
Dario Binacchi <dariobin@libero.it>,
Bich Hemon <bich.hemon@st.com>, Marek Vasut <marex@denx.de>,
Vicente Bergas <vicencb@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v2] serial: Deassert Transmit Enable on probe in driver-specific way
Date: Fri, 7 Oct 2022 14:02:14 +0200 [thread overview]
Message-ID: <20221007120214.GA11466@wunner.de> (raw)
In-Reply-To: <07a4612c38cc9ab1bcaf01e5daf0ec1c53db7755.camel@ew.tq-group.com>
On Fri, Oct 07, 2022 at 01:34:19PM +0200, Matthias Schiffer wrote:
> On Thu, 2022-09-22 at 18:30 +0200, Lukas Wunner wrote:
> > Here's a v4 with full changelog:
> >
> > https://lore.kernel.org/linux-serial/2de36eba3fbe11278d5002e4e501afe0ceaca039.1663863805.git.lukas@wunner.de/
>
> I've noticed that this patch (well, the version that was applied to
> tty.git) also changed the setting of the DTR flag in the MCR register.
> Without your patch, I can see that the values passed to
> serial8250_out_MCR() alternate between 0x03 and 0x01 when switching
> between tx and rx, but with your patch, the values become 0x02 and
> 0x00.
>
> I'm not sure if setups RS485 exist where the DTR flag is relevant, but
> as this was not mentioned in the commit message, I suspect that the
> change might have been unintended.
That's intentional and documented in the following paragraph of the
commit message:
Skip any invocation of ->set_mctrl() if RS485 is enabled. RS485 has no
hardware flow control, so the modem control lines are irrelevant and
need not be touched. When leaving RS485 mode, reset the modem control
lines to the state stored in port->mctrl. That way, UARTs which are
muxed between RS485 and RS232 transceivers drive the lines correctly
when switched to RS232. (serial8250_do_startup() historically raises
the OUT1 modem signal because otherwise interrupts are not signaled on
ancient PC UARTs, but I believe that no longer applies to modern,
RS485-capable UARTs and is thus safe to be skipped.)
I think that the Siemens IOT20x0 series muxes the UART between RS232
and RS485 transceivers, though I'm not sure if that applies both to
the contemporary AM6548-based IOT2050 and to the older Intel-based
machines.
In RS485 mode, the DTR signal should be completely irrelevant as
the transceiver is only attached to RX, TX and RTS pins.
When switching from RS485 to RS232 mode, the patch ensures that the
modem signals are reset to what's been saved in port->mctrl. So DTR
will be raised once the UART is switched to RS232.
Thanks,
Lukas
prev parent reply other threads:[~2022-10-07 12:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <e688f63bc28827b0e8c9d8e2319e688aee412d24.1663733425.git.lukas@wunner.de>
2022-09-22 14:43 ` [PATCH v2] serial: Deassert Transmit Enable on probe in driver-specific way Greg Kroah-Hartman
2022-09-22 15:43 ` Lukas Wunner
2022-09-22 16:06 ` Greg Kroah-Hartman
2022-09-22 16:30 ` Lukas Wunner
2022-10-07 11:34 ` Matthias Schiffer
2022-10-07 12:02 ` Lukas Wunner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221007120214.GA11466@wunner.de \
--to=lukas@wunner.de \
--cc=Codrin.Ciubotariu@microchip.com \
--cc=David.Laight@aculab.com \
--cc=Henri.Roosen@ginzinger.com \
--cc=LinoSanfilippo@gmx.de \
--cc=Sergey.Semin@baikalelectronics.ru \
--cc=baocheng.su@siemens.com \
--cc=bich.hemon@st.com \
--cc=chao.zeng@siemens.com \
--cc=daniel@makrotopia.org \
--cc=dariobin@libero.it \
--cc=gregkh@linuxfoundation.org \
--cc=hpeter+linux_kernel@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jan.kiszka@siemens.com \
--cc=jirislaby@kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=m.brock@vanmierlo.com \
--cc=marex@denx.de \
--cc=matthias.schiffer@ew.tq-group.com \
--cc=ribalda@kernel.org \
--cc=sherry.sun@nxp.com \
--cc=vicencb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox