<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/host, branch v5.7</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.7</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.7'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-05-14T11:44:37Z</updated>
<entry>
<title>usb: host: xhci-plat: keep runtime active when removing host</title>
<updated>2020-05-14T11:44:37Z</updated>
<author>
<name>Li Jun</name>
<email>jun.li@nxp.com</email>
</author>
<published>2020-05-14T11:04:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1449cb2c2253d37d998c3714aa9b95416d16d379'/>
<id>urn:sha1:1449cb2c2253d37d998c3714aa9b95416d16d379</id>
<content type='text'>
While removing the host (e.g. for USB role switch from host to device),
if runtime pm is enabled by user, below oops occurs on dwc3 and cdns3
platforms.
Keeping the xhci-plat device active during host removal, and disabling
runtime pm before calling pm_runtime_set_suspended() fixes them.

oops1:
Unable to handle kernel NULL pointer dereference at virtual address
0000000000000240
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 5 Comm: kworker/0:0 Not tainted 5.4.3-00107-g64d454a-dirty
Hardware name: FSL i.MX8MP EVK (DT)
Workqueue: pm pm_runtime_work
pstate: 60000005 (nZCv daif -PAN -UAO)
pc : xhci_suspend+0x34/0x698
lr : xhci_plat_runtime_suspend+0x2c/0x38
sp : ffff800011ddbbc0
Call trace:
 xhci_suspend+0x34/0x698
 xhci_plat_runtime_suspend+0x2c/0x38
 pm_generic_runtime_suspend+0x28/0x40
 __rpm_callback+0xd8/0x138
 rpm_callback+0x24/0x98
 rpm_suspend+0xe0/0x448
 rpm_idle+0x124/0x140
 pm_runtime_work+0xa0/0xf8
 process_one_work+0x1dc/0x370
 worker_thread+0x48/0x468
 kthread+0xf0/0x120
 ret_from_fork+0x10/0x1c

oops2:
usb 2-1: USB disconnect, device number 2
xhci-hcd xhci-hcd.1.auto: remove, state 4
usb usb2: USB disconnect, device number 1
xhci-hcd xhci-hcd.1.auto: USB bus 2 deregistered
xhci-hcd xhci-hcd.1.auto: remove, state 4
usb usb1: USB disconnect, device number 1
Unable to handle kernel NULL pointer dereference at virtual address
0000000000000138
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 7 Comm: kworker/u8:0 Not tainted 5.6.0-rc4-next-20200304-03578
Hardware name: Freescale i.MX8QXP MEK (DT)
Workqueue: 1-0050 tcpm_state_machine_work
pstate: 20000005 (nzCv daif -PAN -UAO)
pc : xhci_free_dev+0x214/0x270
lr : xhci_plat_runtime_resume+0x78/0x88
sp : ffff80001006b5b0
Call trace:
 xhci_free_dev+0x214/0x270
 xhci_plat_runtime_resume+0x78/0x88
 pm_generic_runtime_resume+0x30/0x48
 __rpm_callback+0x90/0x148
 rpm_callback+0x28/0x88
 rpm_resume+0x568/0x758
 rpm_resume+0x260/0x758
 rpm_resume+0x260/0x758
 __pm_runtime_resume+0x40/0x88
 device_release_driver_internal+0xa0/0x1c8
 device_release_driver+0x1c/0x28
 bus_remove_device+0xd4/0x158
 device_del+0x15c/0x3a0
 usb_disable_device+0xb0/0x268
 usb_disconnect+0xcc/0x300
 usb_remove_hcd+0xf4/0x1dc
 xhci_plat_remove+0x78/0xe0
 platform_drv_remove+0x30/0x50
 device_release_driver_internal+0xfc/0x1c8
 device_release_driver+0x1c/0x28
 bus_remove_device+0xd4/0x158
 device_del+0x15c/0x3a0
 platform_device_del.part.0+0x20/0x90
 platform_device_unregister+0x28/0x40
 cdns3_host_exit+0x20/0x40
 cdns3_role_stop+0x60/0x90
 cdns3_role_set+0x64/0xd8
 usb_role_switch_set_role.part.0+0x3c/0x68
 usb_role_switch_set_role+0x20/0x30
 tcpm_mux_set+0x60/0xf8
 tcpm_reset_port+0xa4/0xf0
 tcpm_detach.part.0+0x28/0x50
 tcpm_state_machine_work+0x12ac/0x2360
 process_one_work+0x1c8/0x470
 worker_thread+0x50/0x428
 kthread+0xfc/0x128
 ret_from_fork+0x10/0x18
Code: c8037c02 35ffffa3 17ffe7c3 f9800011 (c85f7c01)
---[ end trace 45b1a173d2679e44 ]---

