[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140813070918.GA12747@kroah.com>
Date: Wed, 13 Aug 2014 15:09:18 +0800
From: Greg KH <gregkh@...uxfoundation.org>
To: Johan Hovold <johan@...nel.org>
Cc: Hannes Petermaier <Hannes.Petermaier@...automation.com>,
andi@...as.de, dforsi@...il.com, gnomes@...rguk.ukuu.org.uk,
jhovold@...il.com, Linus Walleij <linus.walleij@...aro.org>,
linux-kernel@...r.kernel.org, linux-kernel-owner@...r.kernel.org,
linux-usb@...r.kernel.org, Wang YanQing <udknight@...il.com>
Subject: Re: [PATCH v7] usb:serial:pl2303: add GPIOs interface on PL2303
On Wed, Aug 13, 2014 at 09:05:09AM +0200, Johan Hovold wrote:
> On Wed, Aug 13, 2014 at 08:17:50AM +0200, Hannes Petermaier wrote:
> > > >
> > > > Known issue:
> > > > If gpios are in use(export to userspace through sysfs interface, etc),
> > > > then call pl2303_release(unplug usb-serial convertor, modprobe -r,
> > etc),
> > > > will cause trouble, so we need to make sure there is no gpio user
> > before
> > > > call pl2303_release.
> > >
> > > This is a real problem that we need to address. gpiolib isn't really
> > > able to handle devices that just disappear. In fact, it's API claims
> > that
> > > we must not call gpiochip_remove with requested gpios and this is
> > > exactly what you might do in pl2303hx_gpio_release below.
> > >
> > > As I mentioned earlier, this crashes the kernel when a new gpiochip is
> > > later added (the gpiochip data structures are likely corrupted and we
> > > get a NULL pointer deref in gpiochip_find_base).
> > >
> > > Linus, any thoughts on this?
> >
> > Hi,
> > there are several USB to I2C bus adapters and I2C IO-Expanders,
> > how is this handled there ?
>
> The short answer is: it isn't.
>
> A few i2c-gpio-expander drivers have teardown callbacks that can be used
> from board files to release any gpios requested there, but this neither
> translates to device tree or is of any help when gpios have been
> exported to user space.
For some reason I thought I saw some patches recently that was trying to
resolve this problem. So it might get fixed for 3.18...
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists