[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e426ae4c-4e49-5773-e8da-919fa2e3dc33@suse.com>
Date: Mon, 13 Mar 2023 10:54:01 +0100
From: Oliver Neukum <oneukum@...e.com>
To: Jarkko Sonninen <kasper@....fi>
Cc: Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] USB: serial: xr: Add TIOCGRS485 and TIOCSRS485 ioctls
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@....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
Powered by blists - more mailing lists