[minor commit message cleanup  -Mathias]
Cc: Baolin Wang &lt;baolin.wang@linaro.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Fixes: b0c69b4bace3 ("usb: host: plat: Enable xHCI plat runtime PM")
Reviewed-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Tested-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Signed-off-by: Li Jun &lt;jun.li@nxp.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200514110432.25564-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: xhci: Fix NULL pointer dereference when enqueuing trbs from urb sg list</title>
<updated>2020-05-14T11:44:37Z</updated>
<author>
<name>Sriharsha Allenki</name>
<email>sallenki@codeaurora.org</email>
</author>
<published>2020-05-14T11:04:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3c6f8cb92c9178fc0c66b580ea3df1fa3ac1155a'/>
<id>urn:sha1:3c6f8cb92c9178fc0c66b580ea3df1fa3ac1155a</id>
<content type='text'>
On platforms with IOMMU enabled, multiple SGs can be coalesced into one
by the IOMMU driver. In that case the SG list processing as part of the
completion of a urb on a bulk endpoint can result into a NULL pointer
dereference with the below stack dump.

&lt;6&gt; Unable to handle kernel NULL pointer dereference at virtual address 0000000c
&lt;6&gt; pgd = c0004000
&lt;6&gt; [0000000c] *pgd=00000000
&lt;6&gt; Internal error: Oops: 5 [#1] PREEMPT SMP ARM
&lt;2&gt; PC is at xhci_queue_bulk_tx+0x454/0x80c
&lt;2&gt; LR is at xhci_queue_bulk_tx+0x44c/0x80c
&lt;2&gt; pc : [&lt;c08907c4&gt;]    lr : [&lt;c08907bc&gt;]    psr: 000000d3
&lt;2&gt; sp : ca337c80  ip : 00000000  fp : ffffffff
&lt;2&gt; r10: 00000000  r9 : 50037000  r8 : 00004000
&lt;2&gt; r7 : 00000000  r6 : 00004000  r5 : 00000000  r4 : 00000000
&lt;2&gt; r3 : 00000000  r2 : 00000082  r1 : c2c1a200  r0 : 00000000
&lt;2&gt; Flags: nzcv  IRQs off  FIQs off  Mode SVC_32  ISA ARM  Segment none
&lt;2&gt; Control: 10c0383d  Table: b412c06a  DAC: 00000051
&lt;6&gt; Process usb-storage (pid: 5961, stack limit = 0xca336210)
&lt;snip&gt;
&lt;2&gt; [&lt;c08907c4&gt;] (xhci_queue_bulk_tx)
&lt;2&gt; [&lt;c0881b3c&gt;] (xhci_urb_enqueue)
&lt;2&gt; [&lt;c0831068&gt;] (usb_hcd_submit_urb)
&lt;2&gt; [&lt;c08350b4&gt;] (usb_sg_wait)
&lt;2&gt; [&lt;c089f384&gt;] (usb_stor_bulk_transfer_sglist)
&lt;2&gt; [&lt;c089f2c0&gt;] (usb_stor_bulk_srb)
&lt;2&gt; [&lt;c089fe38&gt;] (usb_stor_Bulk_transport)
&lt;2&gt; [&lt;c089f468&gt;] (usb_stor_invoke_transport)
&lt;2&gt; [&lt;c08a11b4&gt;] (usb_stor_control_thread)
&lt;2&gt; [&lt;c014a534&gt;] (kthread)

The above NULL pointer dereference is the result of block_len and the
sent_len set to zero after the first SG of the list when IOMMU driver
is enabled. Because of this the loop of processing the SGs has run
more than num_sgs which resulted in a sg_next on the last SG of the
list which has SG_END set.

Fix this by check for the sg before any attributes of the sg are
accessed.

[modified reason for null pointer dereference in commit message subject -Mathias]
Fixes: f9c589e142d04 ("xhci: TD-fragment, align the unsplittable case with a bounce buffer")
Cc: stable@vger.kernel.org
Signed-off-by: Sriharsha Allenki &lt;sallenki@codeaurora.org&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200514110432.25564-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: Don't clear hub TT buffer on ep0 protocol stall</title>
<updated>2020-04-21T14:27:38Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2020-04-21T14:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8f97250c21f0cf36434bf5b7ddf4377406534cd1'/>
<id>urn:sha1:8f97250c21f0cf36434bf5b7ddf4377406534cd1</id>
<content type='text'>
The default control endpoint ep0 can return a STALL indicating the
device does not support the control transfer requests. This is called
a protocol stall and does not halt the endpoint.

xHC behaves a bit different. Its internal endpoint state will always
be halted on any stall, even if the device side of the endpiont is not
halted. So we do need to issue the reset endpoint command to clear the
xHC host intenal endpoint halt state, but should not request the HS hub
to clear the TT buffer unless device side of endpoint is halted.

Clearing the hub TT buffer at protocol stall caused ep0 to become
unresponsive for some FS/LS devices behind HS hubs, and class drivers
failed to set the interface due to timeout:

usb 1-2.1: 1:1: usb_set_interface failed (-110)

Fixes: ef513be0a905 ("usb: xhci: Add Clear_TT_Buffer")
Cc: &lt;stable@vger.kernel.org&gt; # v5.3
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200421140822.28233-4-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: prevent bus suspend if a roothub port detected a over-current condition</title>
<updated>2020-04-21T14:27:38Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2020-04-21T14:08:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e9fb08d617bfae5471d902112667d0eeb9dee3c4'/>
<id>urn:sha1:e9fb08d617bfae5471d902112667d0eeb9dee3c4</id>
<content type='text'>
Suspending the bus and host controller while a port is in a over-current
condition may halt the host.
Also keep the roothub running if over-current is active.

Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200421140822.28233-3-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>xhci: Fix handling halted endpoint even if endpoint ring appears empty</title>
<updated>2020-04-21T14:27:38Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2020-04-21T14:08:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=93ceaa808e8defc67ebca1396e2f42f812a2efc0'/>
<id>urn:sha1:93ceaa808e8defc67ebca1396e2f42f812a2efc0</id>
<content type='text'>
If a class driver cancels its only URB then the endpoint ring buffer will
appear empty to the xhci driver. xHC hardware may still process cached
TRBs, and complete with a STALL, halting the endpoint.

This halted endpoint was not handled correctly by xhci driver as events on
empty rings were all assumed to be spurious events.
xhci driver refused to restart the ring with EP_HALTED flag set, so class
driver was never informed the endpoint halted even if it queued new URBs.

The host side of the endpoint needs to be reset, and dequeue pointer should
be moved in order to clear the cached TRBs and resetart the endpoint.

Small adjustments in finding the new dequeue pointer are needed to support
the case of stall on an empty ring and unknown current TD.

Cc: &lt;stable@vger.kernel.org&gt;
cc: Jeremy Compostella &lt;jeremy.compostella@intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200421140822.28233-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: host: hisilicon: convert to devm_platform_get_and_ioremap_resource</title>
<updated>2020-03-24T11:09:39Z</updated>
<author>
<name>Dejin Zheng</name>
<email>zhengdejin5@gmail.com</email>
</author>
<published>2020-03-23T16:06:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=558963c498337526463d60119129fa90b45c7710'/>
<id>urn:sha1:558963c498337526463d60119129fa90b45c7710</id>
<content type='text'>
Use devm_platform_get_and_ioremap_resource() to simplify code, which
contains platform_get_resource() and devm_ioremap_resource(), it also
get the resource for use by the following code.

Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Acked-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Dejin Zheng &lt;zhengdejin5@gmail.com&gt;
Link: https://lore.kernel.org/r/20200323160612.17277-4-zhengdejin5@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: host: xhci-plat: convert to devm_platform_get_and_ioremap_resource</title>
<updated>2020-03-24T11:09:39Z</updated>
<author>
<name>Dejin Zheng</name>
<email>zhengdejin5@gmail.com</email>
</author>
<published>2020-03-23T16:06:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fb222273a2159aafc81f64bb794f22aa54b04acb'/>
<id>urn:sha1:fb222273a2159aafc81f64bb794f22aa54b04acb</id>
<content type='text'>
Use devm_platform_get_and_ioremap_resource() to simplify code, which
contains platform_get_resource() and devm_ioremap_resource(), it also
get the resource for use by the following code.

Reviewed-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Acked-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Dejin Zheng &lt;zhengdejin5@gmail.com&gt;
Link: https://lore.kernel.org/r/20200323160612.17277-3-zhengdejin5@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<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.shady.money/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: xhci-tegra: Add OTG support</title>
<updated>2020-03-19T13:18:57Z</updated>
<author>
<name>Nagarjuna Kristam</name>
<email>nkristam@nvidia.com</email>
</author>
<published>2020-02-10T08:11:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f836e7843036fbf34320356e156cd4267fa5bfa2'/>
<id>urn:sha1:f836e7843036fbf34320356e156cd4267fa5bfa2</id>
<content type='text'>
Get usb-phy's for availbale USB 2 phys. Register id notifiers for available
usb-phy's to receive role change notifications. Perform PP for the received
role change usb ports.

Signed-off-by: Nagarjuna Kristam &lt;nkristam@nvidia.com&gt;
[treding@nvidia.com: rebase onto Greg's usb-next branch]
Signed-off-by: Thierry Reding &lt;treding@nvidia.com&gt;
</content>
</entry>
<entry>
<title>xhci-pci: Allow host runtime PM as default for Intel Tiger Lake xHCI</title>
<updated>2020-03-12T16:34:49Z</updated>
<author>
<name>Mika Westerberg</name>
<email>mika.westerberg@linux.intel.com</email>
</author>
<published>2020-03-12T14:45:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a7c533d4a1854f54901a065d8c672e890400d8a'/>
<id>urn:sha1:6a7c533d4a1854f54901a065d8c672e890400d8a</id>
<content type='text'>
In the same way as Intel Ice Lake TCSS (Type-C Subsystem) the Tiger Lake
TCSS xHCI needs to be runtime suspended whenever possible to allow the
TCSS hardware block to enter D3cold and thus save energy.

Signed-off-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20200312144517.1593-10-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
