All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: "Michał Pecio" <michal.pecio@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [RFT PATCH v2] xhci: process isoc TD properly when there was an error mid TD.
Date: Fri, 19 Jan 2024 12:49:45 +0200	[thread overview]
Message-ID: <2c2d8711-3d2b-e943-a2a0-75637e725dc3@linux.intel.com> (raw)
In-Reply-To: <20240118231638.46c2fe1a@foxbook>

On 19.1.2024 0.16, Michał Pecio wrote:
> My usual set of tests passes:
> - no spam on disconnection from NEC
> - no stream lockup on random errors on NEC
> - no spam on disconnection from VIA
> - finish_td called with right frame->status on VIA
>    (checked by means of extra printks)
> 
>> +		/* Error mid TD, don't give TD back yet */
>> +		td->error_mid_td = true;
>> +		td->urb_length_set = true;
>> +
>> +		frame->actual_length = sum_trb_lengths(xhci, ep->ring, ep_trb) +
>> +			ep_trb_len - remaining;
> Not a problem with this patch, but I noticed that every single use of
> this function ends up adding ep_trb_len, maybe it could be inclusive.
> 
>> +		td->urb->actual_length += frame->actual_length;
> In your first email you mentioned hosts responding to every single TRB,
> perhaps with the same error code repeated each time?
> 
> I imagine it could be problematic here if such hosts really exist and
> if there are enough TRBs to execute this line twice. A check for the
> error_mid_td bit previously set could help, if this is a real risk.

Good point, refactored that code a bit and it now both looks nicer and should
solve this case.

One more patchround

Thanks
Mathias



  reply	other threads:[~2024-01-19 10:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 22:52 "Transfer event TRB DMA ptr not part of current TD" spam after USB disconnection Michał Pecio
2024-01-13 20:47 ` Michał Pecio
2024-01-14 14:06   ` Michał Pecio
2024-01-15 13:58     ` Mathias Nyman
2024-01-15 16:27       ` Michał Pecio
2024-01-16 15:36         ` [RFT PATCH] xhci: process isoc TD properly when there was an error mid TD Mathias Nyman
2024-01-16 22:20           ` Michał Pecio
2024-01-17 10:46             ` Mathias Nyman
2024-01-17 17:49               ` Michał Pecio
2024-01-18 11:00                 ` Isochronous error handling bug on VIA VL805 Michał Pecio
2024-01-18 11:10                   ` Michał Pecio
2024-01-18 13:54                   ` Mathias Nyman
2024-01-18 13:56                     ` [RFT PATCH v2] xhci: process isoc TD properly when there was an error mid TD Mathias Nyman
2024-01-18 22:16                       ` Michał Pecio
2024-01-19 10:49                         ` Mathias Nyman [this message]
2024-01-19 10:58                           ` [RTF PATCH v3] " Mathias Nyman
2024-01-19 21:54                             ` Michał Pecio
2024-01-22  9:03                               ` Michał Pecio
2024-01-22 13:37                                 ` Mathias Nyman
2024-01-22 17:10                                   ` Michał Pecio
2024-01-22 11:47                               ` 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=2c2d8711-3d2b-e943-a2a0-75637e725dc3@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=michal.pecio@gmail.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.