lkml.org 
[lkml]   [2023]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v2] USB: serial: xr: Add TIOCGRS485 and TIOCSRS485 ioctls
    From
         Hello,

    It uses only one flag from the struct from user. Would it be better to
    store only that to state ?

    Do I need locking at all in that case ?

    The whole struct is stored just in case, if someone would implement
    other functionality later.

        - Jarkko


    Oliver Neukum kirjoitti 13/03/2023 klo 11.54:
    >
    >
    > On 13.03.23 09:27, Jarkko Sonninen wrote:
    >> Add support for RS-485 in Exar USB adapters.
    >> RS-485 mode is controlled by TIOCGRS485 and TIOCSRS485 ioctls.
    >> Gpio mode register is set to enable RS-485.
    >>
    >> Signed-off-by: Jarkko Sonninen <kasper@iki.fi>
    >
    >
    > Hi,
    >
    > I am sorry, but locking is really broken here. All these contexts can
    > sleep.
    > There is no need for a spinlock. As far as you need locking, just use
    > a mutex.
    >
    > Secondly, if xr_set_rs485_config() needs locking, so will
    > xr_get_rs485_config()
    > or you can get the case that you return half a new and half an old
    > state to user
    > space.
    >
    >     Regards
    >         Oliver

    \
     
     \ /
      Last update: 2023-03-27 00:56    [W:5.176 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site