All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabian Melzow <fabian.melzow@gmail.com>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 1
Date: Tue, 30 Jun 2020 18:58:03 +0200	[thread overview]
Message-ID: <20200630185803.2a72c123@ping> (raw)
In-Reply-To: <264e8287-b538-0798-36a6-7eafc4387a8d@linux.intel.com>

Hi!

Am Mon, 29 Jun 2020 20:47:24 +0300
schrieb Mathias Nyman <mathias.nyman@linux.intel.com>:

> First issue I see is that the attempt to recover from a transaction
> error with a soft retry isn't working. We expect the hardware to
> retry the transfer but nothing seems to happen. Soft retry is
> described in xhci specs 4.6.8.1 and is basically a reset endpoint
> command with TSP set, followed by ringing the endpoint doorbell.
> Traces indicate driver does this correctly but hardware isn't
> retrying. We get don't get any event, no error, success or stall.
> 
> This could be hardware flaw.
> Any chance you could try this on a xHC from some other vendor?

There is no other xHC hardware available to me.

> Second issue is a driver flaw, when nothing happened for 20 seconds
> we see the URB is canceled. xhci driver needs to stop then endpoint
> to cancel the URB, but there is a hw race and endpoint ends up halted
> instead of stopped. The xhci driver can't handle a halted endpoint in
> its stop endpoint handler properly, and the URB is never actually
> removed from the ring.
> 
> The reason you see the IO_PAGE_FAULT is probably because once the
> ring starts running the driver will handle the cancelled URB, and
> touch already freed memory: AMD-Vi: Event logged [IO_PAGE_FAULT
> domain=0x000d address=0xdc707028 flags=0x0020]
> 
> I have a patch for this second case, I haven't upstreamed it as it
> got some conflicting feedback earlier. It won't solve the 20 second
> delay, but should solve the the IO_PAGE_FAULT and the "WARN Set TR
> Deq Ptr cmd failed due to incorrect slot or ep state" message
> 
> Can you try it out?

I successful applied the patch against Linux 5.7.4, but get this error when
compiling drivers/usb/host/xhci-ring.c:

  CC [M]  drivers/usb/host/xhci-ring.o
drivers/usb/host/xhci-ring.c: In function ‘xhci_handle_cmd_stop_ep’:
drivers/usb/host/xhci-ring.c:857:3: error: implicit declaration of function ‘xhci_reset_halted_ep’ [-Werror=implicit-function-declaration]
  857 |   xhci_reset_halted_ep(xhci, slot_id, ep_index, reset_type);
      |   ^~~~~~~~~~~~~~~~~~~~


Fabian

  parent reply	other threads:[~2020-06-30 16:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20 19:19 ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 1 Fabian Melzow
2020-06-29 17:47 ` Mathias Nyman
2020-06-30 10:40   ` [PATCH] xhci: fix halted endpoint at stop endpoint command completion kernel test robot
2020-06-30 10:40     ` kernel test robot
2020-06-30 16:58   ` Fabian Melzow [this message]
2020-06-30 19:03     ` ERROR Transfer event TRB DMA ptr not part of current TD ep_index 4 comp_code 1 Mathias Nyman
2020-07-01  9:17       ` David Heinzelmann
2020-07-03 16:00         ` Mathias Nyman
2020-07-01 17:51       ` Fabian Melzow
2020-07-03 15:57         ` Mathias Nyman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200630185803.2a72c123@ping \
    --to=fabian.melzow@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.