* FAILED: patch "[PATCH] xhci: handle isoc Babble and Buffer Overrun events properly" failed to apply to 5.10-stable tree
@ 2024-02-13 13:22 gregkh
2024-02-13 13:39 ` Michał Pecio
0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2024-02-13 13:22 UTC (permalink / raw)
To: michal.pecio, gregkh, mathias.nyman; +Cc: stable
The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 7c4650ded49e5b88929ecbbb631efb8b0838e811
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2024021308-hardness-undercook-6840@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
7c4650ded49e ("xhci: handle isoc Babble and Buffer Overrun events properly")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 7c4650ded49e5b88929ecbbb631efb8b0838e811 Mon Sep 17 00:00:00 2001
From: Michal Pecio <michal.pecio@gmail.com>
Date: Thu, 25 Jan 2024 17:27:37 +0200
Subject: [PATCH] xhci: handle isoc Babble and Buffer Overrun events properly
xHCI 4.9 explicitly forbids assuming that the xHC has released its
ownership of a multi-TRB TD when it reports an error on one of the
early TRBs. Yet the driver makes such assumption and releases the TD,
allowing the remaining TRBs to be freed or overwritten by new TDs.
The xHC should also report completion of the final TRB due to its IOC
flag being set by us, regardless of prior errors. This event cannot
be recognized if the TD has already been freed earlier, resulting in
"Transfer event TRB DMA ptr not part of current TD" error message.
Fix this by reusing the logic for processing isoc Transaction Errors.
This also handles hosts which fail to report the final completion.
Fix transfer length reporting on Babble errors. They may be caused by
device malfunction, no guarantee that the buffer has been filled.
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20240125152737.2983959-5-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 41be7d31a36e..f0d8a607ff21 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2394,9 +2394,13 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_virt_ep *ep,
case COMP_BANDWIDTH_OVERRUN_ERROR:
frame->status = -ECOMM;
break;
- case COMP_ISOCH_BUFFER_OVERRUN:
case COMP_BABBLE_DETECTED_ERROR:
+ sum_trbs_for_length = true;
+ fallthrough;
+ case COMP_ISOCH_BUFFER_OVERRUN:
frame->status = -EOVERFLOW;
+ if (ep_trb != td->last_trb)
+ td->error_mid_td = true;
break;
case COMP_INCOMPATIBLE_DEVICE_ERROR:
case COMP_STALL_ERROR:
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] xhci: handle isoc Babble and Buffer Overrun events properly" failed to apply to 5.10-stable tree
2024-02-13 13:22 FAILED: patch "[PATCH] xhci: handle isoc Babble and Buffer Overrun events properly" failed to apply to 5.10-stable tree gregkh
@ 2024-02-13 13:39 ` Michał Pecio
2024-02-13 14:17 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Michał Pecio @ 2024-02-13 13:39 UTC (permalink / raw)
To: gregkh; +Cc: mathias.nyman, stable
Hi,
> The patch below does not apply to the 5.10-stable tree.
> [...]
> From 7c4650ded49e5b88929ecbbb631efb8b0838e811 Mon Sep 17 00:00:00 2001
> From: Michal Pecio <michal.pecio@gmail.com>
> Date: Thu, 25 Jan 2024 17:27:37 +0200
> Subject: [PATCH] xhci: handle isoc Babble and Buffer Overrun events
This patch depends on its parent 5372c65e1311 ("xhci: process isoc TD
properly when there was a transaction error mid TD.").
The parent commit appears to be missing from your 5.10 and earlier
queues for some reason, hence the breakage.
Regards,
Michal
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] xhci: handle isoc Babble and Buffer Overrun events properly" failed to apply to 5.10-stable tree
2024-02-13 13:39 ` Michał Pecio
@ 2024-02-13 14:17 ` Greg KH
2024-02-13 14:18 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2024-02-13 14:17 UTC (permalink / raw)
To: Michał Pecio; +Cc: mathias.nyman, stable
On Tue, Feb 13, 2024 at 02:39:21PM +0100, Michał Pecio wrote:
> Hi,
>
> > The patch below does not apply to the 5.10-stable tree.
> > [...]
> > From 7c4650ded49e5b88929ecbbb631efb8b0838e811 Mon Sep 17 00:00:00 2001
> > From: Michal Pecio <michal.pecio@gmail.com>
> > Date: Thu, 25 Jan 2024 17:27:37 +0200
> > Subject: [PATCH] xhci: handle isoc Babble and Buffer Overrun events
>
> This patch depends on its parent 5372c65e1311 ("xhci: process isoc TD
> properly when there was a transaction error mid TD.").
>
> The parent commit appears to be missing from your 5.10 and earlier
> queues for some reason, hence the breakage.
That parent commit would not apply to those older kernels (and I had no
hint that it should go there.) I've backported it to 5.10.y ok, but 5.4
and 4.19 were harder. So if you want both of these in those older
kernels, please provide working backports and I'll be glad to queue them
up.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] xhci: handle isoc Babble and Buffer Overrun events properly" failed to apply to 5.10-stable tree
2024-02-13 14:17 ` Greg KH
@ 2024-02-13 14:18 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2024-02-13 14:18 UTC (permalink / raw)
To: Michał Pecio; +Cc: mathias.nyman, stable
On Tue, Feb 13, 2024 at 03:17:36PM +0100, Greg KH wrote:
> On Tue, Feb 13, 2024 at 02:39:21PM +0100, Michał Pecio wrote:
> > Hi,
> >
> > > The patch below does not apply to the 5.10-stable tree.
> > > [...]
> > > From 7c4650ded49e5b88929ecbbb631efb8b0838e811 Mon Sep 17 00:00:00 2001
> > > From: Michal Pecio <michal.pecio@gmail.com>
> > > Date: Thu, 25 Jan 2024 17:27:37 +0200
> > > Subject: [PATCH] xhci: handle isoc Babble and Buffer Overrun events
> >
> > This patch depends on its parent 5372c65e1311 ("xhci: process isoc TD
> > properly when there was a transaction error mid TD.").
> >
> > The parent commit appears to be missing from your 5.10 and earlier
> > queues for some reason, hence the breakage.
>
> That parent commit would not apply to those older kernels (and I had no
> hint that it should go there.) I've backported it to 5.10.y ok, but 5.4
> and 4.19 were harder. So if you want both of these in those older
> kernels, please provide working backports and I'll be glad to queue them
> up.
Nope, my 5.10.y backport failed too, so will need working versions for
that tree as well.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-02-13 14:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13 13:22 FAILED: patch "[PATCH] xhci: handle isoc Babble and Buffer Overrun events properly" failed to apply to 5.10-stable tree gregkh
2024-02-13 13:39 ` Michał Pecio
2024-02-13 14:17 ` Greg KH
2024-02-13 14:18 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox