All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Lukas Wunner <lukas@wunner.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-serial <linux-serial@vger.kernel.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Su Bao Cheng <baocheng.su@siemens.com>,
	Vignesh Raghavendra <vigneshr@ti.com>, Nishanth Menon <nm@ti.com>,
	Lino Sanfilippo <LinoSanfilippo@gmx.de>
Subject: Re: [PATCH] serial: 8250: 8250_omap: Support native RS485
Date: Thu, 6 Oct 2022 13:59:01 +0300 (EEST)	[thread overview]
Message-ID: <80d9c8f9-bb20-6792-7c7-544e6bf8a899@linux.intel.com> (raw)
In-Reply-To: <20221006062126.GA26272@wunner.de>

[-- Attachment #1: Type: text/plain, Size: 2023 bytes --]

On Thu, 6 Oct 2022, Lukas Wunner wrote:

> On Tue, Oct 04, 2022 at 12:06:21PM +0300, Ilpo Järvinen wrote:
> > On Mon, 3 Oct 2022, Lukas Wunner wrote:
> > > On Wed, Sep 28, 2022 at 02:38:40PM +0300, Ilpo Järvinen wrote:
> > > > 
> > > > I guess .rs485_supported shouldn't be equal in both cases?
> > > 
> > > I contemplated whether it should be different for hardware-assisted
> > > RS485 but came to the conclusion that it shouldn't:
> [...]
> > Core is not handling just flags but also delay_rts_before_send and 
> > delay_rts_after_send sanitization. See 
> > uart_sanitize_serial_rs485_delays().
> > 
> > Btw, you can also get rid of this line once you provide separate 
> > rs485_supported:
> > 	rs485->delay_rts_before_send = 0;
> > 
> > What to do with delay_rts_after_send seems bit trickier though. Looking 
> > the code, it cannot be configured to arbitrary values by the user but it 
> > might not be zero either after the driver touches it. Maybe it safer to 
> > have it supported (set to 1) to avoid spuriously triggering the warning in 
> > uart_sanitize_serial_rs485_delays() (e.g., during init if non-zero delay 
> > is provided).
> 
> If I understand Figure 12-276 on page 8783 of the AM65 TRM correctly,
> there appears to be a 1 bit clock delay between writing to the THR register
> and transmission of the start bit:
> 
>   https://www.ti.com/lit/ug/spruid7e/spruid7e.pdf
> 
> I intend to respin the patch with the following addition:
> 
>   fixed_delay_rts_before_send = 1 * MSEC_PER_SEC / baud;
> 
> As a result, both delay_rts_before_send and delay_rts_after_send should be
> set to 1 in the rs485_supported struct for hardware-controlled RTS.

Ok. I was just commenting what the code did but of course if you change 
it the situation is different then.

> The resulting struct is identical to serial8250_em485_supported.

Please note it down somewhere (either commit message or comment at the
rs485_supported assignment) so that somebody else after us doesn't need 
to dig up this thread.


-- 
 i.

  parent reply	other threads:[~2022-10-06 11:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 12:10 [PATCH] serial: 8250: 8250_omap: Support native RS485 Lukas Wunner
2022-09-28 11:38 ` Ilpo Järvinen
2022-10-03 19:54   ` Lukas Wunner
2022-10-04  9:06     ` Ilpo Järvinen
2022-10-06  6:21       ` Lukas Wunner
2022-10-06  7:16         ` Vignesh Raghavendra
2022-10-06  7:43           ` Vignesh Raghavendra
2022-10-06 10:59         ` Ilpo Järvinen [this message]
2022-10-03 15:10 ` Bin Liu
2022-10-03 19:42   ` Lukas Wunner
2022-10-04 13:45     ` Bin Liu
2022-10-06  7:07       ` Vignesh Raghavendra
2022-10-06  7:27         ` Lukas Wunner

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=80d9c8f9-bb20-6792-7c7-544e6bf8a899@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=LinoSanfilippo@gmx.de \
    --cc=baocheng.su@siemens.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jan.kiszka@siemens.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=nm@ti.com \
    --cc=vigneshr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.