From: Arnd Bergmann <arnd@arndb.de>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Scott Wood <scottwood@freescale.com>,
dbrownell@users.sourceforge.net, greg@kroah.com,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxppc-dev@ozlabs.org, Li Yang <leoli@freescale.com>
Subject: Re: [PATCH] usb: add Freescale QE/CPM USB peripheral controller driver
Date: Fri, 29 Aug 2008 18:29:48 +0200 [thread overview]
Message-ID: <200808291829.48939.arnd@arndb.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0808291202270.4447-100000@netrider.rowland.org>
On Friday 29 August 2008, Alan Stern wrote:
> > The standard requires that there can only be one protocol handler
> > per physical interface, which is a reasonable limitation.
>
> No, you've got it exactly backward. There can be multiple protocol
> handlers per physical interface, but there must be only one physical
> interface per device.
Maybe I am using wrong terminology, but I still don't see how that
fits together. Let me try to explain what I have understood so far:
The physical device is identified by a struct usb_gadget is defined
statically in the driver that exports the
usb_gadget_{un,}register_driver() functions. Obviously there can only
be one physical interface per physical device, I was not arguing
against that.
The protocol handler is identified by a usb_gadget_driver and defined
in a driver that calls usb_gadget_register_driver().
You say that there can be multiple protocol handlers, which I don't
understand because the protocol handlers all call set_gadget_data,
which overwrites the previous driver_data field in struct usb_gadget,
making it impossible to load more than one simultaneously.
> > However, what the Linux implementation actually enforces is
> > that there can only be one hardware specific driver built or loaded
> > into the kernel, which just looks like an arbitrary restriction
> > that does not actually help.
>
> Not at all -- it is an implementation of the constraint that there be
> only one physical interface.
How that? Taking drivers/usb/gadget/fsl_usb2_udc.c as an example, it will
create a new fsl_udc structure for each matching platform_device it finds
(though it will leak every one except the last one), so the interface
does not limit the number of physical interfaces at all to this point,
the implementation of the every gadget hardware driver does this.
The real problem is that you cannot build a kernel that has both
fsl_usb2_udc.c and fsl_qe_udc.c built in. Having both drivers loaded
would not violate the one-interface rule, because only one of them
would find hardware to bind to on a given system, just like you can
load both the uhci and ohci drivers without them interfering.
Arnd <><
next prev parent reply other threads:[~2008-08-29 16:30 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-28 9:43 [PATCH] usb: add Freescale QE/CPM USB peripheral controller driver Li Yang
2008-08-28 15:04 ` Arnd Bergmann
2008-08-28 17:22 ` Alan Stern
2008-08-28 17:53 ` Scott Wood
2008-08-28 20:16 ` Alan Stern
2008-08-28 22:27 ` Arnd Bergmann
2008-08-29 16:05 ` Alan Stern
2008-08-29 16:29 ` Arnd Bergmann [this message]
2008-08-29 17:19 ` Alan Stern
2008-08-29 17:38 ` Arnd Bergmann
2008-08-29 21:22 ` Alan Stern
2008-09-24 20:15 ` David Brownell
2008-08-29 8:57 ` Li Yang
2008-08-29 8:57 ` Arnd Bergmann
2008-09-24 20:10 ` David Brownell
2008-08-28 16:39 ` Scott Wood
2008-08-29 9:35 ` Li Yang
2008-09-01 13:52 ` Anton Vorontsov
2008-09-02 7:08 ` Li Yang
2008-09-01 16:34 ` Anton Vorontsov
2008-09-01 17:11 ` Anton Vorontsov
2008-09-02 7:35 ` Li Yang
2008-09-02 7:57 ` Joakim Tjernlund
2008-09-02 8:12 ` [PATCH] usb: add Freescale QE/CPM USB peripheral controllerdriver Li Yang-R58472
2008-09-02 8:15 ` Joakim Tjernlund
2008-09-24 20:28 ` David Brownell
[not found] ` <07ab01c91e8c$b56f6140$204e23c0$@Tjernlund@transmode.se>
2008-09-24 21:42 ` David Brownell
2008-09-24 20:26 ` David Brownell
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=200808291829.48939.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=dbrownell@users.sourceforge.net \
--cc=greg@kroah.com \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox