<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/usb/gadget, branch linux-4.7.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.7.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-10-07T13:21:19Z</updated>
<entry>
<title>usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()</title>
<updated>2016-10-07T13:21:19Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2016-07-15T11:15:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7984b3d299209fa7f67b85f80b853c9451030f7a'/>
<id>urn:sha1:7984b3d299209fa7f67b85f80b853c9451030f7a</id>
<content type='text'>
commit f4693b08cc901912a87369c46537b94ed4084ea0 upstream.

We can't assign -EINVAL to a u16.

Fixes: 3948f0e0c999 ('usb: add Freescale QE/CPM USB peripheral controller driver')
Acked-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: udc: renesas-usb3: clear VBOUT bit in DRD_CON</title>
<updated>2016-09-24T08:09:31Z</updated>
<author>
<name>Yoshihiro Shimoda</name>
</author>
<published>2016-08-23T12:11:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c2147cbf630a56ac42bd305fbd3bf608bf38f897'/>
<id>urn:sha1:c2147cbf630a56ac42bd305fbd3bf608bf38f897</id>
<content type='text'>
commit b2f1eaaee564c5593c303f4d15d827924cb6d20d upstream.

This driver should clear the bit. Otherwise, the VBUS will output
wrongly if the usb port on a board has VBUS output capability.

Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for
		      Renesas USB3.0 peripheral controller")
Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: udc: core: don't starve DMA resources</title>
<updated>2016-09-07T06:34:54Z</updated>
<author>
<name>Felipe Balbi</name>
</author>
<published>2016-08-24T11:33:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8951e13689dfb782eea05d9431489d8d5bcfad97'/>
<id>urn:sha1:8951e13689dfb782eea05d9431489d8d5bcfad97</id>
<content type='text'>
commit 23fd537c9508fb6e3b93ddf23982f51afc087781 upstream.

Always unmap all SG entries as required by DMA API

Fixes: a698908d3b3b ("usb: gadget: add generic map/unmap request utilities")
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb/gadget: fix gadgetfs aio support.</title>
<updated>2016-09-07T06:34:47Z</updated>
<author>
<name>Mathieu Laurendeau</name>
</author>
<published>2016-07-15T12:58:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=329469d06e4b502244079bf6590796f1bb1488cf'/>
<id>urn:sha1:329469d06e4b502244079bf6590796f1bb1488cf</id>
<content type='text'>
commit 327b21da884fe1a29f733e41792ddd53e4a30379 upstream.

Fix io submissions failing with ENODEV.

Signed-off-by: Mathieu Laurendeau &lt;mat.lau@laposte.net&gt;
Fixes: 7fe3976e0f3a ("gadget: switch ep_io_operations to -&gt;read_iter/-&gt;write_iter")
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: fsl_qe_udc: off by one in setup_received_handle()</title>
<updated>2016-09-07T06:34:47Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2016-07-13T10:14:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=446ce10bc609708651f9c426b36147283663d8f8'/>
<id>urn:sha1:446ce10bc609708651f9c426b36147283663d8f8</id>
<content type='text'>
commit 7442e6db5bdd0dce4615205508301f9b22e502d6 upstream.

The udc-&gt;eps[] array has USB_MAX_ENDPOINTS elements so &gt; should be &gt;=.

Fixes: 3948f0e0c999 ('usb: add Freescale QE/CPM USB peripheral controller driver')
Acked-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: pch_udc: reorder spin_[un]lock to avoid deadlock</title>
<updated>2016-08-20T16:10:48Z</updated>
<author>
<name>Iago Abal</name>
</author>
<published>2016-06-21T10:01:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5fa79c45e3cc3906425d54a4c7fb839c5c819e67'/>
<id>urn:sha1:5fa79c45e3cc3906425d54a4c7fb839c5c819e67</id>
<content type='text'>
commit 1d23d16a88e6c8143b07339435ba061b131ebb8c upstream.

The above commit reordered spin_lock/unlock and now `&amp;dev-&gt;lock' is acquired
(rather than released) before calling `dev-&gt;driver-&gt;disconnect',
`dev-&gt;driver-&gt;setup', `dev-&gt;driver-&gt;suspend', `usb_gadget_giveback_request', and
`usb_gadget_udc_reset'.

But this *may* not be the right way to fix the problem pointed by d3cb25a12138.

Note that the other usb/gadget/udc drivers do release the lock before calling
these functions. There are also inconsistencies within pch_udc.c, where
`dev-&gt;driver-&gt;disconnect' is called while holding `&amp;dev-&gt;lock' in lines 613 and
1184, but not in line 2739.

Finally, commit d3cb25a12138 may have introduced several potential deadlocks.

For instance, EBA (https://github.com/models-team/eba) reports:

    Double lock in drivers/usb/gadget/udc/pch_udc.c
    first at 2791: spin_lock(&amp; dev-&gt;lock); [pch_udc_isr]
    second at 2694: spin_lock(&amp; dev-&gt;lock); [pch_udc_svc_cfg_interrupt]
        after calling from 2793: pch_udc_dev_isr(dev, dev_intr);
        after calling from 2724: pch_udc_svc_cfg_interrupt(dev);

Similarly, other potential deadlocks are 2791 -&gt; 2793 -&gt; 2721 -&gt; 2657; and
2791 -&gt; 2793 -&gt; 2711 -&gt; 2573 -&gt; 1499 -&gt; 1480.

Fixes: d3cb25a12138 ("usb: gadget: udc: fix spin_lock in pch_udc")
Signed-off-by: Iago Abal &lt;mail@iagoabal.eu&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: udc: atmel: Also get regmap for at91sam9x5-pmc</title>
<updated>2016-08-20T16:10:48Z</updated>
<author>
<name>Alexandre Belloni</name>
</author>
<published>2016-06-13T08:47:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=035753b906a2fa8a0886cd87602810c6f48e0799'/>
<id>urn:sha1:035753b906a2fa8a0886cd87602810c6f48e0799</id>
<content type='text'>
commit 882bd9fc46321c9d4721b376039a142cbfe8a17a upstream.

The "atmel,at91sam9g45-udc" compatible UDC is also used on at91sam9x5 so it
is also necessary to try to get the syscon for at91sam9x5-pmc.

Fixes: 4747639f01c9 ("usb: gadget: atmel: access the PMC using regmap")
Reported-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@free-electrons.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: gadget: composite: don't queue OS desc req if length is invalid</title>
<updated>2016-05-31T08:24:31Z</updated>
<author>
<name>William Wu</name>
</author>
<published>2016-05-13T10:30:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e14f47a55ed67c9d8a8acea6023412f92bac936'/>
<id>urn:sha1:7e14f47a55ed67c9d8a8acea6023412f92bac936</id>
<content type='text'>
In OS descriptors handling, if ctrl-&gt;bRequestType is
USB_RECIP_DEVICE and w_index != 0x4 or (w_value &gt;&gt; 8)
is true, it will not assign a valid value to req-&gt;length,
but use the default value(-EOPNOTSUPP), and queue an
OS desc request with the invalid req-&gt;length. It always
happens on the platforms which use os_desc (for example:
rk3366, rk3399), and cause kernel panic as follows
(use dwc3 driver):

Unable to handle kernel paging request at virtual address ffffffc0f7e00000
Internal error: Oops: 96000146 [#1] PREEMPT SMP
PC is at __dma_clean_range+0x18/0x30
LR is at __swiotlb_map_page+0x50/0x64
Call trace:
[&lt;ffffffc0000930f8&gt;] __dma_clean_range+0x18/0x30
[&lt;ffffffc00062214c&gt;] usb_gadget_map_request+0x134/0x1b0
[&lt;ffffffc0005c289c&gt;] __dwc3_ep0_do_control_data+0x110/0x14c
[&lt;ffffffc0005c2d38&gt;] __dwc3_gadget_ep0_queue+0x198/0x1b8
[&lt;ffffffc0005c2e18&gt;] dwc3_gadget_ep0_queue+0xc0/0xe8
[&lt;ffffffc00061cfec&gt;] composite_ep0_queue.constprop.14+0x34/0x98
[&lt;ffffffc00061dfb0&gt;] composite_setup+0xf60/0x100c
[&lt;ffffffc0006204dc&gt;] android_setup+0xd8/0x138
[&lt;ffffffc0005c29a4&gt;] dwc3_ep0_delegate_req+0x34/0x50
[&lt;ffffffc0005c3534&gt;] dwc3_ep0_interrupt+0x5dc/0xb58
[&lt;ffffffc0005c0c3c&gt;] dwc3_thread_interrupt+0x15c/0xa24

With this patch, the gadget driver will not queue
a request and return immediately if req-&gt;length is
invalid. And the usb controller driver can handle
the unsupport request correctly.

Signed-off-by: William Wu &lt;william.wu@rock-chips.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_fs: Fix kernel panic if use_os_string not set</title>
<updated>2016-05-31T08:24:30Z</updated>
<author>
<name>Jim Lin</name>
</author>
<published>2016-05-13T12:32:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c6010c8b4d2c6e75853ca63c602c9af56fcbead5'/>
<id>urn:sha1:c6010c8b4d2c6e75853ca63c602c9af56fcbead5</id>
<content type='text'>
If c-&gt;cdev-&gt;use_os_string flag is not set,
don't need to invoke ffs_do_os_descs() in _ffs_func_bind.
So uninitialized ext_compat_id pointer won't be accessed by
__ffs_func_bind_do_os_desc to cause kernel panic.

Signed-off-by: Jim Lin &lt;jilin@nvidia.com&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_tcm: out of bound access in usbg_drop_tpg</title>
<updated>2016-05-31T08:24:30Z</updated>
<author>
<name>Heinrich Schuchardt</name>
</author>
<published>2016-05-08T20:50:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e877b729c649c2850f61f2ae37296ae701f9ad63'/>
<id>urn:sha1:e877b729c649c2850f61f2ae37296ae701f9ad63</id>
<content type='text'>
Commit dc8c46a5ae77 ("usb: gadget: f_tcm: convert to new function
interface with backward compatibility") introduced a possible out
of bounds memory access:

If tpg is not found in function usbg_drop_tpg,
tpg_instances[TPG_INSTANCES] is accessed.

Fixes: dc8c46a5ae77 ("usb: gadget: f_tcm: convert to new function interface with backward compatibility")
Signed-off-by: Heinrich Schuchardt &lt;xypron.glpk@gmx.de&gt;
Signed-off-by: Felipe Balbi &lt;felipe.balbi@linux.intel.com&gt;
</content>
</entry>
</feed>
