<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/usb/host, branch v4.15.11</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.15.11</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.15.11'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2018-03-19T08:09:46Z</updated>
<entry>
<title>xhci: fix endpoint context tracer output</title>
<updated>2018-03-19T08:09:46Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2018-03-08T15:17:14Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a0972dac11257efd04a134451e66ea4512b70e49'/>
<id>urn:sha1:a0972dac11257efd04a134451e66ea4512b70e49</id>
<content type='text'>
commit 97ef0faf575e03b352553f92c9430cb4c0431436 upstream.

Fix incorrent values showed for max Primary stream and
Linear stream array (LSA) values in the endpoint context
decoder.

Fixes: 19a7d0d65c4a ("usb: host: xhci: add Slot and EP Context tracers")
Cc: &lt;stable@vger.kernel.org&gt; # v4.12+
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xhci: Fix front USB ports on ASUS PRIME B350M-A</title>
<updated>2018-03-19T08:09:46Z</updated>
<author>
<name>Kai-Heng Feng</name>
<email>kai.heng.feng@canonical.com</email>
</author>
<published>2018-03-08T15:17:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a0722d7b9d6744c4415f760762e3903801a8589b'/>
<id>urn:sha1:a0722d7b9d6744c4415f760762e3903801a8589b</id>
<content type='text'>
commit 191edc5e2e515aab1075a3f0ef23599e80be5f59 upstream.

When a USB device gets plugged on ASUS PRIME B350M-A's front ports, the
xHC stops working:
[  549.114587] xhci_hcd 0000:02:00.0: WARN: xHC CMD_RUN timeout
[  549.114608] suspend_common(): xhci_pci_suspend+0x0/0xc0 returns -110
[  549.114638] xhci_hcd 0000:02:00.0: can't suspend (hcd_pci_runtime_suspend returned -110)

Delay before running xHC command CMD_RUN can workaround the issue.

Use a new quirk to make the delay only targets to the affected xHC.

Signed-off-by: Kai-Heng Feng &lt;kai.heng.feng@canonical.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: host: xhci-rcar: add support for r8a77965</title>
<updated>2018-03-19T08:09:46Z</updated>
<author>
<name>Yoshihiro Shimoda</name>
<email>yoshihiro.shimoda.uh@renesas.com</email>
</author>
<published>2018-02-27T08:15:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=73848b68f99bf8fcd1e6b74ce66d9fd56cfd52a1'/>
<id>urn:sha1:73848b68f99bf8fcd1e6b74ce66d9fd56cfd52a1</id>
<content type='text'>
commit 015dbeb2282030bf56762e21d25f09422edfd750 upstream.

This patch adds support for r8a77965 (R-Car M3-N).

Signed-off-by: Yoshihiro Shimoda &lt;yoshihiro.shimoda.uh@renesas.com&gt;
Reviewed-by: Simon Horman &lt;horms+renesas@verge.net.au&gt;
Reviewed-by: Rob Herring &lt;robh@kernel.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: host: ehci: use correct device pointer for dma ops</title>
<updated>2018-02-28T09:21:36Z</updated>
<author>
<name>Peter Chen</name>
<email>hzpeterchen@gmail.com</email>
</author>
<published>2018-02-01T04:26:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c1ee06ccaf562a6a628415205f93e3e7d61e7543'/>
<id>urn:sha1:c1ee06ccaf562a6a628415205f93e3e7d61e7543</id>
<content type='text'>
commit 02a10f061a3f8bca1b37332672f50a107198adbe upstream.

commit a8c06e407ef9 ("usb: separate out sysdev pointer from usb_bus")
converted to use hcd-&gt;self.sysdev for DMA operations instead of
hcd-&gt;self.controller, but forgot to do it for hcd test mode. Replace
the correct one in this commit.

Fixes: a8c06e407ef9 ("usb: separate out sysdev pointer from usb_bus")
Signed-off-by: Peter Chen &lt;peter.chen@nxp.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>usb: ohci: Proper handling of ed_rm_list to handle race condition between usb_kill_urb() and finish_unlinks()</title>
<updated>2018-02-28T09:21:36Z</updated>
<author>
<name>AMAN DEEP</name>
<email>aman.deep@samsung.com</email>
</author>
<published>2018-02-08T03:55:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4834cd5ef556070f23b7bc3de240a5cba7efadf9'/>
<id>urn:sha1:4834cd5ef556070f23b7bc3de240a5cba7efadf9</id>
<content type='text'>
commit 46408ea558df13b110e0866b99624384a33bdeba upstream.

There is a race condition between finish_unlinks-&gt;finish_urb() function
and usb_kill_urb() in ohci controller case. The finish_urb calls
spin_unlock(&amp;ohci-&gt;lock) before usb_hcd_giveback_urb() function call,
then if during this time, usb_kill_urb is called for another endpoint,
then new ed will be added to ed_rm_list at beginning for unlink, and
ed_rm_list will point to newly added.

When finish_urb() is completed in finish_unlinks() and ed-&gt;td_list
becomes empty as in below code (in finish_unlinks() function):

        if (list_empty(&amp;ed-&gt;td_list)) {
                *last = ed-&gt;ed_next;
                ed-&gt;ed_next = NULL;
        } else if (ohci-&gt;rh_state == OHCI_RH_RUNNING) {
                *last = ed-&gt;ed_next;
                ed-&gt;ed_next = NULL;
                ed_schedule(ohci, ed);
        }

The *last = ed-&gt;ed_next will make ed_rm_list to point to ed-&gt;ed_next
and previously added ed by usb_kill_urb will be left unreferenced by
ed_rm_list. This causes usb_kill_urb() hang forever waiting for
finish_unlink to remove added ed from ed_rm_list.

The main reason for hang in this race condtion is addition and removal
of ed from ed_rm_list in the beginning during usb_kill_urb and later
last* is modified in finish_unlinks().

As suggested by Alan Stern, the solution for proper handling of
ohci-&gt;ed_rm_list is to remove ed from the ed_rm_list before finishing
any URBs. Then at the end, we can add ed back to the list if necessary.

This properly handle the updated ohci-&gt;ed_rm_list in usb_kill_urb().

Fixes: 977dcfdc6031 ("USB: OHCI: don't lose track of EDs when a controller dies")
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
CC: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Aman Deep &lt;aman.deep@samsung.com&gt;
Signed-off-by: Jeffy Chen &lt;jeffy.chen@rock-chips.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>ohci-hcd: Fix race condition caused by ohci_urb_enqueue() and io_watchdog_func()</title>
<updated>2018-02-28T09:21:35Z</updated>
<author>
<name>Shigeru Yoshida</name>
<email>shigeru.yoshida@windriver.com</email>
</author>
<published>2018-02-02T05:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f2b3914d480f92721c919f888ba0c122d275f30'/>
<id>urn:sha1:4f2b3914d480f92721c919f888ba0c122d275f30</id>
<content type='text'>
commit b2685bdacdaab065c172b97b55ab46c6be77a037 upstream.

Running io_watchdog_func() while ohci_urb_enqueue() is running can
cause a race condition where ohci-&gt;prev_frame_no is corrupted and the
watchdog can mis-detect following error:

  ohci-platform 664a0800.usb: frame counter not updating; disabled
  ohci-platform 664a0800.usb: HC died; cleaning up

Specifically, following scenario causes a race condition:

  1. ohci_urb_enqueue() calls spin_lock_irqsave(&amp;ohci-&gt;lock, flags)
     and enters the critical section
  2. ohci_urb_enqueue() calls timer_pending(&amp;ohci-&gt;io_watchdog) and it
     returns false
  3. ohci_urb_enqueue() sets ohci-&gt;prev_frame_no to a frame number
     read by ohci_frame_no(ohci)
  4. ohci_urb_enqueue() schedules io_watchdog_func() with mod_timer()
  5. ohci_urb_enqueue() calls spin_unlock_irqrestore(&amp;ohci-&gt;lock,
     flags) and exits the critical section
  6. Later, ohci_urb_enqueue() is called
  7. ohci_urb_enqueue() calls spin_lock_irqsave(&amp;ohci-&gt;lock, flags)
     and enters the critical section
  8. The timer scheduled on step 4 expires and io_watchdog_func() runs
  9. io_watchdog_func() calls spin_lock_irqsave(&amp;ohci-&gt;lock, flags)
     and waits on it because ohci_urb_enqueue() is already in the
     critical section on step 7
 10. ohci_urb_enqueue() calls timer_pending(&amp;ohci-&gt;io_watchdog) and it
     returns false
 11. ohci_urb_enqueue() sets ohci-&gt;prev_frame_no to new frame number
     read by ohci_frame_no(ohci) because the frame number proceeded
     between step 3 and 6
 12. ohci_urb_enqueue() schedules io_watchdog_func() with mod_timer()
 13. ohci_urb_enqueue() calls spin_unlock_irqrestore(&amp;ohci-&gt;lock,
     flags) and exits the critical section, then wake up
     io_watchdog_func() which is waiting on step 9
 14. io_watchdog_func() enters the critical section
 15. io_watchdog_func() calls ohci_frame_no(ohci) and set frame_no
     variable to the frame number
 16. io_watchdog_func() compares frame_no and ohci-&gt;prev_frame_no

