linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
To: Giulio Benetti <giulio.benetti@micronovasrl.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Matthias Brugger <mbrugger@suse.com>,
	Kees Cook <keescook@chromium.org>,
	Allen Pais <allen.lkml@gmail.com>, Sean Young <sean@mess.org>,
	"open list:SERIAL DRIVERS" <linux-serial@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/4] serial: 8250: Copy em485 from port to real port.
Date: Thu, 7 Jun 2018 10:03:45 +0300	[thread overview]
Message-ID: <CAJs94EbY1apGLUK+6ZXy=j5Uitox+WbG903_5SX2kW_tCLQzPw@mail.gmail.com> (raw)
In-Reply-To: <d3c4e356-2c04-731f-a665-a445a6bf68af@micronovasrl.com>

2018-06-06 22:15 GMT+03:00 Giulio Benetti <giulio.benetti@micronovasrl.com>:
> Il 06/06/2018 20:55, Matwey V. Kornilov ha scritto:
>>
>> 2018-06-06 16:11 GMT+03:00 Andy Shevchenko
>> <andriy.shevchenko@linux.intel.com>:
>>>
>>> On Wed, 2018-06-06 at 14:15 +0200, Giulio Benetti wrote:
>>>>
>>>> Il 06/06/2018 13:56, Andy Shevchenko ha scritto:
>>>>>
>>>>> On Wed, 2018-06-06 at 11:49 +0200, Giulio Benetti wrote:
>>>>>>
>>>>>> em485 gets lost during
>>>>>>
>>>>>> Copy em485 to final uart port.
>>>>>>
>>>>>
>>>>> Is it needed at all?
>>>>>
>>>>> The individual driver decides either to use software emulation (and
>>>>> calls explicitly serial8250_em485_init() for that) or do HW assisted
>>>>> stuff.
>>>>
>>>>
>>>> In 8250_dw.c, during probe(), I need to call dw8250_rs485_config()
>>>> against local struct uart_8250_port uart = {};
>>>> Inside serial8250_register_8250_port() not all uart fields are
>>>> copied(em485 too).
>>>> So after probe, em485 is NULL.
>>>>
>>>> Another way could be to call dw8250_rs485_config() against real uart
>>>> port, after calling serial8250_register_8250_port(),
>>>> would it make sense?
>>>
>>>
>>> Look at OMAP case closely. They have a callback to configure RS485 which
>>> is called in uart_set_rs485_config()  which is called whenever user
>>> space does TIOCGRS485 IOCTL.
>>>
>>> So, it's completely driven by user space which makes sense by my
>>> opinion.
>>
>>
>> AFAIU, Giulio wants to add support for rs485-enabled-at-boot-time
>> device tree option (see bindings/serial/rs485.txt for reference).
>
>
> Yes, I want to add support for "rs485-enabled-at-boot-time" property,
> maybe I had to write better commit log and a cover letter. Sorry.
>
>> I suppose it is only important for use-case when rs485 used as slave
>> (peripheral role).
>
>
> It's important also for master, because RTS, if RTS_AFTER_SEND is set,
> remains not asserted(trasnmission) until userspace opens that serial port.
>

And it makes no sense, because how are you going to transmit and
receive not opening the port and not running an application?
It is master who transmits the data first. So, before all systems
going to work you have to open the port from userspace.

In case of slave this of course makes sense.

> Sorry again for not explaining myself well.
>
>
> --
> Giulio Benetti
> CTO
>
> MICRONOVA SRL
> Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
> Tel. 049/8931563 - Fax 049/8931346
> Cod.Fiscale - P.IVA 02663420285
> Capitale Sociale € 26.000 i.v.
> Iscritta al Reg. Imprese di Padova N. 02663420285
> Numero R.E.A. 258642



