PKGBUILDs/core/linux-rpi/0002-Revert-usb-xhci-expand-the-scope-of-XHCI_VLI_SS_BULK.patch
2022-03-22 07:36:45 -04:00

60 lines
2 KiB
Diff

From fcd5dced618c4e0931544e98a02bfe4a3814194b Mon Sep 17 00:00:00 2001
From: graysky <graysky@archlinux.us>
Date: Tue, 22 Mar 2022 07:30:52 -0400
Subject: [PATCH] Revert "usb: xhci: expand the scope of
XHCI_VLI_SS_BULK_OUT_BUG"
This reverts commit 40686d87f87a46b3abf48a8dcaee5e0a031deafb.
See: https://github.com/raspberrypi/linux/issues/4930
---
drivers/usb/host/xhci.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index dc0651828f97..45dfdcdc9f30 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1395,12 +1395,9 @@ static void xhci_unmap_temp_buf(struct usb_hcd *hcd, struct urb *urb)
static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
gfp_t mem_flags)
{
- unsigned int i, maxpacket;
- struct scatterlist *sg;
struct xhci_hcd *xhci;
xhci = hcd_to_xhci(hcd);
- maxpacket = usb_endpoint_maxp(&urb->ep->desc);
if (xhci_urb_suitable_for_idt(urb))
return 0;
@@ -1409,16 +1406,6 @@ static int xhci_map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb,
if (xhci_urb_temp_buffer_required(hcd, urb))
return xhci_map_temp_buffer(hcd, urb);
}
-
- if (xhci->quirks & XHCI_VLI_SS_BULK_OUT_BUG &&
- usb_endpoint_is_bulk_out(&urb->ep->desc) &&
- urb->dev->speed >= USB_SPEED_SUPER &&
- urb->transfer_buffer_length != 0) {
- for_each_sg(urb->sg, sg, urb->num_sgs, i) {
- if (sg->length % maxpacket)
- return xhci_map_temp_buffer(hcd, urb);
- }
- }
return usb_hcd_map_urb_for_dma(hcd, urb, mem_flags);
}
@@ -1432,8 +1419,7 @@ static void xhci_unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb)
if (urb->num_sgs && (urb->transfer_flags & URB_DMA_MAP_SINGLE))
unmap_temp_buf = true;
- if ((xhci->quirks & (XHCI_SG_TRB_CACHE_SIZE_QUIRK | XHCI_VLI_SS_BULK_OUT_BUG))
- && unmap_temp_buf)
+ if ((xhci->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK) && unmap_temp_buf)
xhci_unmap_temp_buf(hcd, urb);
else
usb_hcd_unmap_urb_for_dma(hcd, urb);
--
2.35.1