Re: xhci_hcd WARN Event TRB for slot ep with no TDs queued?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 30.10.2017 23:14, Greg KH wrote:
On Mon, Oct 30, 2017 at 04:16:29PM +0100, Juan Simón wrote:
Hi,
I have read this thread
(https://marc.info/?l=linux-usb&m=150056183628924&w=2) and supposedly
the problem was solved in version 4.13.7 but in my case it's not like
that.

It's not solved in 4.13.7.
Yaroslav Isakov manually applied a test patch on top of 4.13.7
which solved the issue for him.

Same testpatch attached to this mail, and also pushed to my for-usb-linus
branch:

git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git for-usb-linus

Can you try if it helps in your case?

I use Arch Linux. I've tested several versions of kernel 4.13.x and
they all fail me. The kernels 4.12.x works well.
I have reported a bug in Arch Linux:
https://bugs.archlinux.org/task/56094 with all information that I have
known and believed to be important to the case.
The problem isn't only the continued warnings, but the mouse is as if
it continuously sends events to the system.

Any chance you can use 'git bisect' to find the patch that causes the
problem?


Bisect would be interesting, I wasn't aware it was working in 4.12 and
failed in 4.13

-Mathias

>From 8caafc429a111550c379b8cb217918335d54fb42 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
Date: Mon, 16 Oct 2017 14:06:08 +0300
Subject: [PATCH] xhci: Don't show incorrect WARN message about events for
 empty rings

xHC will generate events for short transfer both on the TRB that was
short, and for the last TRB in the TD. This means that for TDs with
several TRBs we can get two transfer events for the same TD.

The driver will handle the TD after the first short event, and remove
it from its internal list. Driver then incorrectly prints a warning
for the second event:

WARN Event TRB for slot x ep y with no TDs queued

Fix this by not printing a warning if we get a event on a empty list
if the previous event was a short event.

Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
---
 drivers/usb/host/xhci-ring.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index fb25c10..87158a9 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2485,12 +2485,17 @@ static int handle_tx_event(struct xhci_hcd *xhci,
 		 */
 		if (list_empty(&ep_ring->td_list)) {
 			/*
+			 * Don't print wanings in the following cases:
 			 * A stopped endpoint may generate an extra completion
-			 * event if the device was suspended.  Don't print
-			 * warnings.
+			 * event if the device was suspended. Or,
+			 * a second event for a TD is generated for the last
+			 * TRB if the previous event was a short event mid TD.
+			 * TD is alrady removed from list.
 			 */
+
 			if (!(trb_comp_code == COMP_STOPPED ||
-				trb_comp_code == COMP_STOPPED_LENGTH_INVALID)) {
+			      trb_comp_code == COMP_STOPPED_LENGTH_INVALID ||
+			      ep_ring->last_td_was_short)) {
 				xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n",
 						TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
 						ep_index);
-- 
2.7.4


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux