All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, Krzysztof Kozlowski <krzk@kernel.org>,
	'Linux Samsung SOC' <linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH 1/4] usb: xhci: add Immediate Data Transfer support
Date: Fri, 10 May 2019 09:11:45 +0300	[thread overview]
Message-ID: <df66c9dd-85b2-84fc-6543-a6eb031fc7fc@linux.intel.com> (raw)
In-Reply-To: <4ab79c485f568cc081aa24f35b318bdafc0c4c06.camel@suse.de>

On 9.5.2019 18.38, Nicolas Saenz Julienne wrote:
> Hi Mathias, thanks for spending the time debugging this :)
> 
> On Thu, 2019-05-09 at 18:10 +0300, Mathias Nyman wrote:
>> Got the logs off list, thanks
>>
>> The "Buffer" data in Control transfer Data stage look suspicious.
>>
>> First guess would be that in case URB has URB_NO_TRANSFER_DMA_MAP set then
>> data
>> will be mapped and urb->transfer_dma is already set.
>> The IDT patch uses urb->trabfer_dma as a temporary buffer, and copies the
>> urb->transfer_buffer there.
>> if transfer buffer is already dma mapped the urb->transfer_buffer can be
>> garbage,
>> (shouldn't, but it can be)
> 
> This could be it, I broadly checked and assumed everyone was playing nice with
> the transfer_dma pointer, but I guess I might have missed something.
> 
>> If that doesn't help, then it's possible DATA trbs in control transfer can't
>> use IDT at all. IDT is supported for Normal TRBs, which have a different trb
>> type than DATA trbs in control transfers.
>>
>> Also xhci specs 4.11.7 limit IDT usage:
>>
>> "If the IDT flag is set in one TRB of a TD, then it shall be the only Transfer
>>    TRB of the TD"
>>
>> A whole control transfer is one TD, and it already contains a SETUP transfer
>> TRB
>> which is using the IDT flag.
> 
> This one I'm not so sure as the standard defines a control transfer as a 2 or 3
> TD operation (see 4.11.2.2):
> 
> "The Control Transfer Ring may contain Setup Stage and Status Stage TDs, and
> optionally Data Stage TDs."

True, xhci driver treats a control transfer as one TD, but TRBs aren't chained so
from hw point of view they are separate TDs

> 
> Also, for what is worth, I spent some time testing that specific case on my
> intel laptop while preparing the patch.

And a closer look at the spec shows that both Normal and Data Stage TRB support
IDT. So this is not likely the cause.

-Mathias

  reply	other threads:[~2019-05-10  6:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26 13:23 [PATCH 0/4] xhci features for usb-next Mathias Nyman
     [not found] ` <CGME20190509103220eucas1p1330f2827916b55e05b1b791504963630@eucas1p1.samsung.com>
2019-04-26 13:23   ` [1/4] usb: xhci: add Immediate Data Transfer support Mathias Nyman
2019-04-26 13:23     ` [PATCH 1/4] " Mathias Nyman
2019-05-09 10:32     ` Marek Szyprowski
2019-05-09 11:40       ` Mathias Nyman
2019-05-09 11:51         ` Nicolas Saenz Julienne
2019-05-09 15:10           ` Mathias Nyman
2019-05-09 15:38             ` Nicolas Saenz Julienne
2019-05-10  6:11               ` Mathias Nyman [this message]
2019-05-10  6:28             ` Marek Szyprowski
2019-05-10  7:30               ` Mathias Nyman
  -- strict thread matches above, loose matches on Subject: below --
2019-04-26 13:23 [3/4] xhci: Add tracing for input control context Mathias Nyman
2019-04-26 13:23 ` [PATCH 3/4] " Mathias Nyman
2019-04-26 13:23 [4/4] usb: xhci: add endpoint context tracing when an endpoint is added Mathias Nyman
2019-04-26 13:23 ` [PATCH 4/4] " 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=df66c9dd-85b2-84fc-6543-a6eb031fc7fc@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk@kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=nsaenzjulienne@suse.de \
    /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.