From: Adam Baker <linux@baker-net.org.uk>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Theodore Kilgore <kilgota@banach.math.auburn.edu>,
"Jean-Francois Moine" <moinejf@free.fr>,
Linux Media Mailing List <linux-media@vger.kernel.org>,
linux-usb@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>
Subject: Re: [Workshop-2011] Media Subsystem Workshop 2011
Date: Mon, 8 Aug 2011 01:30:57 +0100 [thread overview]
Message-ID: <201108080130.57394.linux@baker-net.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1108071914440.17195-100000@netrider.rowland.org>
On Monday 08 August 2011, Alan Stern wrote:
> On Sun, 7 Aug 2011, Adam Baker wrote:
> > I've addec Hans de Geode and linux-usb to the CC as this response picks
> > up on a related discussion about the usb mini summit.
> >
> > On Friday 05 August 2011, Theodore Kilgore wrote:
> > > > If you can solve the locking problem between devices in the kernel
> > > > then it shouldn't matter if one of the kernel devices is the
> > > > generic device that is used to support libusb.
> > >
> > > Hmmm. Perhaps not. While we are on the topic, what exactly do you mean
> > > by "the generic device that is used to support libusb." Which device
> > > is that, exactly?
> >
> > The file drivers/usb/core/devio.c registers itself as a driver called
> > usb_device which is used to provide all of the device drivers that live
> > under /proc/bus/usb
>
> Let's get things correct. The driver is called usbfs, not usb_device.
> The things that live under /proc/bus/usb are files representing USB
> devices, not device drivers.
OK, I was taking the name from the register_chrdev_region call which is
ambiguous as to whether that is a driver name or just a name to associate with
the devices the driver creates. Hopefully I at least gave enough info to make
my meaning clear.
>
> > If you look in there for the code to handle the ioctl()
> > USBDEVFS_DISCONNECT then you will find the code that is called when you
> > make a
> > usb_detach_kernel_driver_np() call through libusb. That code, according
> > to the documentation and my testing needs to acquire a lock before it
> > calls usb_driver_release_interface(). Based on my testing to date (using
> > cheese to start a camera streaming and then gphoto2 -L to trigger the
> > disconnect ioctl) I would suggest that the fact it doesn't is a kernel
> > bug that needs fixing
>
> What makes you think the code doesn't acquire the lock? (Hint: Look at
> usbdev_do_ioctl() instead of proc_ioctl().)
My assumption is based on observed behaviour rather than looking at the code.
>
> > regardless of whether there is any user space solution to camera mode
> > switching because that code could potentially get called on any in use
> > USB device and if it does even thing like lsusb don't work correctly
> > afterwards and completely unrelated devices don't work if they are later
> > plugged into the same USB port.
>
> That's a rather incomprehensible run-on sentence, but as near as I can
> tell, it is wrong.
Further testing reveals the situation is more complex than I first thought -
the behaviour I get depends upon whether what gets plugged in is a full speed
or a high speed device. After I've run the test of running gphoto whilst
streaming from a supported dual mode camera, lsusb fails to recognise a high
speed device plugged into the port the camera was plugged into (it works fine
if plugged in elsewhere) and lsusb hangs if I plug in a new low speed or full
speed device. When I get some time I'll see if I can recreate the problem
using libusb with a totally different device. Looking around my pile of USB
bits for something full speed with a kernel driver I've got a PL2303 serial
port. Would that be a good choice to test with?
Just for reference with a full speed device I see the messages below in dmesg
with the second one only appearing when I do lsusb
[10832.128039] usb 3-2: new full speed USB device using uhci_hcd and address
34
[10847.240031] usb 3-2: device descriptor read/64, error -110
and with a high speed device I see a continuous stream of
[11079.820097] usb 1-4: new high speed USB device using ehci_hcd and address
103
[11079.888355] hub 1-0:1.0: unable to enumerate USB device on port 4
[11080.072377] hub 1-0:1.0: unable to enumerate USB device on port 4
[11080.312053] usb 1-4: new high speed USB device using ehci_hcd and address
105
[11080.380418] hub 1-0:1.0: unable to enumerate USB device on port 4
[11080.620030] usb 1-4: new high speed USB device using ehci_hcd and address
106
[11080.688322] hub 1-0:1.0: unable to enumerate USB device on port 4
Adam Baker
next prev parent reply other threads:[~2011-08-08 0:31 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-03 17:21 Media Subsystem Workshop 2011 Mauro Carvalho Chehab
2011-08-03 17:45 ` Mauro Carvalho Chehab
2011-08-08 6:22 ` Hans Verkuil
2011-08-08 13:25 ` Mauro Carvalho Chehab
2011-08-08 15:25 ` Hans Verkuil
2011-08-11 17:49 ` Rémi Denis-Courmont
2011-08-11 19:00 ` Mauro Carvalho Chehab
2011-08-03 19:53 ` Theodore Kilgore
2011-08-03 20:36 ` Mauro Carvalho Chehab
2011-08-03 23:20 ` Theodore Kilgore
2011-08-04 12:34 ` Mauro Carvalho Chehab
2011-08-04 18:37 ` Theodore Kilgore
2011-08-04 19:11 ` Mauro Carvalho Chehab
2011-08-04 21:16 ` Theodore Kilgore
2011-08-04 21:58 ` Mauro Carvalho Chehab
2011-08-04 22:57 ` Theodore Kilgore
2011-08-05 7:02 ` [Workshop-2011] " Hans de Goede
2011-08-05 17:13 ` Theodore Kilgore
2011-08-07 22:53 ` Adam Baker
2011-08-08 2:26 ` Theodore Kilgore
2011-08-08 13:45 ` Mauro Carvalho Chehab
2011-08-08 17:39 ` Theodore Kilgore
2011-08-08 18:39 ` Mauro Carvalho Chehab
2011-08-08 19:32 ` Theodore Kilgore
2011-08-08 20:07 ` Mauro Carvalho Chehab
2011-08-08 20:24 ` Adam Baker
2011-08-08 20:43 ` Theodore Kilgore
2011-08-09 7:30 ` Hans de Goede
2011-08-09 17:10 ` Theodore Kilgore
2011-08-09 20:30 ` Hans de Goede
2011-08-10 0:34 ` Theodore Kilgore
2011-08-10 7:02 ` Hans de Goede
2011-08-08 20:33 ` Adam Baker
2011-08-08 21:06 ` Theodore Kilgore
2011-08-09 7:37 ` Hans de Goede
2011-08-09 19:06 ` Theodore Kilgore
2011-08-08 2:56 ` Theodore Kilgore
2011-08-08 7:53 ` Hans de Goede
2011-08-04 11:39 ` Hans de Goede
2011-08-04 12:40 ` Mauro Carvalho Chehab
2011-08-04 16:40 ` Jean-Francois Moine
2011-08-04 19:02 ` Guennadi Liakhovetski
2011-08-04 20:33 ` Mauro Carvalho Chehab
2011-08-04 21:38 ` Adam Baker
2011-08-04 21:49 ` Mauro Carvalho Chehab
2011-08-04 22:30 ` Theodore Kilgore
2011-08-04 19:05 ` Theodore Kilgore
2011-08-04 20:35 ` Adam Baker
2011-08-04 21:55 ` Theodore Kilgore
2011-08-04 23:04 ` Adam Baker
2011-08-05 0:01 ` Theodore Kilgore
2011-08-07 22:30 ` Adam Baker
2011-08-07 23:19 ` Alan Stern
2011-08-08 0:30 ` Adam Baker [this message]
2011-08-08 14:38 ` Alan Stern
2011-08-08 3:33 ` Theodore Kilgore
2011-08-08 14:55 ` Alan Stern
2011-08-08 18:14 ` Theodore Kilgore
2011-08-08 19:22 ` Alan Stern
2011-08-08 19:58 ` Theodore Kilgore
2011-08-08 20:33 ` Alan Stern
2011-08-04 18:55 ` Theodore Kilgore
2011-08-11 10:16 ` Sakari Ailus
2011-08-11 11:03 ` Mauro Carvalho Chehab
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=201108080130.57394.linux@baker-net.org.uk \
--to=linux@baker-net.org.uk \
--cc=hdegoede@redhat.com \
--cc=kilgota@banach.math.auburn.edu \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=moinejf@free.fr \
--cc=stern@rowland.harvard.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.