lkml.org 
[lkml]   [2018]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] USB: serial: ftdi_sio: implement GPIO support for FT-X devices
On Tue, Sep 18, 2018 at 10:27:58AM +0000, Karoly Pados wrote:

> >> Does that mean something can call into our module while this method is running?
> >> If not, I'm clueless about the possible race here.
> >
> > Correct, you can get gpio callbacks until the gpio chip has been
> > deregistered (anything coming in after that would be a gpiolib bug).
>
> I'm just puzzled by the fact that this can still happen even while the port
> removal code is running. It also makes me ask the question what else here can
> run in parallel. Don't we need mutexes here-and-there in the ftx gpio functions too
> in this case? Or does gpiolib make sure to serialize multiple pin and direction
> setting calls?

Good point. The old sysfs interface would keep things serialised, but
the new chardev-based one does not (nor does the in-kernel interface).

So yeah, we need to add a mutex protecting the gpio state (i.e.
direction and value).

Thanks,
Johan

\
 
 \ /
  Last update: 2018-09-18 13:20    [W:0.055 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site