Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1269189

Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag for struct serial_rs485

From "Matwey V. Kornilov" <matwey@sai.msu.ru>
Newsgroups linux.kernel
Subject Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag for struct serial_rs485
Date 2015-11-13 21:10 +0100
Message-ID <qusPv-2xY-5@gated-at.bofh.it> (permalink)
References <qu1cC-1EX-7@gated-at.bofh.it> <qu1cC-1EX-5@gated-at.bofh.it> <qu6Fk-5dX-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2015-11-12 22:57 GMT+03:00 One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>:
> On Thu, 12 Nov 2015 17:33:53 +0300
> "Matwey V. Kornilov" <matwey@sai.msu.ru> wrote:
>
>> This flag is supposed to be used by uart drivers using software rs485 direction control.
>>
>> Signed-off-by: Matwey V. Kornilov <matwey@sai.msu.ru>
>> ---
>>  include/uapi/linux/serial.h | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h
>> index 25331f9..95b15ca 100644
>> --- a/include/uapi/linux/serial.h
>> +++ b/include/uapi/linux/serial.h
>> @@ -121,6 +121,9 @@ struct serial_rs485 {
>>  #define SER_RS485_RTS_AFTER_SEND     (1 << 2)        /* Logical level for
>>                                                          RTS pin after sent*/
>>  #define SER_RS485_RX_DURING_TX               (1 << 4)
>> +#define SER_RS485_SOFTWARE           (1 << 5)        /* Software
>> +                                                        implementation is
>> +                                                        being used */
>
> I've only got one question here - why do we need this flag. Why does the
> application care whether the timer is in the kernel or in the chip. In
> particular think about cases where some combinations of features require
> software fallback and others don't. What would the flag indicate then.
>

Peter asked for it, I respect his experience.
Only two lines are required to implement this, so it is easy to add,
easy to drop.

> The patches look nice but I'd strongly favour not having a software flag.
> It should never matter as the kernel API is the same in all cases and we
> should therefore discourage application code from trying to know things
> it doesn't need to worry about.
>
> Alan
>



-- 
With best regards,
Matwey V. Kornilov.
Sternberg Astronomical Institute, Lomonosov Moscow State University, Russia
119991, Moscow, Universitetsky pr-k 13, +7 (495) 9392382
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag for struct serial_rs485 "Matwey V. Kornilov" <matwey@sai.msu.ru> - 2015-11-12 15:40 +0100
  Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 Peter Hurley <peter@hurleysoftware.com> - 2015-11-12 21:30 +0100
    Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-13 01:50 +0100
      Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 Peter Hurley <peter@hurleysoftware.com> - 2015-11-13 02:20 +0100
        Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-13 02:30 +0100
          Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 Peter Hurley <peter@hurleysoftware.com> - 2015-11-13 03:00 +0100
    Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2015-11-14 16:30 +0100
  Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2015-11-12 21:50 +0100
    Re: [PATCH v3 2/5] tty: Introduce SER_RS485_SOFTWARE read-only flag  for struct serial_rs485 "Matwey V. Kornilov" <matwey@sai.msu.ru> - 2015-11-13 21:10 +0100

csiph-web