mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Johan Hovold <johan@kernel.org>
Cc: Hannes Petermaier <Hannes.Petermaier@br-automation.com>,
	andi@lisas.de, dforsi@gmail.com, gnomes@lxorguk.ukuu.org.uk,
	jhovold@gmail.com, Linus Walleij <linus.walleij@linaro.org>,
	linux-kernel@vger.kernel.org, linux-kernel-owner@vger.kernel.org,
	linux-usb@vger.kernel.org, Wang YanQing <udknight@gmail.com>
Subject: Re: [PATCH v7] usb:serial:pl2303: add GPIOs interface on PL2303
Date: Wed, 13 Aug 2014 15:09:18 +0800	[thread overview]
Message-ID: <20140813070918.GA12747@kroah.com> (raw)
In-Reply-To: <20140813070509.GA26836@localhost>

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

  reply	other threads:[~2014-08-13  7:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-09  5:28 Wang YanQing
2014-08-12 14:46 ` Johan Hovold
2014-08-13  6:17   ` Hannes Petermaier
2014-08-13  7:05     ` Johan Hovold
2014-08-13  7:09       ` Greg KH [this message]
2014-08-17  1:04   ` Wang YanQing
2014-08-18 10:00     ` Johan Hovold
2014-08-17  2:05   ` Wang YanQing
2014-08-18 10:07     ` Johan Hovold
2014-08-27 23:43       ` Wang YanQing
2014-08-29 10:44         ` Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140813070918.GA12747@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Hannes.Petermaier@br-automation.com \
    --cc=andi@lisas.de \
    --cc=dforsi@gmail.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=jhovold@gmail.com \
    --cc=johan@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel-owner@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=udknight@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome