<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/usb/chipidea, branch v4.4.235</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.235</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.4.235'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2020-07-22T07:10:05+00:00</updated>
<entry>
<title>usb: chipidea: core: add wakeup support for extcon</title>
<updated>2020-07-22T07:10:05+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2020-07-07T06:06:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e4468aff613291859776ce7aac3714e1b1ef015b'/>
<id>urn:sha1:e4468aff613291859776ce7aac3714e1b1ef015b</id>
<content type='text'>
commit 876d4e1e8298ad1f94d9e9392fc90486755437b4 upstream.

If wakeup event occurred by extcon event, it needs to call
ci_irq again since the first ci_irq calling at extcon notifier
only wakes up controller, but do noop for event handling,
it causes the extcon use case can't work well from low power mode.

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 3ecb3e09b042 ("usb: chipidea: Use extcon framework for VBUS and ID detect")
Reported-by: Philippe Schenker &lt;philippe.schenker@toradex.com&gt;
Tested-by: Philippe Schenker &lt;philippe.schenker@toradex.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Link: https://lore.kernel.org/r/20200707060601.31907-2-peter.chen@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: chipidea: host: Disable port power only if previously enabled</title>
<updated>2020-01-14T19:03:00+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2019-12-26T15:57:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c297c2ebbbe3a7778b1b763d5469d918e6890f68'/>
<id>urn:sha1:c297c2ebbbe3a7778b1b763d5469d918e6890f68</id>
<content type='text'>
commit c1ffba305dbcf3fb9ca969c20a97acbddc38f8e9 upstream.

On shutdown, ehci_power_off() is called unconditionally to power off
each port, even if it was never called to power on the port.
For chipidea, this results in a call to ehci_ci_portpower() with a request
to power off ports even if the port was never powered on.
This results in the following warning from the regulator code.

WARNING: CPU: 0 PID: 182 at drivers/regulator/core.c:2596 _regulator_disable+0x1a8/0x210
unbalanced disables for usb_otg2_vbus
Modules linked in:
CPU: 0 PID: 182 Comm: init Not tainted 5.4.6 #1
Hardware name: Freescale i.MX7 Dual (Device Tree)
[&lt;c0313658&gt;] (unwind_backtrace) from [&lt;c030d698&gt;] (show_stack+0x10/0x14)
[&lt;c030d698&gt;] (show_stack) from [&lt;c1133afc&gt;] (dump_stack+0xe0/0x10c)
[&lt;c1133afc&gt;] (dump_stack) from [&lt;c0349098&gt;] (__warn+0xf4/0x10c)
[&lt;c0349098&gt;] (__warn) from [&lt;c0349128&gt;] (warn_slowpath_fmt+0x78/0xbc)
[&lt;c0349128&gt;] (warn_slowpath_fmt) from [&lt;c09f36ac&gt;] (_regulator_disable+0x1a8/0x210)
[&lt;c09f36ac&gt;] (_regulator_disable) from [&lt;c09f374c&gt;] (regulator_disable+0x38/0xe8)
[&lt;c09f374c&gt;] (regulator_disable) from [&lt;c0df7bac&gt;] (ehci_ci_portpower+0x38/0xdc)
[&lt;c0df7bac&gt;] (ehci_ci_portpower) from [&lt;c0db4fa4&gt;] (ehci_port_power+0x50/0xa4)
[&lt;c0db4fa4&gt;] (ehci_port_power) from [&lt;c0db5420&gt;] (ehci_silence_controller+0x5c/0xc4)
[&lt;c0db5420&gt;] (ehci_silence_controller) from [&lt;c0db7644&gt;] (ehci_stop+0x3c/0xcc)
[&lt;c0db7644&gt;] (ehci_stop) from [&lt;c0d5bdc4&gt;] (usb_remove_hcd+0xe0/0x19c)
[&lt;c0d5bdc4&gt;] (usb_remove_hcd) from [&lt;c0df7638&gt;] (host_stop+0x38/0xa8)
[&lt;c0df7638&gt;] (host_stop) from [&lt;c0df2f34&gt;] (ci_hdrc_remove+0x44/0xe4)
...

Keeping track of the power enable state avoids the warning and traceback.

Fixes: c8679a2fb8dec ("usb: chipidea: host: add portpower override")
Cc: Michael Grzeschik &lt;m.grzeschik@pengutronix.de&gt;
Cc: Peter Chen &lt;peter.chen@freescale.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Acked-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Link: https://lore.kernel.org/r/20191226155754.25451-1-linux@roeck-us.net
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: chipidea: Fix otg event handler</title>
<updated>2019-11-25T14:54:05+00:00</updated>
<author>
<name>Loic Poulain</name>
<email>loic.poulain@linaro.org</email>
</author>
<published>2018-09-04T15:18:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7e15c978362559a8e0f9dc5bd0d0030dd980bf84'/>
<id>urn:sha1:7e15c978362559a8e0f9dc5bd0d0030dd980bf84</id>
<content type='text'>
[ Upstream commit 59739131e0ca06db7560f9073fff2fb83f6bc2a5 ]

At OTG work running time, it's possible that several events need to be
addressed (e.g. ID and VBUS events). The current implementation handles
only one event at a time which leads to ignoring the other one. Fix it.

Signed-off-by: Loic Poulain &lt;loic.poulain@linaro.org&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: udc: workaround for endpoint conflict issue</title>
<updated>2019-07-10T07:56:31+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2019-06-17T01:49:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9a7435e1a5b94c8970a82254c27004dcaa8c440c'/>
<id>urn:sha1:9a7435e1a5b94c8970a82254c27004dcaa8c440c</id>
<content type='text'>
commit c19dffc0a9511a7d7493ec21019aefd97e9a111b upstream.

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>
<entry>
<title>usb: chipidea: Grab the (legacy) USB PHY by phandle first</title>
<updated>2019-04-27T07:33:49+00:00</updated>
<author>
<name>Paul Kocialkowski</name>
<email>paul.kocialkowski@bootlin.com</email>
</author>
<published>2019-02-27T06:51:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f3666bfc4bc4d0302db4a80266666c72ca92f01c'/>
<id>urn:sha1:f3666bfc4bc4d0302db4a80266666c72ca92f01c</id>
<content type='text'>
[ Upstream commit 68ef236274793066b9ba3154b16c0acc1c891e5c ]

According to the chipidea driver bindings, the USB PHY is specified via
the "phys" phandle node. However, this only takes effect for USB PHYs
that use the common PHY framework. For legacy USB PHYs, a simple lookup
based on the USB PHY type is done instead.

This does not play out well when more than one USB PHY is registered,
since the first registered PHY matching the type will always be
returned regardless of what the driver was bound to.

Fix this by looking up the PHY based on the "phys" phandle node.
Although generic PHYs are rather matched by their "phys-name" and not
the "phys" phandle directly, there is no helper for similar lookup on
legacy PHYs and it's probably not worth the effort to add it.

When no legacy USB PHY is found by phandle, fallback to grabbing any
registered USB2 PHY. This ensures backward compatibility if some users
were actually relying on this mechanism.

Signed-off-by: Paul Kocialkowski &lt;paul.kocialkowski@bootlin.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: Prevent unbalanced IRQ disable</title>
<updated>2018-11-21T08:27:33+00:00</updated>
<author>
<name>Loic Poulain</name>
<email>loic.poulain@linaro.org</email>
</author>
<published>2018-09-04T15:18:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d986aedcc39ab86a9179a7588c7327e524bf7baf'/>
<id>urn:sha1:d986aedcc39ab86a9179a7588c7327e524bf7baf</id>
<content type='text'>
[ Upstream commit 8b97d73c4d72a2abf58f8e49062a7ee1e5f1334e ]

The ChipIdea IRQ is disabled before scheduling the otg work and
re-enabled on otg work completion. However if the job is already
scheduled we have to undo the effect of disable_irq int order to
balance the IRQ disable-depth value.

Fixes: be6b0c1bd0be ("usb: chipidea: using one inline function to cover queue work operations")
Signed-off-by: Loic Poulain &lt;loic.poulain@linaro.org&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: properly handle host or gadget initialization failure</title>
<updated>2018-04-13T17:50:07+00:00</updated>
<author>
<name>Jisheng Zhang</name>
<email>jszhang@marvell.com</email>
</author>
<published>2017-04-26T08:59:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=10b7c3b33c02257b574f8f00df4b1e4a722fd630'/>
<id>urn:sha1:10b7c3b33c02257b574f8f00df4b1e4a722fd630</id>
<content type='text'>
[ Upstream commit c4a0bbbdb7f6e3c37fa6deb3ef28c5ed99da6175 ]

If ci_hdrc_host_init() or ci_hdrc_gadget_init() returns error and the
error != -ENXIO, as Peter pointed out, "it stands for initialization
for host or gadget has failed", so we'd better return failure rather
continue.

And before destroying the otg, i.e ci_hdrc_otg_destroy(ci), we should
also check ci-&gt;roles[CI_ROLE_GADGET].

Signed-off-by: Jisheng Zhang &lt;jszhang@marvell.com&gt;
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: vbus event may exist before starting gadget</title>
<updated>2017-10-08T08:14:18+00:00</updated>
<author>
<name>Peter Chen</name>
<email>peter.chen@nxp.com</email>
</author>
<published>2016-10-19T07:32:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7b8c9e6e0fca80c0da2ab94b5b1f96841f0c9be4'/>
<id>urn:sha1:7b8c9e6e0fca80c0da2ab94b5b1f96841f0c9be4</id>
<content type='text'>
[ Upstream commit c3b674a04b8ab62a1d35e86714d466af0a0ecc18 ]

At some situations, the vbus may already be there before starting
gadget. So we need to check vbus event after switching to gadget in
order to handle missing vbus event. The typical use cases are plugging
vbus cable before driver load or the vbus has already been there
after stopping host but before starting gadget.

Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Tested-by: Stephen Boyd &lt;stephen.boyd@linaro.org&gt;
Reported-by: Stephen Boyd &lt;stephen.boyd@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: chipidea: debug: check before accessing ci_role</title>
<updated>2017-06-14T11:16:22+00:00</updated>
<author>
<name>Michael Thalmeier</name>
<email>michael.thalmeier@hale.at</email>
</author>
<published>2017-05-18T14:14:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bd2e8f0a72c5608625f9501c07d446f9a48daf7e'/>
<id>urn:sha1:bd2e8f0a72c5608625f9501c07d446f9a48daf7e</id>
<content type='text'>
commit 0340ff83cd4475261e7474033a381bc125b45244 upstream.

ci_role BUGs when the role is &gt;= CI_ROLE_END.

Signed-off-by: Michael Thalmeier &lt;michael.thalmeier@hale.at&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>
<entry>
<title>usb: chipidea: udc: fix NULL pointer dereference if udc_start failed</title>
<updated>2017-06-14T11:16:22+00:00</updated>
<author>
<name>Jisheng Zhang</name>
<email>jszhang@marvell.com</email>
</author>
<published>2017-04-24T12:35:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=942dcb0ffa9d459af821167bd7cce94415e8278a'/>
<id>urn:sha1:942dcb0ffa9d459af821167bd7cce94415e8278a</id>
<content type='text'>
commit aa1f058d7d9244423b8c5a75b9484b1115df7f02 upstream.

Fix below NULL pointer dereference. we set ci-&gt;roles[CI_ROLE_GADGET]
too early in ci_hdrc_gadget_init(), if udc_start() fails due to some
reason, the ci-&gt;roles[CI_ROLE_GADGET] check in  ci_hdrc_gadget_destroy
can't protect us.

We fix this issue by only setting ci-&gt;roles[CI_ROLE_GADGET] if
udc_start() succeed.

[    1.398550] Unable to handle kernel NULL pointer dereference at
virtual address 00000000
...
[    1.448600] PC is at dma_pool_free+0xb8/0xf0
[    1.453012] LR is at dma_pool_free+0x28/0xf0
[    2.113369] [&lt;ffffff80081817d8&gt;] dma_pool_free+0xb8/0xf0
[    2.118857] [&lt;ffffff800841209c&gt;] destroy_eps+0x4c/0x68
[    2.124165] [&lt;ffffff8008413770&gt;] ci_hdrc_gadget_destroy+0x28/0x50
[    2.130461] [&lt;ffffff800840fa30&gt;] ci_hdrc_probe+0x588/0x7e8
[    2.136129] [&lt;ffffff8008380fb8&gt;] platform_drv_probe+0x50/0xb8
[    2.142066] [&lt;ffffff800837f494&gt;] driver_probe_device+0x1fc/0x2a8
[    2.148270] [&lt;ffffff800837f68c&gt;] __device_attach_driver+0x9c/0xf8
[    2.154563] [&lt;ffffff800837d570&gt;] bus_for_each_drv+0x58/0x98
[    2.160317] [&lt;ffffff800837f174&gt;] __device_attach+0xc4/0x138
[    2.166072] [&lt;ffffff800837f738&gt;] device_initial_probe+0x10/0x18
[    2.172185] [&lt;ffffff800837e58c&gt;] bus_probe_device+0x94/0xa0
[    2.177940] [&lt;ffffff800837c560&gt;] device_add+0x3f0/0x560
[    2.183337] [&lt;ffffff8008380d20&gt;] platform_device_add+0x180/0x240
[    2.189541] [&lt;ffffff800840f0e8&gt;] ci_hdrc_add_device+0x440/0x4f8
[    2.195654] [&lt;ffffff8008414194&gt;] ci_hdrc_usb2_probe+0x13c/0x2d8
[    2.201769] [&lt;ffffff8008380fb8&gt;] platform_drv_probe+0x50/0xb8
[    2.207705] [&lt;ffffff800837f494&gt;] driver_probe_device+0x1fc/0x2a8
[    2.213910] [&lt;ffffff800837f5ec&gt;] __driver_attach+0xac/0xb0
[    2.219575] [&lt;ffffff800837d4b0&gt;] bus_for_each_dev+0x60/0xa0
[    2.225329] [&lt;ffffff800837ec80&gt;] driver_attach+0x20/0x28
[    2.230816] [&lt;ffffff800837e880&gt;] bus_add_driver+0x1d0/0x238
[    2.236571] [&lt;ffffff800837fdb0&gt;] driver_register+0x60/0xf8
[    2.242237] [&lt;ffffff8008380ef4&gt;] __platform_driver_register+0x44/0x50
[    2.248891] [&lt;ffffff80086fd440&gt;] ci_hdrc_usb2_driver_init+0x18/0x20
[    2.255365] [&lt;ffffff8008082950&gt;] do_one_initcall+0x38/0x128
[    2.261121] [&lt;ffffff80086e0d00&gt;] kernel_init_freeable+0x1ac/0x250
[    2.267414] [&lt;ffffff800852f0b8&gt;] kernel_init+0x10/0x100
[    2.272810] [&lt;ffffff8008082680&gt;] ret_from_fork+0x10/0x50

Fixes: 3f124d233e97 ("usb: chipidea: add role init and destroy APIs")
Signed-off-by: Jisheng Zhang &lt;jszhang@marvell.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>