On step 16, because this calling of io_watchdog_func() is scheduled on
step 4, the frame number set in ohci-&gt;prev_frame_no is expected to the
number set on step 3.  However, ohci-&gt;prev_frame_no is overwritten on
step 11.  Because step 16 is executed soon after step 11, the frame
number might not proceed, so ohci-&gt;prev_frame_no must equals to
frame_no.

To address above scenario, this patch introduces a special sentinel
value IO_WATCHDOG_OFF and set this value to ohci-&gt;prev_frame_no when
the watchdog is not pending or running.  When ohci_urb_enqueue()
schedules the watchdog (step 4 and 12 above), it compares
ohci-&gt;prev_frame_no to IO_WATCHDOG_OFF so that ohci-&gt;prev_frame_no is
not overwritten while io_watchdog_func() is running.

Signed-off-by: Shigeru Yoshida &lt;Shigeru.Yoshida@windriver.com&gt;
Signed-off-by: Haiqing Bai &lt;Haiqing.Bai@windriver.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xhci: fix xhci debugfs errors in xhci_stop</title>
<updated>2018-02-25T10:15:43Z</updated>
<author>
<name>Zhengjun Xing</name>
<email>zhengjun.xing@linux.intel.com</email>
</author>
<published>2018-02-12T12:24:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f0537b3962ad97c903fbe0067f974e98f6769206'/>
<id>urn:sha1:f0537b3962ad97c903fbe0067f974e98f6769206</id>
<content type='text'>
commit 11cd764dc9a030991880ad4d51db93918afa5822 upstream.

In function xhci_stop, xhci_debugfs_exit called before xhci_mem_cleanup.
xhci_debugfs_exit removed the xhci debugfs root nodes, xhci_mem_cleanup
called function xhci_free_virt_devices_depth_first which in turn called
function xhci_debugfs_remove_slot.
Function xhci_debugfs_remove_slot removed the nodes for devices, the nodes
folders are sub folder of xhci debugfs.

It is unreasonable to remove xhci debugfs root folder before
xhci debugfs sub folder. Function xhci_mem_cleanup should be called
before function xhci_debugfs_exit.

Fixes: 02b6fdc2a153 ("usb: xhci: Add debugfs interface for xHCI driver")
Cc: &lt;stable@vger.kernel.org&gt; # v4.15
Signed-off-by: Zhengjun Xing &lt;zhengjun.xing@linux.intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xhci: xhci debugfs device nodes weren't removed after device plugged out</title>
<updated>2018-02-25T10:15:43Z</updated>
<author>
<name>Zhengjun Xing</name>
<email>zhengjun.xing@linux.intel.com</email>
</author>
<published>2018-02-12T12:24:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=11474eb609f4a7469d85109347f74ee8972925fa'/>
<id>urn:sha1:11474eb609f4a7469d85109347f74ee8972925fa</id>
<content type='text'>
commit 8c5a93ebf7ac56d47f879b3c7c2f8c83b40c2cdb upstream.

There is a bug after plugged out USB device, the device and its ep00
nodes are still kept, we need to remove the nodes in xhci_free_dev when
USB device is plugged out.

Fixes: 052f71e25a7e ("xhci: Fix xhci debugfs NULL pointer dereference in resume from hibernate")
Cc: &lt;stable@vger.kernel.org&gt; # v4.15
Signed-off-by: Zhengjun Xing &lt;zhengjun.xing@linux.intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xhci: Fix xhci debugfs devices node disappearance after hibernation</title>
<updated>2018-02-25T10:15:43Z</updated>
<author>
<name>Zhengjun Xing</name>
<email>zhengjun.xing@linux.intel.com</email>
</author>
<published>2018-02-12T12:24:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=99cfcdcbfb385181a375207a61e3abc2e1428c29'/>
<id>urn:sha1:99cfcdcbfb385181a375207a61e3abc2e1428c29</id>
<content type='text'>
commit d91676717261578f429d3577dbe9154b26e8abf7 upstream.

