From c05d4e5b496c79e705eb85dc4e128675fe8faeb3 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 11 Jul 2023 08:16:18 +0200 Subject: [PATCH] dde_linux: prevent scatter-gather in USB devio USB devio splits large transaction into 16 KiB buffers in scatter-gather lists. Unfortunately, this mechanism seems unreliable most certainly because of issue #4809 "DDE Linux struct page object aliasing". Issue #5036 --- repos/dde_linux/patches/usb_host_devio_sg.patch | 15 +++++++++++++++ repos/dde_linux/ports/linux.hash | 2 +- repos/dde_linux/ports/linux.port | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 repos/dde_linux/patches/usb_host_devio_sg.patch diff --git a/repos/dde_linux/patches/usb_host_devio_sg.patch b/repos/dde_linux/patches/usb_host_devio_sg.patch new file mode 100644 index 0000000000..d6cb41171e --- /dev/null +++ b/repos/dde_linux/patches/usb_host_devio_sg.patch @@ -0,0 +1,15 @@ +USB devio splits large transaction into 16 KiB buffers in scatter-gather +lists. Unfortunately, this mechanism seems unreliable most certainly because +of issue #4809 "DDE Linux struct page object aliasing". + +--- src/linux/drivers/usb/core/devio.c ++++ src/linux/drivers/usb/core/devio.c +@@ -53,7 +53,7 @@ + + #define USB_MAXBUS 64 + #define USB_DEVICE_MAX (USB_MAXBUS * 128) +-#define USB_SG_SIZE 16384 /* split-size for large txs */ ++#define USB_SG_SIZE (1024 * 1024) /* split-size for large txs */ + + /* Mutual exclusion for ps->list in resume vs. release and remove */ + static DEFINE_MUTEX(usbfs_mutex); diff --git a/repos/dde_linux/ports/linux.hash b/repos/dde_linux/ports/linux.hash index ab2d8e3d66..4998beb6b7 100644 --- a/repos/dde_linux/ports/linux.hash +++ b/repos/dde_linux/ports/linux.hash @@ -1 +1 @@ -e6eaabb8e0a8e3f3357229f65ec69ad213019034 +5593e6833c49b2b82314c2ad2d040ff91df63d16 diff --git a/repos/dde_linux/ports/linux.port b/repos/dde_linux/ports/linux.port index 5763289c4b..aad2600b18 100644 --- a/repos/dde_linux/ports/linux.port +++ b/repos/dde_linux/ports/linux.port @@ -12,6 +12,7 @@ DIR(linux) := src/linux PATCH_FILES := i915_irq.patch \ iwlwifi_enable_irq_before_pnvm.patch \ iwlwifi_limit_rx_bufs.patch \ + usb_host_devio_sg.patch \ usb_net_pinephone.patch \ usb_net_cdc_ncm.patch \ workqueue_deadlock.patch