mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Steve Calfee" <stevecalfee@gmail.com>
To: "Matthew Wilcox" <matthew@wil.cx>
Cc: "Alan Stern" <stern@rowland.harvard.edu>,
	"Greg KH" <greg@kroah.com>,
	"USB list" <linux-usb@vger.kernel.org>,
	bgmerrell@novell.com, hirofuchi@users.sourceforge.net,
	"Kernel development list" <linux-kernel@vger.kernel.org>,
	usbip-devel@lists.sourceforge.net
Subject: Re: USBIP protocol
Date: Tue, 9 Sep 2008 00:12:37 -0700	[thread overview]
Message-ID: <4a5ff6bc0809090012j7121108cpc4cf108a4c323c52@mail.gmail.com> (raw)
In-Reply-To: <20080909005353.GR2772@parisc-linux.org>

Hi all,

I have been looking at the USBIP stuff and don't understand the
generic probe issues.

In your second patch:
static struct usb_device_id stub_table[] = {
+#if 0
+	/* just an example */
+	{ USB_DEVICE(0x05ac, 0x0301) },   /* Mac 1 button mouse */
+	{ USB_DEVICE(0x0430, 0x0009) },   /* Plat Home Keyboard */
+	{ USB_DEVICE(0x059b, 0x0001) },   /* Iomega USB Zip 100 */
+	{ USB_DEVICE(0x04b3, 0x4427) },   /* IBM USB CD-ROM */
+	{ USB_DEVICE(0x05a9, 0xa511) },   /* LifeView USB cam */
+	{ USB_DEVICE(0x55aa, 0x0201) },   /* Imation card reader */
+	{ USB_DEVICE(0x046d, 0x0870) },   /* Qcam Express(QV-30) */
+	{ USB_DEVICE(0x04bb, 0x0101) },   /* IO-DATA HD 120GB */
+	{ USB_DEVICE(0x04bb, 0x0904) },   /* IO-DATA USB-ET/TX */
+	{ USB_DEVICE(0x04bb, 0x0201) },   /* IO-DATA USB-ET/TX */
+	{ USB_DEVICE(0x08bb, 0x2702) },   /* ONKYO USB Speaker */
+	{ USB_DEVICE(0x046d, 0x08b2) },   /* Logicool Qcam 4000 Pro */
+#endif
+	/* magic for wild card */
+	{ .driver_info = 1 },
+	{ 0, }                                     /* Terminating entry */
+};

You have changed your driver to a wild card for everything. Fine, it
makes sense, your probe routine should check if it wants a new device
and fail if it does not want it.

My problem is I am using the latest Suse enterprise linux which uses
kernel 2.6.18..... In that kernel the probes are done by the device
system and if a modprobe definition says the module is for this device
it gets loaded (by udev I think) and probed. fine. If the module is
already loaded the kernel probes the modules in the order they were
insmoded (if they say they want the particular VID/PID/CLASS/wildcard
etc.)

The problem is the probing is done by the kernel driver stuff and the
insmoding and user space intelligence is done by udev. Once a kernel
module is installed it must take all devices that match it's device ID
table.  Remember USBIP matches everything! That is because (at least
in the 2.6.18 kernel) the kernel driver stuff stops probing after a
probe fails. This is completely counter-intuitive to me, I would have
assumed that if a probe routine fails, the driver system would keep
going through the list looking for a driver that wants it.

Is this rule still true in the current kernels (I will care if and
when Novel/Suse updates its next enterprise addition).

So, at least in the latest Suse enterprise linux, these are the rules:
1) Any current driver will be probed in the order of insmod. If it
fails, the device will not have a driver
2) If there is no driver, udev will modprobe one and that process will
attach it to the device because all un-probed devices will be
reprobed.

I have not found a way to reprobe unclaimed drivers (and don't know
what order a reprobe would use - if USBIP rejects a device again
because it (USBIP_ is insmoded first it would still be unclaimed).

So to be more descriptive, say you want to do a remote USBIP flash
drive for drive "B", out of three drives, "A", "B","C". How can I
(from user space) enable this sequence? I can control the order of
module loading, (sort of).  I need usb_storage active twice and USBIP
active once for "B". This cannot not work with 2.6.18 - does it work
now?

Regards, Steve

  reply	other threads:[~2008-09-09  7:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-29 14:02 Matthew Wilcox
2008-08-29 14:06 ` Andi Kleen
2008-08-29 22:31   ` Marcel Holtmann
2008-08-29 20:46     ` Matthew Wilcox
2008-08-29 20:51       ` Willy Tarreau
2008-08-29 14:30 ` Greg KH
2008-08-29 14:43   ` Matthew Wilcox
2008-08-29 14:54     ` Greg KH
2008-08-29 15:36       ` Matthew Wilcox
2008-08-29 15:53         ` Dave Higton
2008-09-03  4:25       ` Matthew Wilcox
2008-09-03 15:40         ` Alan Stern
2008-09-03 19:10           ` Matthew Wilcox
2008-09-03 20:15             ` Alan Stern
2008-09-04 21:48               ` Matthew Wilcox
2008-09-04 22:15                 ` Greg KH
2008-09-05  3:26                 ` Pete Zaitcev
2008-09-05 11:37                 ` Tilman Schmidt
2008-09-05 15:05                 ` Alan Stern
2008-09-09  0:53                   ` Matthew Wilcox
2008-09-09  7:12                     ` Steve Calfee [this message]
2008-09-09  7:33                       ` Greg KH
2008-09-09  8:04                         ` Greg KH
2008-09-09 15:21                     ` Alan Stern
2008-09-03 15:57         ` Greg KH
2008-09-03 19:43           ` Matthew Wilcox
2008-09-04  2:41             ` Greg KH

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=4a5ff6bc0809090012j7121108cpc4cf108a4c323c52@mail.gmail.com \
    --to=stevecalfee@gmail.com \
    --cc=bgmerrell@novell.com \
    --cc=greg@kroah.com \
    --cc=hirofuchi@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=stern@rowland.harvard.edu \
    --cc=usbip-devel@lists.sourceforge.net \
    /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

all inboxes | Powered by JetHome®