-- 
With best regards,
Matwey V. Kornilov

  reply	other threads:[~2018-06-07  7:04 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 12:40 [PATCH 0/8] serial: 8250: Add 485 emulation to 8250_dw Giulio Benetti
2018-06-01 12:40 ` [PATCH 1/8] serial: 8250_dw: add em485 support Giulio Benetti
2018-06-01 12:40 ` [PATCH 2/8] serial: 8250_dw: allow enable rs485 at boot time Giulio Benetti
2018-06-01 12:40 ` [PATCH 3/8] serial: 8250: Copy em485 from port to real port Giulio Benetti
2018-06-04 10:13   ` Andy Shevchenko
2018-06-04 10:52     ` Giulio Benetti
2018-06-01 12:40 ` [PATCH 4/8] serial: 8250: Handle case port doesn't have TEMT interrupt using em485 Giulio Benetti
2018-06-04 10:17   ` Andy Shevchenko
2018-06-04 10:50     ` Giulio Benetti
2018-06-04 11:38       ` Andy Shevchenko
2018-06-04 11:50         ` Giulio Benetti
2018-06-04 12:26           ` Andy Shevchenko
2018-06-04 17:40   ` Matwey V. Kornilov
2018-06-04 18:50     ` Giulio Benetti
2018-06-05 10:51       ` Matwey V. Kornilov
2018-06-06  9:36         ` Giulio Benetti
2018-06-06  9:49         ` [PATCH 2/4] serial: 8250: Copy mctrl when register port Giulio Benetti
2018-06-06  9:49           ` [PATCH 3/4] serial: 8250: Make em485_rts_after_send() set mctrl according to rts state Giulio Benetti
2018-06-06 12:02             ` Andy Shevchenko
2018-06-06  9:49           ` [PATCH 4/4] serial: core: Mask mctrl with TIOCM_RTS too if rs485 on and RTS_AFTER_SEND set Giulio Benetti
2018-06-06 12:03             ` Andy Shevchenko
2018-06-06 12:07               ` Giulio Benetti
2018-06-06  9:49           ` [PATCH 1/4] serial: 8250: Copy em485 from port to real port Giulio Benetti
2018-06-06 11:56             ` Andy Shevchenko
2018-06-06 12:15               ` Giulio Benetti
2018-06-06 13:11                 ` Andy Shevchenko
2018-06-06 14:32                   ` Giulio Benetti
2018-06-06 18:55                   ` Matwey V. Kornilov
2018-06-06 19:15                     ` Giulio Benetti
2018-06-07  7:03                       ` Matwey V. Kornilov [this message]
2018-06-07 12:43                         ` Giulio Benetti
2018-06-06 12:01           ` [PATCH 2/4] serial: 8250: Copy mctrl when register port Andy Shevchenko
2018-06-06  9:51         ` [PATCH 2/4] serial: 8250_dw: allow enable rs485 at boot time Giulio Benetti
2018-06-06  9:51           ` [PATCH 3/4] serial: 8250: Handle case port doesn't have TEMT interrupt using em485 Giulio Benetti
2018-06-13 16:59             ` Alan Cox
2018-06-06  9:51           ` [PATCH 4/4] serial: 8250_dw: treat rpm suspend with -EBUSY if RS485 ON and RTS_AFTER_SEND Giulio Benetti
2018-06-06  9:51           ` [PATCH 1/4] serial: 8250_dw: add em485 support Giulio Benetti
2018-06-06 16:51             ` Andy Shevchenko
2018-06-06 19:16               ` Giulio Benetti
2018-06-01 12:40 ` [PATCH 5/8] serial: 8250_dw: treat rpm suspend with -EBUSY if RS485 ON and RTS_AFTER_SEND Giulio Benetti
2018-06-01 12:40 ` [PATCH 6/8] serial: 8250: Copy mctrl when register port Giulio Benetti
2018-06-06 14:31   ` Aaron Sierra
2018-06-06 14:44     ` Giulio Benetti
2018-06-01 12:40 ` [PATCH 7/8] serial: 8250: Make em485_rts_after_send() set mctrl according to rts state Giulio Benetti
2018-06-01 12:40 ` [PATCH 8/8] serial: core: Mask mctrl with TIOCM_RTS too if rs485 on and RTS_AFTER_SEND set Giulio Benetti
2018-06-04 10:12 ` [PATCH 0/8] serial: 8250: Add 485 emulation to 8250_dw Andy Shevchenko
2018-06-04 10:34   ` Matwey V. Kornilov
2018-06-04 10:42     ` Giulio Benetti
2018-06-04 11:44       ` Andy Shevchenko
2018-06-04 14:58         ` Giulio Benetti

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='CAJs94EbY1apGLUK+6ZXy=j5Uitox+WbG903_5SX2kW_tCLQzPw@mail.gmail.com' \
    --to=matwey.kornilov@gmail.com \
    --cc=allen.lkml@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=giulio.benetti@micronovasrl.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mbrugger@suse.com \
    --cc=sean@mess.org \
    /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;
as well as URLs for NNTP newsgroup(s).