<feed xmlns='http://www.w3.org/2005/Atom'>
<title>wireguard-linux/drivers/usb/chipidea/udc.c, branch jd/unified-crypt-queue</title>
<subtitle>WireGuard for the Linux kernel</subtitle>
<id>https://git.zx2c4.com/wireguard-linux/atom/drivers/usb/chipidea/udc.c?h=jd%2Funified-crypt-queue</id>
<link rel='self' href='https://git.zx2c4.com/wireguard-linux/atom/drivers/usb/chipidea/udc.c?h=jd%2Funified-crypt-queue'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/'/>
<updated>2020-03-23T07:04:08Z</updated>
<entry>
<title>Merge 5.6-rc7 into usb-next</title>
<updated>2020-03-23T07:04:08Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2020-03-23T07:04:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d2e971d884e7b7e65162788b8f3b7801cd8bc137'/>
<id>urn:sha1:d2e971d884e7b7e65162788b8f3b7801cd8bc137</id>
<content type='text'>
We need the USB fixes in here as well.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: fix sleeping function called from invalid context</title>
<updated>2020-03-17T19:24:28Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2020-03-16T03:10:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=7368760d1bcdabf515c41a502568b489de3da683'/>
<id>urn:sha1:7368760d1bcdabf515c41a502568b489de3da683</id>
<content type='text'>
The code calls pm_runtime_get_sync with irq disabled, it causes below
warning:

BUG: sleeping function called from invalid context at
wer/runtime.c:1075
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid:
er/u8:1
CPU: 1 PID: 37 Comm: kworker/u8:1 Not tainted
20200304-00181-gbebfd2a5be98 #1588
Hardware name: NVIDIA Tegra SoC (Flattened Device Tree)
Workqueue: ci_otg ci_otg_work
[&lt;c010e8bd&gt;] (unwind_backtrace) from [&lt;c010a315&gt;]
1/0x14)
[&lt;c010a315&gt;] (show_stack) from [&lt;c0987d29&gt;]
5/0x94)
[&lt;c0987d29&gt;] (dump_stack) from [&lt;c013e77f&gt;]
+0xeb/0x118)
[&lt;c013e77f&gt;] (___might_sleep) from [&lt;c052fa1d&gt;]
esume+0x75/0x78)
[&lt;c052fa1d&gt;] (__pm_runtime_resume) from [&lt;c0627a33&gt;]
0x23/0x74)
[&lt;c0627a33&gt;] (ci_udc_pullup) from [&lt;c062fb93&gt;]
nect+0x2b/0xcc)
[&lt;c062fb93&gt;] (usb_gadget_connect) from [&lt;c062769d&gt;]
_connect+0x59/0x104)
[&lt;c062769d&gt;] (ci_hdrc_gadget_connect) from [&lt;c062778b&gt;]
ssion+0x43/0x48)
[&lt;c062778b&gt;] (ci_udc_vbus_session) from [&lt;c062f997&gt;]
s_connect+0x17/0x9c)
[&lt;c062f997&gt;] (usb_gadget_vbus_connect) from [&lt;c062634d&gt;]
bd/0x128)
[&lt;c062634d&gt;] (ci_otg_work) from [&lt;c0134719&gt;]
rk+0x149/0x404)
[&lt;c0134719&gt;] (process_one_work) from [&lt;c0134acb&gt;]
0xf7/0x3bc)
[&lt;c0134acb&gt;] (worker_thread) from [&lt;c0139433&gt;]
x118)
[&lt;c0139433&gt;] (kthread) from [&lt;c01010bd&gt;]
(ret_from_fork+0x11/0x34)

Tested-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; #v5.5
Fixes: 72dc8df7920f ("usb: chipidea: udc: protect usb interrupt enable")
Reported-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Link: https://lore.kernel.org/r/20200316031034.17847-2-peter.chen@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: using structure ci_hdrc device for runtime PM</title>
<updated>2020-03-16T03:13:47Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2020-01-23T02:49:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=7fd87c956c0ab5633f20597cb828713f9c03aa5b'/>
<id>urn:sha1:7fd87c956c0ab5633f20597cb828713f9c03aa5b</id>
<content type='text'>
At current code, it doesn't maintain ci-&gt;gadget.dev's runtime PM
status well, eg, during the PM operation, the PM counter for
ci-&gt;gadget.dev doesn't be changed accordingly.

In this commit, we use ci_hdrc device instead of ci-&gt;gadget.dev
for runtime PM APIs at udc driver, in the way, we handle runtime
PM APIs using unify device structure between core and udc driver.

Reviewed-by: Jun Li &lt;jun.li@nxp.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: protect usb interrupt enable</title>
<updated>2019-11-18T08:45:30Z</updated>
<author>
<name>Jun Li</name>
<email>jun.li@nxp.com</email>
</author>
<published>2019-09-10T06:54:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=72dc8df7920fc24eba0f586c56e900a1643ff2b3'/>
<id>urn:sha1:72dc8df7920fc24eba0f586c56e900a1643ff2b3</id>
<content type='text'>
We hit the problem with below sequence:
- ci_udc_vbus_session() update vbus_active flag and ci-&gt;driver
is valid,
- before calling the ci_hdrc_gadget_connect(),
usb_gadget_udc_stop() is called by application remove gadget
driver,
- ci_udc_vbus_session() will contine do ci_hdrc_gadget_connect() as
gadget_ready is 1, so udc interrupt is enabled, but ci-&gt;driver is
NULL.
- USB connection irq generated but ci-&gt;driver is NULL.

As udc irq only should be enabled when gadget driver is binded, so
add spinlock to protect the usb irq enable for vbus session handling.

Signed-off-by: Jun Li &lt;jun.li@nxp.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: add new API ci_hdrc_gadget_connect</title>
<updated>2019-11-18T08:45:30Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2019-09-10T02:54:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=d16ab536aad208421c5ed32cdcb01b5ab6aa1f19'/>
<id>urn:sha1:d16ab536aad208421c5ed32cdcb01b5ab6aa1f19</id>
<content type='text'>
This API is used enable device function, it is called at below
situations:
- VBUS is connected during boots up
- Hot plug occurs during runtime

Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Jun Li &lt;jun.li@nxp.com&gt;
</content>
</entry>
<entry>
<title>usb: Spelling s/disconnet/disconnect/</title>
<updated>2019-11-04T14:53:01Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2019-10-24T15:27:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=4ff0eccbb5c4487ef065931f5c566d85a5bfb5c9'/>
<id>urn:sha1:4ff0eccbb5c4487ef065931f5c566d85a5bfb5c9</id>
<content type='text'>
Fix misspellings of "disconnect".

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Acked-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Link: https://lore.kernel.org/r/20191024152747.30617-1-geert+renesas@glider.be
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 5.3-rc7 into usb-next</title>
<updated>2019-09-02T17:31:18Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-09-02T17:31:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=7a81146204859c6f8d8daf3ab7a25af17dfecd5f'/>
<id>urn:sha1:7a81146204859c6f8d8daf3ab7a25af17dfecd5f</id>
<content type='text'>
We need the usb fixes in here for testing

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: don't do hardware access if gadget has stopped</title>
<updated>2019-08-21T16:45:49Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2019-08-20T02:07:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=cbe85c88ce80fb92956a0793518d415864dcead8'/>
<id>urn:sha1:cbe85c88ce80fb92956a0793518d415864dcead8</id>
<content type='text'>
After _gadget_stop_activity is executed, we can consider the hardware
operation for gadget has finished, and the udc can be stopped and enter
low power mode. So, any later hardware operations (from usb_ep_ops APIs
or usb_gadget_ops APIs) should be considered invalid, any deinitializatons
has been covered at _gadget_stop_activity.

I meet this problem when I plug out usb cable from PC using mass_storage
gadget, my callstack like: vbus interrupt-&gt;.vbus_session-&gt;
composite_disconnect -&gt;pm_runtime_put_sync(&amp;_gadget-&gt;dev),
the composite_disconnect will call fsg_disable, but fsg_disable calls
usb_ep_disable using async way, there are register accesses for
usb_ep_disable. So sometimes, I get system hang due to visit register
without clock, sometimes not.

The Linux Kernel USB maintainer Alan Stern suggests this kinds of solution.
See: http://marc.info/?l=linux-usb&amp;m=138541769810983&amp;w=2.

Cc: &lt;stable@vger.kernel.org&gt; #v4.9+
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Link: https://lore.kernel.org/r/20190820020503.27080-2-peter.chen@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: remove redundant assignment to variable retval</title>
<updated>2019-07-25T09:10:55Z</updated>
<author>
<name>Colin Ian King</name>
<email>colin.king@canonical.com</email>
</author>
<published>2019-07-04T15:03:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=ed7fe551575cd6dbbe31282a0869682aeea2627c'/>
<id>urn:sha1:ed7fe551575cd6dbbe31282a0869682aeea2627c</id>
<content type='text'>
The variable retval is being initialized with a value that is never
read and it is being updated later with a new value. The
initialization is redundant and can be removed.  Also remove a blank
line.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King &lt;colin.king@canonical.com&gt;
Link: https://lore.kernel.org/r/20190704150341.759-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: workaround for endpoint conflict issue</title>
<updated>2019-06-17T13:08:33Z</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2019-06-17T01:49:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/wireguard-linux/commit/?id=c19dffc0a9511a7d7493ec21019aefd97e9a111b'/>
<id>urn:sha1:c19dffc0a9511a7d7493ec21019aefd97e9a111b</id>
<content type='text'>
An endpoint conflict occurs when the USB is working in device mode
during an isochronous communication. When the endpointA IN direction
is an isochronous IN endpoint, and the host sends an IN token to
endpointA on another device, then the OUT transaction may be missed
regardless the OUT endpoint number. Generally, this occurs when the
device is connected to the host through a hub and other devices are
connected to the same hub.

The affected OUT endpoint can be either control, bulk, isochronous, or
an interrupt endpoint. After the OUT endpoint is primed, if an IN token
to the same endpoint number on another device is received, then the OUT
endpoint may be unprimed (cannot be detected by software), which causes
this endpoint to no longer respond to the host OUT token, and thus, no
corresponding interrupt occurs.

There is no good workaround for this issue, the only thing the software
could do is numbering isochronous IN from the highest endpoint since we
have observed most of device number endpoint from the lowest.

Cc: &lt;stable@vger.kernel.org&gt; #v3.14+
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: Greg KH &lt;gregkh@linuxfoundation.org&gt;
Cc: Sergei Shtylyov &lt;sergei.shtylyov@cogentembedded.com&gt;
Cc: Jun Li &lt;jun.li@nxp.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
