From eeb082e0ecf9f175b25b110e649cd5703cf6bbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 7 Nov 2024 01:57:33 +0100 Subject: [PATCH] Remove usbip patch that breaks mass storage devices with Linux 6.6.50+ Linux 6.6.50+ got 73ec94aac593ef4bac3a864365f0433b8266225b ("usbip: Don't submit special requests twice") which together with 0001-usbip-tweak-clear-halt-with-simple-reset.patch breaks attaching mass storage devices (and possibly some other devices too). The exact behavior is that frontend gets messages like this: usb 2-1: SetAddress Request (2) to port 0 usb 2-1: reset SuperSpeed USB device number 2 using vhci_hcd usb 2-1: SetAddress Request (2) to port 0 usb 2-1: reset SuperSpeed USB device number 2 using vhci_hcd usb 2-1: SetAddress Request (2) to port 0 usb 2-1: reset SuperSpeed USB device number 2 using vhci_hcd usb 2-1: SetAddress Request (2) to port 0 usb 2-1: reset SuperSpeed USB device number 2 using vhci_hcd And the backend gets messages like this: usbip-host 3-1: urb completion with non-zero status -121 usbip-host 3-1: endpoint 1 is stalled usbip-host 3-1: usb_reset_endpoint done: devnum 2 endp 129 usbip-host 3-1: urb completion with non-zero status -71 usbip-host 3-1: urb completion with non-zero status -121 usbip-host 3-1: endpoint 1 is stalled usbip-host 3-1: usb_reset_endpoint done: devnum 2 endp 129 usbip-host 3-1: urb completion with non-zero status -71 usbip-host 3-1: urb completion with non-zero status -121 usbip-host 3-1: endpoint 1 is stalled The disk eventually shows up, but with a long delay, enough to hit qvm-usb timeout most of the times. Since the Linux change may fix a similar issue that the patch originally tried to, simply drop the local patch. If the original problem re-appears, we'll need a different fix. Fixes QubesOS/qubes-issues#9546 (cherry picked from commit cf97c01475cf500152227d1daa89afc9c40831bd) --- ...p-tweak-clear-halt-with-simple-reset.patch | 61 ------------------- kernel.spec.in | 1 - 2 files changed, 62 deletions(-) delete mode 100644 0001-usbip-tweak-clear-halt-with-simple-reset.patch diff --git a/0001-usbip-tweak-clear-halt-with-simple-reset.patch b/0001-usbip-tweak-clear-halt-with-simple-reset.patch deleted file mode 100644 index 4179851f..00000000 --- a/0001-usbip-tweak-clear-halt-with-simple-reset.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 29034eb7621ace3416c6964c32227c5aa0dd005b Mon Sep 17 00:00:00 2001 -From: Ivan Kardykov -Date: Tue, 14 Dec 2021 10:53:50 +0300 -Subject: [PATCH] usbip: tweak clear halt with simple reset - -Some USB 3.0+ storage devices freeze with usb_clear_halt, but it is -enough to reset endpoint here. - -Signed-off-by: Ivan Kardykov ---- - drivers/usb/usbip/stub_rx.c | 25 ++++++++++--------------- - 1 file changed, 10 insertions(+), 15 deletions(-) - -diff --git a/drivers/usb/usbip/stub_rx.c b/drivers/usb/usbip/stub_rx.c -index 325c22008..7caa07bbb 100644 ---- a/drivers/usb/usbip/stub_rx.c -+++ b/drivers/usb/usbip/stub_rx.c -@@ -67,8 +67,6 @@ static int tweak_clear_halt_cmd(struct urb *urb) - struct usb_ctrlrequest *req; - int target_endp; - int target_dir; -- int target_pipe; -- int ret; - - req = (struct usb_ctrlrequest *) urb->setup_packet; - -@@ -83,21 +81,18 @@ static int tweak_clear_halt_cmd(struct urb *urb) - target_dir = le16_to_cpu(req->wIndex) & 0x0080; - - if (target_dir) -- target_pipe = usb_rcvctrlpipe(urb->dev, target_endp); -- else -- target_pipe = usb_sndctrlpipe(urb->dev, target_endp); -+ target_endp |= USB_DIR_IN; - -- ret = usb_clear_halt(urb->dev, target_pipe); -- if (ret < 0) -- dev_err(&urb->dev->dev, -- "usb_clear_halt error: devnum %d endp %d ret %d\n", -- urb->dev->devnum, target_endp, ret); -- else -- dev_info(&urb->dev->dev, -- "usb_clear_halt done: devnum %d endp %d\n", -- urb->dev->devnum, target_endp); -+ /* -+ * Some USB storage devices freeze with usb_clear_halt() -+ * so just reset endpoint here. -+ */ -+ usb_reset_endpoint(urb->dev, target_endp); - -- return ret; -+ dev_info(&urb->dev->dev, -+ "usb_reset_endpoint done: devnum %d endp %d\n", -+ urb->dev->devnum, target_endp); -+ return 0; - } - - static int tweak_set_interface_cmd(struct urb *urb) --- -2.31.1 - diff --git a/kernel.spec.in b/kernel.spec.in index b5ba315a..85ac5acd 100644 --- a/kernel.spec.in +++ b/kernel.spec.in @@ -142,7 +142,6 @@ Patch2: 0003-Log-error-code-of-EVTCHNOP_bind_pirq-failure.patch Patch3: 0004-pvops-respect-removable-xenstore-flag-for-block-devi.patch Patch5: 0006-block-add-no_part_scan-module-parameter.patch Patch12: 0013-xen-pcifront-pciback-Update-pciif.h-with-err-and-res.patch -Patch16: 0001-usbip-tweak-clear-halt-with-simple-reset.patch Patch25: 0001-Re-enable-interrupts-before-loading-PNVM.patch Patch26: 0001-sound-Disable-SG-buffer.patch Patch27: 0001-amdgpu-timeout.patch