<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/include/linux/usb/gadget.h, branch v4.5.3</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>usb: gadget: forbid queuing request to a disabled ep</title>
<updated>2015-12-22T18:04:05+00:00</updated>
<author>
<name>Du, Changbin</name>
<email>changbin.du@intel.com</email>
</author>
<published>2015-12-18T07:36:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8a0859b65b06ea07461271ce4f1fe25b48d1ec55'/>
<id>8a0859b65b06ea07461271ce4f1fe25b48d1ec55</id>
<content type='text'>
Queue a request to disabled ep  doesn't make sense, and induce caller
make mistakes.

Here is a example for the android mtp gadget function driver. A mem
corruption can happen on below senario.
1) On disconnect, mtp driver disable its EPs,
2) During send_file_work and receive_file_work, mtp queues a request
   to ep. (The mtp driver need improve its synchronization logic!)
3) mtp_function_unbind is invoked and all mtp requests are freed.
4) when udc process the request queued on step 2, will cause kernel
   NULL pointer dereference exception.

Signed-off-by: Du, Changbin &lt;changbin.du@intel.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Queue a request to disabled ep  doesn't make sense, and induce caller
make mistakes.

Here is a example for the android mtp gadget function driver. A mem
corruption can happen on below senario.
1) On disconnect, mtp driver disable its EPs,
2) During send_file_work and receive_file_work, mtp queues a request
   to ep. (The mtp driver need improve its synchronization logic!)
3) mtp_function_unbind is invoked and all mtp requests are freed.
4) when udc process the request queued on step 2, will cause kernel
   NULL pointer dereference exception.

Signed-off-by: Du, Changbin &lt;changbin.du@intel.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: udc-core: independent registration of gadgets and gadget drivers</title>
<updated>2015-12-16T16:07:27+00:00</updated>
<author>
<name>Ruslan Bilovol</name>
<email>ruslan.bilovol@gmail.com</email>
</author>
<published>2015-11-23T08:56:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=855ed04a3758b205e84b269f92d26ab36ed8e2f7'/>
<id>855ed04a3758b205e84b269f92d26ab36ed8e2f7</id>
<content type='text'>
Change behavior during registration of gadgets and
gadget drivers in udc-core. Instead of previous
approach when for successful probe of usb gadget driver
at least one usb gadget should be already registered
use another one where gadget drivers and gadgets
can be registered in udc-core independently.

Independent registration of gadgets and gadget drivers
is useful for built-in into kernel gadget and gadget
driver case - because it's possible that gadget is
really probed only on late_init stage (due to deferred
probe) whereas gadget driver's probe is silently failed
on module_init stage due to no any UDC added.

Also it is useful for modules case - now there is no
difference what module to insert first: gadget module
or gadget driver one.

Tested-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Ruslan Bilovol &lt;ruslan.bilovol@gmail.com&gt;
[simplified code as requested by Alan Stern and Felipe Balbi,
 fixed checkpatch issues]
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change behavior during registration of gadgets and
gadget drivers in udc-core. Instead of previous
approach when for successful probe of usb gadget driver
at least one usb gadget should be already registered
use another one where gadget drivers and gadgets
can be registered in udc-core independently.

Independent registration of gadgets and gadget drivers
is useful for built-in into kernel gadget and gadget
driver case - because it's possible that gadget is
really probed only on late_init stage (due to deferred
probe) whereas gadget driver's probe is silently failed
on module_init stage due to no any UDC added.

Also it is useful for modules case - now there is no
difference what module to insert first: gadget module
or gadget driver one.

Tested-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Ruslan Bilovol &lt;ruslan.bilovol@gmail.com&gt;
[simplified code as requested by Alan Stern and Felipe Balbi,
 fixed checkpatch issues]
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: udc-core: remove unused usb_udc_attach_driver()</title>
<updated>2015-12-16T16:07:26+00:00</updated>
<author>
<name>Ruslan Bilovol</name>
<email>ruslan.bilovol@gmail.com</email>
</author>
<published>2015-11-23T08:56:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=88f73ebdfa75602af18e070a4d5d6d9091bcfada'/>
<id>88f73ebdfa75602af18e070a4d5d6d9091bcfada</id>
<content type='text'>
Now when last user of usb_udc_attach_driver() is switched
to passing UDC name via usb_gadget_driver struct, it's safe
to remove this function

Tested-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Ruslan Bilovol &lt;ruslan.bilovol@gmail.com&gt;
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now when last user of usb_udc_attach_driver() is switched
to passing UDC name via usb_gadget_driver struct, it's safe
to remove this function

Tested-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Ruslan Bilovol &lt;ruslan.bilovol@gmail.com&gt;
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: bind UDC by name passed via usb_gadget_driver structure</title>
<updated>2015-12-16T16:07:26+00:00</updated>
<author>
<name>Ruslan Bilovol</name>
<email>ruslan.bilovol@gmail.com</email>
</author>
<published>2015-11-23T08:56:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2284b29d3d9dd16490909962574d7f3fef83fd97'/>
<id>2284b29d3d9dd16490909962574d7f3fef83fd97</id>
<content type='text'>
Introduce new 'udc_name' member to usb_gadget_driver structure.
The 'udc_name' is a name of UDC that usb_gadget_driver should
be bound to. If udc_name is NULL, it will be bound to any
available UDC.

Tested-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Ruslan Bilovol &lt;ruslan.bilovol@gmail.com&gt;
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce new 'udc_name' member to usb_gadget_driver structure.
The 'udc_name' is a name of UDC that usb_gadget_driver should
be bound to. If udc_name is NULL, it will be bound to any
available UDC.

Tested-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Ruslan Bilovol &lt;ruslan.bilovol@gmail.com&gt;
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Peter Chen &lt;peter.chen@freescale.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: introduce 'enabled' flag in struct usb_ep</title>
<updated>2015-09-27T15:54:31+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2015-09-16T10:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b0bac2581c1918cc4ab0aca01977ad69f0bc127a'/>
<id>b0bac2581c1918cc4ab0aca01977ad69f0bc127a</id>
<content type='text'>
This patch introduces 'enabled' flag in struct usb_ep, and modifies
usb_ep_enable() and usb_ep_disable() functions to encapsulate endpoint
enabled/disabled state. It helps to avoid enabling endpoints which are
already enabled, and disabling endpoints which are already disables.

From now USB functions don't have to remember current endpoint
enable/disable state, as this state is now handled automatically which
makes this API less bug-prone.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces 'enabled' flag in struct usb_ep, and modifies
usb_ep_enable() and usb_ep_disable() functions to encapsulate endpoint
enabled/disabled state. It helps to avoid enabling endpoints which are
already enabled, and disabling endpoints which are already disables.

From now USB functions don't have to remember current endpoint
enable/disable state, as this state is now handled automatically which
makes this API less bug-prone.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: epautoconf: add usb_ep_autoconfig_release() function</title>
<updated>2015-09-27T15:54:31+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2015-09-16T10:10:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b67f628c84329a9ce82dbff5fde196dc4624e7c2'/>
<id>b67f628c84329a9ce82dbff5fde196dc4624e7c2</id>
<content type='text'>
This patch introduces usb_ep_autoconfig_release() function which allows
to release endpoint previously obtained from usb_ep_autoconfig() during
USB function bind.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch introduces usb_ep_autoconfig_release() function which allows
to release endpoint previously obtained from usb_ep_autoconfig() during
USB function bind.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: move find_ep() from epautoconf to udc-core</title>
<updated>2015-08-06T14:33:14+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2015-08-06T12:11:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b0aea0037c8896b8e69cad3f6e828782789c1edf'/>
<id>b0aea0037c8896b8e69cad3f6e828782789c1edf</id>
<content type='text'>
Move find_ep() to udc-core and rename it to gadget_find_ep_by_name().
It can be used in UDC drivers, especially in 'match_ep' callback after
moving chip-specific endpoint matching logic from epautoconf to UDC
drivers.

Replace all calls of find_ep() function with gadget_find_ep_by_name().

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move find_ep() to udc-core and rename it to gadget_find_ep_by_name().
It can be used in UDC drivers, especially in 'match_ep' callback after
moving chip-specific endpoint matching logic from epautoconf to UDC
drivers.

Replace all calls of find_ep() function with gadget_find_ep_by_name().

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: move ep_matches() from epautoconf to udc-core</title>
<updated>2015-08-06T14:32:57+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2015-08-06T12:11:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4278c687f697b651ab0c771114564da5ed006f22'/>
<id>4278c687f697b651ab0c771114564da5ed006f22</id>
<content type='text'>
Move ep_matches() function to udc-core and rename it to
usb_gadget_ep_match_desc(). This function can be used by UDC drivers
in 'match_ep' callback to avoid writing lots of repetitive code.

Replace all calls of ep_matches() with usb_gadget_ep_match_desc().

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Move ep_matches() function to udc-core and rename it to
usb_gadget_ep_match_desc(). This function can be used by UDC drivers
in 'match_ep' callback to avoid writing lots of repetitive code.

Replace all calls of ep_matches() with usb_gadget_ep_match_desc().

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: add 'ep_match' callback to usb_gadget_ops</title>
<updated>2015-08-06T14:31:45+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2015-08-06T12:11:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=596c154d62330ea0bb4e3c3e50afa3682e50b617'/>
<id>596c154d62330ea0bb4e3c3e50afa3682e50b617</id>
<content type='text'>
Add callback that is called by epautoconf to allow UDC driver match the
best endpoint for specific descriptor. It's intended to supply mechanism
which allows to get rid of chip-specific endpoint matching code from
epautoconf.

If gadget has set 'ep_match' callback we prefer to call it first, and
if it fails to find matching endpoint, then we try to use default matching
algorithm.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add callback that is called by epautoconf to allow UDC driver match the
best endpoint for specific descriptor. It's intended to supply mechanism
which allows to get rid of chip-specific endpoint matching code from
epautoconf.

If gadget has set 'ep_match' callback we prefer to call it first, and
if it fails to find matching endpoint, then we try to use default matching
algorithm.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usb: gadget: add endpoint capabilities helper macros</title>
<updated>2015-08-04T17:25:09+00:00</updated>
<author>
<name>Robert Baldyga</name>
<email>r.baldyga@samsung.com</email>
</author>
<published>2015-07-31T14:00:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=80e6e3847f851fc05e63265050115e29e2a50d7e'/>
<id>80e6e3847f851fc05e63265050115e29e2a50d7e</id>
<content type='text'>
Add macros useful while initializing array of endpoint capabilities
structures. These macros makes structure initialization more compact
to decrease number of code lines and increase readability of code.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add macros useful while initializing array of endpoint capabilities
structures. These macros makes structure initialization more compact
to decrease number of code lines and increase readability of code.

Signed-off-by: Robert Baldyga &lt;r.baldyga@samsung.com&gt;
Signed-off-by: Felipe Balbi &lt;balbi@ti.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