During system resume from hibernation, xhci host is reset, all the
nodes in devices folder are removed in xhci_mem_cleanup function.
Later nodes in /sys/kernel/debug/usb/xhci/* are created again in
function xhci_run, but the nodes already exist, so the nodes still
keep the old ones, finally device nodes in xhci debugfs folder
/sys/kernel/debug/usb/xhci/*/devices/* are disappeared.

This fix removed xhci debugfs nodes before the nodes are re-created,
so all the nodes in xhci debugfs can be re-created successfully.

Fixes: 02b6fdc2a153 ("usb: xhci: Add debugfs interface for xHCI driver")
Cc: &lt;stable@vger.kernel.org&gt; # v4.15
Signed-off-by: Zhengjun Xing &lt;zhengjun.xing@linux.intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>xhci: Fix NULL pointer in xhci debugfs</title>
<updated>2018-02-25T10:15:43Z</updated>
<author>
<name>Zhengjun Xing</name>
<email>zhengjun.xing@linux.intel.com</email>
</author>
<published>2018-02-12T12:24:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=177b1a5bc8fee58e20b811eb1b226589e2c3991a'/>
<id>urn:sha1:177b1a5bc8fee58e20b811eb1b226589e2c3991a</id>
<content type='text'>
commit fa2dfd0ec22e0069c84dfae162972cbbc7c75488 upstream.

Commit dde634057da7 ("xhci: Fix use-after-free in xhci debugfs") causes a
null pointer dereference while fixing xhci-debugfs usage of ring pointers
that were freed during hibernate.

The fix passed addresses to ring pointers instead, but forgot to do this
change for the xhci_ring_trb_show function.

The address of the ring pointer passed to xhci-debugfs was of a temporary
ring pointer "new_ring" instead of the actual ring "ring" pointer. The
temporary new_ring pointer will be set to NULL later causing the NULL
pointer dereference.

This issue was seen when reading xhci related files in debugfs:

cat /sys/kernel/debug/usb/xhci/*/devices/*/ep*/trbs

[  184.604861] BUG: unable to handle kernel NULL pointer dereference at (null)
[  184.613776] IP: xhci_ring_trb_show+0x3a/0x890
[  184.618733] PGD 264193067 P4D 264193067 PUD 263238067 PMD 0
[  184.625184] Oops: 0000 [#1] SMP
[  184.726410] RIP: 0010:xhci_ring_trb_show+0x3a/0x890
[  184.731944] RSP: 0018:ffffba8243c0fd90 EFLAGS: 00010246
[  184.737880] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00000000000295d6
[  184.746020] RDX: 00000000000295d5 RSI: 0000000000000001 RDI: ffff971a6418d400
[  184.754121] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[  184.762222] R10: ffff971a64c98a80 R11: ffff971a62a00e40 R12: ffff971a62a85500
[  184.770325] R13: 0000000000020000 R14: ffff971a6418d400 R15: ffff971a6418d400
[  184.778448] FS:  00007fe725a79700(0000) GS:ffff971a6ec00000(0000) knlGS:0000000000000000
[  184.787644] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  184.794168] CR2: 0000000000000000 CR3: 000000025f365005 CR4: 00000000003606f0
[  184.802318] Call Trace:
[  184.805094]  ? seq_read+0x281/0x3b0
[  184.809068]  seq_read+0xeb/0x3b0
[  184.812735]  full_proxy_read+0x4d/0x70
[  184.817007]  __vfs_read+0x23/0x120
[  184.820870]  vfs_read+0x91/0x130
[  184.824538]  SyS_read+0x42/0x90
[  184.828106]  entry_SYSCALL_64_fastpath+0x1a/0x7d

Fixes: dde634057da7 ("xhci: Fix use-after-free in xhci debugfs")
Cc: &lt;stable@vger.kernel.org&gt; # v4.15
Signed-off-by: Zhengjun Xing &lt;zhengjun.xing@linux.intel.com&gt;
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
