From: Greg Kroah-Hartman Date: Tue, 13 Feb 2024 13:07:25 +0000 (+0100) Subject: 6.1-stable patches X-Git-Tag: v6.1.78~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e06b5a67270e3a4a7ae61fad0446774482d97fcb;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: alsa-usb-audio-add-a-quirk-for-yamaha-yit-w12tx-transmitter.patch alsa-usb-audio-add-delay-quirk-for-motu-m-series-2nd-revision.patch alsa-usb-audio-add-quirk-for-rode-nt-usb.patch hrtimer-report-offline-hrtimer-enqueue.patch input-atkbd-skip-atkbd_cmd_setleds-when-skipping-atkbd_cmd_getid.patch input-i8042-fix-strange-behavior-of-touchpad-on-clevo-ns70pu.patch usb-dwc3-host-set-xhci_sg_trb_cache_size_quirk.patch usb-host-xhci-plat-add-support-for-xhci_sg_trb_cache_size_quirk.patch usb-serial-cp210x-add-id-for-imst-im871a-usb.patch usb-serial-option-add-fibocom-fm101-gl-variant.patch usb-serial-qcserial-add-new-usb-id-for-dell-wireless-dw5826e.patch xhci-handle-isoc-babble-and-buffer-overrun-events-properly.patch xhci-process-isoc-td-properly-when-there-was-a-transaction-error-mid-td.patch --- diff --git a/queue-6.1/alsa-usb-audio-add-a-quirk-for-yamaha-yit-w12tx-transmitter.patch b/queue-6.1/alsa-usb-audio-add-a-quirk-for-yamaha-yit-w12tx-transmitter.patch new file mode 100644 index 00000000000..3c83c60b9b1 --- /dev/null +++ b/queue-6.1/alsa-usb-audio-add-a-quirk-for-yamaha-yit-w12tx-transmitter.patch @@ -0,0 +1,32 @@ +From a969210066054ea109d8b7aff29a9b1c98776841 Mon Sep 17 00:00:00 2001 +From: Julian Sikorski +Date: Tue, 23 Jan 2024 09:49:35 +0100 +Subject: ALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter + +From: Julian Sikorski + +commit a969210066054ea109d8b7aff29a9b1c98776841 upstream. + +The device fails to initialize otherwise, giving the following error: +[ 3676.671641] usb 2-1.1: 1:1: cannot get freq at ep 0x1 + +Signed-off-by: Julian Sikorski +Cc: +Link: https://lore.kernel.org/r/20240123084935.2745-1-belegdol+github@gmail.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -2029,6 +2029,8 @@ static const struct usb_audio_quirk_flag + QUIRK_FLAG_CTL_MSG_DELAY_1M | QUIRK_FLAG_IGNORE_CTL_ERROR), + DEVICE_FLG(0x0499, 0x1509, /* Steinberg UR22 */ + QUIRK_FLAG_GENERIC_IMPLICIT_FB), ++ DEVICE_FLG(0x0499, 0x3108, /* Yamaha YIT-W12TX */ ++ QUIRK_FLAG_GET_SAMPLE_RATE), + DEVICE_FLG(0x04d8, 0xfeea, /* Benchmark DAC1 Pre */ + QUIRK_FLAG_GET_SAMPLE_RATE), + DEVICE_FLG(0x04e8, 0xa051, /* Samsung USBC Headset (AKG) */ diff --git a/queue-6.1/alsa-usb-audio-add-delay-quirk-for-motu-m-series-2nd-revision.patch b/queue-6.1/alsa-usb-audio-add-delay-quirk-for-motu-m-series-2nd-revision.patch new file mode 100644 index 00000000000..2958ac380bb --- /dev/null +++ b/queue-6.1/alsa-usb-audio-add-delay-quirk-for-motu-m-series-2nd-revision.patch @@ -0,0 +1,33 @@ +From d915a6850e27efb383cd4400caadfe47792623df Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy +Date: Wed, 24 Jan 2024 16:02:39 +0300 +Subject: ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision + +From: Alexander Tsoy + +commit d915a6850e27efb383cd4400caadfe47792623df upstream. + +Audio control requests that sets sampling frequency sometimes fail on +this card. Adding delay between control messages eliminates that problem. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=217601 +Cc: +Signed-off-by: Alexander Tsoy +Link: https://lore.kernel.org/r/20240124130239.358298-1-alexander@tsoy.me +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -2071,6 +2071,8 @@ static const struct usb_audio_quirk_flag + QUIRK_FLAG_GENERIC_IMPLICIT_FB), + DEVICE_FLG(0x0763, 0x2031, /* M-Audio Fast Track C600 */ + QUIRK_FLAG_GENERIC_IMPLICIT_FB), ++ DEVICE_FLG(0x07fd, 0x000b, /* MOTU M Series 2nd hardware revision */ ++ QUIRK_FLAG_CTL_MSG_DELAY_1M), + DEVICE_FLG(0x08bb, 0x2702, /* LineX FM Transmitter */ + QUIRK_FLAG_IGNORE_CTL_ERROR), + DEVICE_FLG(0x0951, 0x16ad, /* Kingston HyperX */ diff --git a/queue-6.1/alsa-usb-audio-add-quirk-for-rode-nt-usb.patch b/queue-6.1/alsa-usb-audio-add-quirk-for-rode-nt-usb.patch new file mode 100644 index 00000000000..4463a296647 --- /dev/null +++ b/queue-6.1/alsa-usb-audio-add-quirk-for-rode-nt-usb.patch @@ -0,0 +1,50 @@ +From 7822baa844a87cbb93308c1032c3d47d4079bb8a Mon Sep 17 00:00:00 2001 +From: Sean Young +Date: Wed, 24 Jan 2024 15:15:24 +0000 +Subject: ALSA: usb-audio: add quirk for RODE NT-USB+ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sean Young + +commit 7822baa844a87cbb93308c1032c3d47d4079bb8a upstream. + +The RODE NT-USB+ is marketed as a professional usb microphone, however the +usb audio interface is a mess: + +[ 1.130977] usb 1-5: new full-speed USB device number 2 using xhci_hcd +[ 1.503906] usb 1-5: config 1 has an invalid interface number: 5 but max is 4 +[ 1.503912] usb 1-5: config 1 has no interface number 4 +[ 1.519689] usb 1-5: New USB device found, idVendor=19f7, idProduct=0035, bcdDevice= 1.09 +[ 1.519695] usb 1-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 +[ 1.519697] usb 1-5: Product: RØDE NT-USB+ +[ 1.519699] usb 1-5: Manufacturer: RØDE +[ 1.519700] usb 1-5: SerialNumber: 1D773A1A +[ 8.327495] usb 1-5: 1:1: cannot get freq at ep 0x82 +[ 8.344500] usb 1-5: 1:2: cannot get freq at ep 0x82 +[ 8.365499] usb 1-5: 2:1: cannot get freq at ep 0x2 + +Add QUIRK_FLAG_GET_SAMPLE_RATE to work around the broken sample rate get. +I have asked Rode support to fix it, but they show no interest. + +Signed-off-by: Sean Young +Cc: +Link: https://lore.kernel.org/r/20240124151524.23314-1-sean@mess.org +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/quirks.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -2181,6 +2181,8 @@ static const struct usb_audio_quirk_flag + QUIRK_FLAG_FIXED_RATE), + DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */ + QUIRK_FLAG_GET_SAMPLE_RATE), ++ DEVICE_FLG(0x19f7, 0x0035, /* RODE NT-USB+ */ ++ QUIRK_FLAG_GET_SAMPLE_RATE), + + /* Vendor matches */ + VENDOR_FLG(0x045e, /* MS Lifecam */ diff --git a/queue-6.1/hrtimer-report-offline-hrtimer-enqueue.patch b/queue-6.1/hrtimer-report-offline-hrtimer-enqueue.patch new file mode 100644 index 00000000000..d86699b6955 --- /dev/null +++ b/queue-6.1/hrtimer-report-offline-hrtimer-enqueue.patch @@ -0,0 +1,78 @@ +From dad6a09f3148257ac1773cd90934d721d68ab595 Mon Sep 17 00:00:00 2001 +From: Frederic Weisbecker +Date: Mon, 29 Jan 2024 15:56:36 -0800 +Subject: hrtimer: Report offline hrtimer enqueue + +From: Frederic Weisbecker + +commit dad6a09f3148257ac1773cd90934d721d68ab595 upstream. + +The hrtimers migration on CPU-down hotplug process has been moved +earlier, before the CPU actually goes to die. This leaves a small window +of opportunity to queue an hrtimer in a blind spot, leaving it ignored. + +For example a practical case has been reported with RCU waking up a +SCHED_FIFO task right before the CPUHP_AP_IDLE_DEAD stage, queuing that +way a sched/rt timer to the local offline CPU. + +Make sure such situations never go unnoticed and warn when that happens. + +Fixes: 5c0930ccaad5 ("hrtimers: Push pending hrtimers away from outgoing CPU earlier") +Reported-by: Paul E. McKenney +Signed-off-by: Frederic Weisbecker +Signed-off-by: Paul E. McKenney +Signed-off-by: Thomas Gleixner +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20240129235646.3171983-4-boqun.feng@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/hrtimer.h | 4 +++- + kernel/time/hrtimer.c | 3 +++ + 2 files changed, 6 insertions(+), 1 deletion(-) + +--- a/include/linux/hrtimer.h ++++ b/include/linux/hrtimer.h +@@ -197,6 +197,7 @@ enum hrtimer_base_type { + * @max_hang_time: Maximum time spent in hrtimer_interrupt + * @softirq_expiry_lock: Lock which is taken while softirq based hrtimer are + * expired ++ * @online: CPU is online from an hrtimers point of view + * @timer_waiters: A hrtimer_cancel() invocation waits for the timer + * callback to finish. + * @expires_next: absolute time of the next event, is required for remote +@@ -219,7 +220,8 @@ struct hrtimer_cpu_base { + unsigned int hres_active : 1, + in_hrtirq : 1, + hang_detected : 1, +- softirq_activated : 1; ++ softirq_activated : 1, ++ online : 1; + #ifdef CONFIG_HIGH_RES_TIMERS + unsigned int nr_events; + unsigned short nr_retries; +--- a/kernel/time/hrtimer.c ++++ b/kernel/time/hrtimer.c +@@ -1082,6 +1082,7 @@ static int enqueue_hrtimer(struct hrtime + enum hrtimer_mode mode) + { + debug_activate(timer, mode); ++ WARN_ON_ONCE(!base->cpu_base->online); + + base->cpu_base->active_bases |= 1 << base->index; + +@@ -2180,6 +2181,7 @@ int hrtimers_prepare_cpu(unsigned int cp + cpu_base->softirq_next_timer = NULL; + cpu_base->expires_next = KTIME_MAX; + cpu_base->softirq_expires_next = KTIME_MAX; ++ cpu_base->online = 1; + hrtimer_cpu_base_init_expiry_lock(cpu_base); + return 0; + } +@@ -2247,6 +2249,7 @@ int hrtimers_cpu_dying(unsigned int dyin + smp_call_function_single(ncpu, retrigger_next_event, NULL, 0); + + raw_spin_unlock(&new_base->lock); ++ old_base->online = 0; + raw_spin_unlock(&old_base->lock); + + return 0; diff --git a/queue-6.1/input-atkbd-skip-atkbd_cmd_setleds-when-skipping-atkbd_cmd_getid.patch b/queue-6.1/input-atkbd-skip-atkbd_cmd_setleds-when-skipping-atkbd_cmd_getid.patch new file mode 100644 index 00000000000..99e9e692493 --- /dev/null +++ b/queue-6.1/input-atkbd-skip-atkbd_cmd_setleds-when-skipping-atkbd_cmd_getid.patch @@ -0,0 +1,82 @@ +From 683cd8259a9b883a51973511f860976db2550a6e Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 26 Jan 2024 17:07:23 +0100 +Subject: Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID + +From: Hans de Goede + +commit 683cd8259a9b883a51973511f860976db2550a6e upstream. + +After commit 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in +translated mode") the keyboard on Dell XPS 13 9350 / 9360 / 9370 models +has stopped working after a suspend/resume. + +The problem appears to be that atkbd_probe() fails when called +from atkbd_reconnect() on resume, which on systems where +ATKBD_CMD_GETID is skipped can only happen by ATKBD_CMD_SETLEDS +failing. ATKBD_CMD_SETLEDS failing because ATKBD_CMD_GETID was +skipped is weird, but apparently that is what is happening. + +Fix this by also skipping ATKBD_CMD_SETLEDS when skipping +ATKBD_CMD_GETID. + +Fixes: 936e4d49ecbc ("Input: atkbd - skip ATKBD_CMD_GETID in translated mode") +Reported-by: Paul Menzel +Closes: https://lore.kernel.org/linux-input/0aa4a61f-c939-46fe-a572-08022e8931c7@molgen.mpg.de/ +Closes: https://bbs.archlinux.org/viewtopic.php?pid=2146300 +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218424 +Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2260517 +Tested-by: Paul Menzel +Cc: stable@vger.kernel.org +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20240126160724.13278-2-hdegoede@redhat.com +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/keyboard/atkbd.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +--- a/drivers/input/keyboard/atkbd.c ++++ b/drivers/input/keyboard/atkbd.c +@@ -792,7 +792,6 @@ static int atkbd_probe(struct atkbd *atk + { + struct ps2dev *ps2dev = &atkbd->ps2dev; + unsigned char param[2]; +- bool skip_getid; + + /* + * Some systems, where the bit-twiddling when testing the io-lines of the +@@ -806,6 +805,11 @@ static int atkbd_probe(struct atkbd *atk + "keyboard reset failed on %s\n", + ps2dev->serio->phys); + ++ if (atkbd_skip_getid(atkbd)) { ++ atkbd->id = 0xab83; ++ return 0; ++ } ++ + /* + * Then we check the keyboard ID. We should get 0xab83 under normal conditions. + * Some keyboards report different values, but the first byte is always 0xab or +@@ -814,18 +818,17 @@ static int atkbd_probe(struct atkbd *atk + */ + + param[0] = param[1] = 0xa5; /* initialize with invalid values */ +- skip_getid = atkbd_skip_getid(atkbd); +- if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) { ++ if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) { + + /* +- * If the get ID command was skipped or failed, we check if we can at least set ++ * If the get ID command failed, we check if we can at least set + * the LEDs on the keyboard. This should work on every keyboard out there. + * It also turns the LEDs off, which we want anyway. + */ + param[0] = 0; + if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) + return -1; +- atkbd->id = skip_getid ? 0xab83 : 0xabba; ++ atkbd->id = 0xabba; + return 0; + } + diff --git a/queue-6.1/input-i8042-fix-strange-behavior-of-touchpad-on-clevo-ns70pu.patch b/queue-6.1/input-i8042-fix-strange-behavior-of-touchpad-on-clevo-ns70pu.patch new file mode 100644 index 00000000000..7d5eaba1060 --- /dev/null +++ b/queue-6.1/input-i8042-fix-strange-behavior-of-touchpad-on-clevo-ns70pu.patch @@ -0,0 +1,47 @@ +From a60e6c3918d20848906ffcdfcf72ca6a8cfbcf2e Mon Sep 17 00:00:00 2001 +From: Werner Sembach +Date: Tue, 5 Dec 2023 17:36:01 +0100 +Subject: Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU + +From: Werner Sembach + +commit a60e6c3918d20848906ffcdfcf72ca6a8cfbcf2e upstream. + +When closing the laptop lid with an external screen connected, the mouse +pointer has a constant movement to the lower right corner. Opening the +lid again stops this movement, but after that the touchpad does no longer +register clicks. + +The touchpad is connected both via i2c-hid and PS/2, the predecessor of +this device (NS70MU) has the same layout in this regard and also strange +behaviour caused by the psmouse and the i2c-hid driver fighting over +touchpad control. This fix is reusing the same workaround by just +disabling the PS/2 aux port, that is only used by the touchpad, to give the +i2c-hid driver the lone control over the touchpad. + +v2: Rebased on current master + +Signed-off-by: Werner Sembach +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20231205163602.16106-1-wse@tuxedocomputers.com +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/serio/i8042-acpipnpio.h | 6 ++++++ + 1 file changed, 6 insertions(+) + +--- a/drivers/input/serio/i8042-acpipnpio.h ++++ b/drivers/input/serio/i8042-acpipnpio.h +@@ -1210,6 +1210,12 @@ static const struct dmi_system_id i8042_ + }, + { + .matches = { ++ DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"), ++ }, ++ .driver_data = (void *)(SERIO_QUIRK_NOAUX) ++ }, ++ { ++ .matches = { + DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"), + }, + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | diff --git a/queue-6.1/series b/queue-6.1/series index 3f22104daaa..f4b0c85814d 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -42,3 +42,16 @@ scsi-core-move-scsi_host_busy-out-of-host-lock-if-it.patch blk-iocost-fix-an-ubsan-shift-out-of-bounds-warning.patch fs-dlm-don-t-put-dlm_local_addrs-on-heap.patch mtd-parsers-ofpart-add-workaround-for-size-cells-0.patch +alsa-usb-audio-add-delay-quirk-for-motu-m-series-2nd-revision.patch +alsa-usb-audio-add-a-quirk-for-yamaha-yit-w12tx-transmitter.patch +alsa-usb-audio-add-quirk-for-rode-nt-usb.patch +usb-serial-qcserial-add-new-usb-id-for-dell-wireless-dw5826e.patch +usb-serial-option-add-fibocom-fm101-gl-variant.patch +usb-serial-cp210x-add-id-for-imst-im871a-usb.patch +usb-dwc3-host-set-xhci_sg_trb_cache_size_quirk.patch +usb-host-xhci-plat-add-support-for-xhci_sg_trb_cache_size_quirk.patch +xhci-process-isoc-td-properly-when-there-was-a-transaction-error-mid-td.patch +xhci-handle-isoc-babble-and-buffer-overrun-events-properly.patch +hrtimer-report-offline-hrtimer-enqueue.patch +input-i8042-fix-strange-behavior-of-touchpad-on-clevo-ns70pu.patch +input-atkbd-skip-atkbd_cmd_setleds-when-skipping-atkbd_cmd_getid.patch diff --git a/queue-6.1/usb-dwc3-host-set-xhci_sg_trb_cache_size_quirk.patch b/queue-6.1/usb-dwc3-host-set-xhci_sg_trb_cache_size_quirk.patch new file mode 100644 index 00000000000..a6a1d21803f --- /dev/null +++ b/queue-6.1/usb-dwc3-host-set-xhci_sg_trb_cache_size_quirk.patch @@ -0,0 +1,57 @@ +From 817349b6d26aadd8b38283a05ce0bab106b4c765 Mon Sep 17 00:00:00 2001 +From: Prashanth K +Date: Tue, 16 Jan 2024 11:28:15 +0530 +Subject: usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK + +From: Prashanth K + +commit 817349b6d26aadd8b38283a05ce0bab106b4c765 upstream. + +Upstream commit bac1ec551434 ("usb: xhci: Set quirk for +XHCI_SG_TRB_CACHE_SIZE_QUIRK") introduced a new quirk in XHCI +which fixes XHC timeout, which was seen on synopsys XHCs while +using SG buffers. But the support for this quirk isn't present +in the DWC3 layer. + +We will encounter this XHCI timeout/hung issue if we run iperf +loopback tests using RTL8156 ethernet adaptor on DWC3 targets +with scatter-gather enabled. This gets resolved after enabling +the XHCI_SG_TRB_CACHE_SIZE_QUIRK. This patch enables it using +the xhci device property since its needed for DWC3 controller. + +In Synopsys DWC3 databook, +Table 9-3: xHCI Debug Capability Limitations +Chained TRBs greater than TRB cache size: The debug capability +driver must not create a multi-TRB TD that describes smaller +than a 1K packet that spreads across 8 or more TRBs on either +the IN TR or the OUT TR. + +Cc: stable@vger.kernel.org #5.11 +Signed-off-by: Prashanth K +Acked-by: Thinh Nguyen +Link: https://lore.kernel.org/r/20240116055816.1169821-2-quic_prashk@quicinc.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc3/host.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/usb/dwc3/host.c ++++ b/drivers/usb/dwc3/host.c +@@ -66,7 +66,7 @@ out: + + int dwc3_host_init(struct dwc3 *dwc) + { +- struct property_entry props[4]; ++ struct property_entry props[5]; + struct platform_device *xhci; + int ret, irq; + int prop_idx = 0; +@@ -94,6 +94,8 @@ int dwc3_host_init(struct dwc3 *dwc) + + memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); + ++ props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-sg-trb-cache-size-quirk"); ++ + if (dwc->usb3_lpm_capable) + props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); + diff --git a/queue-6.1/usb-host-xhci-plat-add-support-for-xhci_sg_trb_cache_size_quirk.patch b/queue-6.1/usb-host-xhci-plat-add-support-for-xhci_sg_trb_cache_size_quirk.patch new file mode 100644 index 00000000000..0dba1de13be --- /dev/null +++ b/queue-6.1/usb-host-xhci-plat-add-support-for-xhci_sg_trb_cache_size_quirk.patch @@ -0,0 +1,38 @@ +From 520b391e3e813c1dd142d1eebb3ccfa6d08c3995 Mon Sep 17 00:00:00 2001 +From: Prashanth K +Date: Tue, 16 Jan 2024 11:28:16 +0530 +Subject: usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK + +From: Prashanth K + +commit 520b391e3e813c1dd142d1eebb3ccfa6d08c3995 upstream. + +Upstream commit bac1ec551434 ("usb: xhci: Set quirk for +XHCI_SG_TRB_CACHE_SIZE_QUIRK") introduced a new quirk in XHCI +which fixes XHC timeout, which was seen on synopsys XHCs while +using SG buffers. Currently this quirk can only be set using +xhci private data. But there are some drivers like dwc3/host.c +which adds adds quirks using software node for xhci device. +Hence set this xhci quirk by iterating over device properties. + +Cc: stable@vger.kernel.org # 5.11 +Fixes: bac1ec551434 ("usb: xhci: Set quirk for XHCI_SG_TRB_CACHE_SIZE_QUIRK") +Signed-off-by: Prashanth K +Link: https://lore.kernel.org/r/20240116055816.1169821-3-quic_prashk@quicinc.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-plat.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/usb/host/xhci-plat.c ++++ b/drivers/usb/host/xhci-plat.c +@@ -301,6 +301,9 @@ static int xhci_plat_probe(struct platfo + if (device_property_read_bool(tmpdev, "quirk-broken-port-ped")) + xhci->quirks |= XHCI_BROKEN_PORT_PED; + ++ if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk")) ++ xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK; ++ + device_property_read_u32(tmpdev, "imod-interval-ns", + &xhci->imod_interval); + } diff --git a/queue-6.1/usb-serial-cp210x-add-id-for-imst-im871a-usb.patch b/queue-6.1/usb-serial-cp210x-add-id-for-imst-im871a-usb.patch new file mode 100644 index 00000000000..7cb5ec5b2c7 --- /dev/null +++ b/queue-6.1/usb-serial-cp210x-add-id-for-imst-im871a-usb.patch @@ -0,0 +1,31 @@ +From 12b17b4eb82a41977eb848048137b5908d52845c Mon Sep 17 00:00:00 2001 +From: Leonard Dallmayr +Date: Fri, 5 Jan 2024 13:35:51 +0100 +Subject: USB: serial: cp210x: add ID for IMST iM871A-USB + +From: Leonard Dallmayr + +commit 12b17b4eb82a41977eb848048137b5908d52845c upstream. + +The device IMST USB-Stick for Smart Meter is a rebranded IMST iM871A-USB +Wireless M-Bus USB-adapter. It is used to read wireless water, gas and +electricity meters. + +Signed-off-by: Leonard Dallmayr +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/cp210x.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/cp210x.c ++++ b/drivers/usb/serial/cp210x.c +@@ -146,6 +146,7 @@ static const struct usb_device_id id_tab + { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ + { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ + { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ ++ { USB_DEVICE(0x10C4, 0x87ED) }, /* IMST USB-Stick for Smart Meter */ + { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */ + { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ + { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ diff --git a/queue-6.1/usb-serial-option-add-fibocom-fm101-gl-variant.patch b/queue-6.1/usb-serial-option-add-fibocom-fm101-gl-variant.patch new file mode 100644 index 00000000000..abe6d3adfaf --- /dev/null +++ b/queue-6.1/usb-serial-option-add-fibocom-fm101-gl-variant.patch @@ -0,0 +1,54 @@ +From b4a1f4eaf1d798066affc6ad040f76eb1a16e1c9 Mon Sep 17 00:00:00 2001 +From: Puliang Lu +Date: Wed, 31 Jan 2024 17:12:24 +0800 +Subject: USB: serial: option: add Fibocom FM101-GL variant + +From: Puliang Lu + +commit b4a1f4eaf1d798066affc6ad040f76eb1a16e1c9 upstream. + +Update the USB serial option driver support for the Fibocom +FM101-GL +LTE modules as there are actually several different variants. +- VID:PID 2cb7:01a3, FM101-GL are laptop M.2 cards (with +MBIM interfaces for /Linux/Chrome OS) + +0x01a3:mbim,gnss + +Here are the outputs of usb-devices: + +T: Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0 +D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1 +P: Vendor=2cb7 ProdID=01a3 Rev=05.04 +S: Manufacturer=Fibocom Wireless Inc. +S: Product=Fibocom FM101-GL Module +S: SerialNumber=5ccd5cd4 +C: #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=896mA +I: If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim +E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=32ms +I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim +E: Ad=0f(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=8e(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +I: If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=40 Driver=option +E: Ad=01(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=82(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms +E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms + +Signed-off-by: Puliang Lu +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/option.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/usb/serial/option.c ++++ b/drivers/usb/serial/option.c +@@ -2269,6 +2269,7 @@ static const struct usb_device_id option + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */ + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ ++ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a3, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ + { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */ + .driver_info = RSVD(4) }, + { USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */ diff --git a/queue-6.1/usb-serial-qcserial-add-new-usb-id-for-dell-wireless-dw5826e.patch b/queue-6.1/usb-serial-qcserial-add-new-usb-id-for-dell-wireless-dw5826e.patch new file mode 100644 index 00000000000..10fbe1c251b --- /dev/null +++ b/queue-6.1/usb-serial-qcserial-add-new-usb-id-for-dell-wireless-dw5826e.patch @@ -0,0 +1,71 @@ +From 129690fb229a20b6e563a77a2c85266acecf20bc Mon Sep 17 00:00:00 2001 +From: JackBB Wu +Date: Tue, 23 Jan 2024 17:39:48 +0800 +Subject: USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e + +From: JackBB Wu + +commit 129690fb229a20b6e563a77a2c85266acecf20bc upstream. + +Add support for Dell DW5826e with USB-id 0x413c:0x8217 & 0x413c:0x8218. + +It is 0x413c:0x8217 +T: Bus=02 Lev=01 Prnt=01 Port=05 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=413c ProdID=8217 Rev= 5.04 +S: Manufacturer=DELL +S: Product=COMPAL Electronics EXM-G1A +S: SerialNumber=359302940050401 +C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=qcserial +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=qcserial +E: Ad=84(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=qcserial +E: Ad=86(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) +E: Ad=87(I) Atr=03(Int.) MxPS= 64 Ivl=32ms +I:* If#= 8 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan +E: Ad=88(I) Atr=03(Int.) MxPS= 8 Ivl=32ms +E: Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +It is 0x413c:0x8218 +T: Bus=02 Lev=01 Prnt=01 Port=05 Cnt=01 Dev#= 3 Spd=480 MxCh= 0 +D: Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 +P: Vendor=413c ProdID=8218 Rev= 0.00 +S: Manufacturer=DELL +S: Product=COMPAL Electronics EXM-G1A +S: SerialNumber=359302940050401 +C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr= 2mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=qcserial +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +Signed-off-by: JackBB Wu +Cc: stable@vger.kernel.org +Signed-off-by: Johan Hovold +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/serial/qcserial.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/usb/serial/qcserial.c ++++ b/drivers/usb/serial/qcserial.c +@@ -184,6 +184,8 @@ static const struct usb_device_id id_tab + {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ + {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */ + {DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 */ ++ {DEVICE_SWI(0x413c, 0x8217)}, /* Dell Wireless DW5826e */ ++ {DEVICE_SWI(0x413c, 0x8218)}, /* Dell Wireless DW5826e QDL */ + + /* Huawei devices */ + {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */ diff --git a/queue-6.1/xhci-handle-isoc-babble-and-buffer-overrun-events-properly.patch b/queue-6.1/xhci-handle-isoc-babble-and-buffer-overrun-events-properly.patch new file mode 100644 index 00000000000..e5f6832bd46 --- /dev/null +++ b/queue-6.1/xhci-handle-isoc-babble-and-buffer-overrun-events-properly.patch @@ -0,0 +1,51 @@ +From 7c4650ded49e5b88929ecbbb631efb8b0838e811 Mon Sep 17 00:00:00 2001 +From: Michal Pecio +Date: Thu, 25 Jan 2024 17:27:37 +0200 +Subject: xhci: handle isoc Babble and Buffer Overrun events properly + +From: Michal Pecio + +commit 7c4650ded49e5b88929ecbbb631efb8b0838e811 upstream. + +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 +Cc: stable@vger.kernel.org +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20240125152737.2983959-5-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-ring.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -2381,9 +2381,13 @@ static int process_isoc_td(struct xhci_h + 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: diff --git a/queue-6.1/xhci-process-isoc-td-properly-when-there-was-a-transaction-error-mid-td.patch b/queue-6.1/xhci-process-isoc-td-properly-when-there-was-a-transaction-error-mid-td.patch new file mode 100644 index 00000000000..abb6467b770 --- /dev/null +++ b/queue-6.1/xhci-process-isoc-td-properly-when-there-was-a-transaction-error-mid-td.patch @@ -0,0 +1,177 @@ +From 5372c65e1311a16351ef03dd096ff576e6477674 Mon Sep 17 00:00:00 2001 +From: Mathias Nyman +Date: Thu, 25 Jan 2024 17:27:36 +0200 +Subject: xhci: process isoc TD properly when there was a transaction error mid TD. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Mathias Nyman + +commit 5372c65e1311a16351ef03dd096ff576e6477674 upstream. + +The last TRB of a isoc TD might not trigger an event if there was +an error event for a TRB mid TD. This is seen on a NEC Corporation +uPD720200 USB 3.0 Host + +After an error mid a multi-TRB TD the xHC should according to xhci 4.9.1 +generate events for passed TRBs with IOC flag set if it proceeds to the +next TD. This event is either a copy of the original error, or a +"success" transfer event. + +If that event is missing then the driver and xHC host get out of sync as +the driver is still expecting a transfer event for that first TD, while +xHC host is already sending events for the next TD in the list. +This leads to +"Transfer event TRB DMA ptr not part of current TD" messages. + +As a solution we tag the isoc TDs that get error events mid TD. +If an event doesn't match the first TD, then check if the tag is +set, and event points to the next TD. +In that case give back the fist TD and process the next TD normally + +Make sure TD status and transferred length stay valid in both cases +with and without final TD completion event. + +Reported-by: Michał Pecio +Closes: https://lore.kernel.org/linux-usb/20240112235205.1259f60c@foxbook/ +Tested-by: Michał Pecio +Cc: stable@vger.kernel.org +Signed-off-by: Mathias Nyman +Link: https://lore.kernel.org/r/20240125152737.2983959-4-mathias.nyman@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/xhci-ring.c | 74 ++++++++++++++++++++++++++++++++++--------- + drivers/usb/host/xhci.h | 1 + 2 files changed, 61 insertions(+), 14 deletions(-) + +--- a/drivers/usb/host/xhci-ring.c ++++ b/drivers/usb/host/xhci-ring.c +@@ -2363,6 +2363,9 @@ static int process_isoc_td(struct xhci_h + /* handle completion code */ + switch (trb_comp_code) { + case COMP_SUCCESS: ++ /* Don't overwrite status if TD had an error, see xHCI 4.9.1 */ ++ if (td->error_mid_td) ++ break; + if (remaining) { + frame->status = short_framestatus; + if (xhci->quirks & XHCI_TRUST_TX_LENGTH) +@@ -2388,8 +2391,9 @@ static int process_isoc_td(struct xhci_h + break; + case COMP_USB_TRANSACTION_ERROR: + frame->status = -EPROTO; ++ sum_trbs_for_length = true; + if (ep_trb != td->last_trb) +- return 0; ++ td->error_mid_td = true; + break; + case COMP_STOPPED: + sum_trbs_for_length = true; +@@ -2409,6 +2413,9 @@ static int process_isoc_td(struct xhci_h + break; + } + ++ if (td->urb_length_set) ++ goto finish_td; ++ + if (sum_trbs_for_length) + frame->actual_length = sum_trb_lengths(xhci, ep->ring, ep_trb) + + ep_trb_len - remaining; +@@ -2417,6 +2424,14 @@ static int process_isoc_td(struct xhci_h + + td->urb->actual_length += frame->actual_length; + ++finish_td: ++ /* Don't give back TD yet if we encountered an error mid TD */ ++ if (td->error_mid_td && ep_trb != td->last_trb) { ++ xhci_dbg(xhci, "Error mid isoc TD, wait for final completion event\n"); ++ td->urb_length_set = true; ++ return 0; ++ } ++ + return finish_td(xhci, ep, ep_ring, td, trb_comp_code); + } + +@@ -2801,17 +2816,51 @@ static int handle_tx_event(struct xhci_h + } + + if (!ep_seg) { +- if (!ep->skip || +- !usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { +- /* Some host controllers give a spurious +- * successful event after a short transfer. +- * Ignore it. +- */ +- if ((xhci->quirks & XHCI_SPURIOUS_SUCCESS) && +- ep_ring->last_td_was_short) { +- ep_ring->last_td_was_short = false; +- goto cleanup; ++ ++ if (ep->skip && usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { ++ skip_isoc_td(xhci, td, ep, status); ++ goto cleanup; ++ } ++ ++ /* ++ * Some hosts give a spurious success event after a short ++ * transfer. Ignore it. ++ */ ++ if ((xhci->quirks & XHCI_SPURIOUS_SUCCESS) && ++ ep_ring->last_td_was_short) { ++ ep_ring->last_td_was_short = false; ++ goto cleanup; ++ } ++ ++ /* ++ * xhci 4.10.2 states isoc endpoints should continue ++ * processing the next TD if there was an error mid TD. ++ * So host like NEC don't generate an event for the last ++ * isoc TRB even if the IOC flag is set. ++ * xhci 4.9.1 states that if there are errors in mult-TRB ++ * TDs xHC should generate an error for that TRB, and if xHC ++ * proceeds to the next TD it should genete an event for ++ * any TRB with IOC flag on the way. Other host follow this. ++ * So this event might be for the next TD. ++ */ ++ if (td->error_mid_td && ++ !list_is_last(&td->td_list, &ep_ring->td_list)) { ++ struct xhci_td *td_next = list_next_entry(td, td_list); ++ ++ ep_seg = trb_in_td(xhci, td_next->start_seg, td_next->first_trb, ++ td_next->last_trb, ep_trb_dma, false); ++ if (ep_seg) { ++ /* give back previous TD, start handling new */ ++ xhci_dbg(xhci, "Missing TD completion event after mid TD error\n"); ++ ep_ring->dequeue = td->last_trb; ++ ep_ring->deq_seg = td->last_trb_seg; ++ inc_deq(xhci, ep_ring); ++ xhci_td_cleanup(xhci, td, ep_ring, td->status); ++ td = td_next; + } ++ } ++ ++ if (!ep_seg) { + /* HC is busted, give up! */ + xhci_err(xhci, + "ERROR Transfer event TRB DMA ptr not " +@@ -2823,9 +2872,6 @@ static int handle_tx_event(struct xhci_h + ep_trb_dma, true); + return -ESHUTDOWN; + } +- +- skip_isoc_td(xhci, td, ep, status); +- goto cleanup; + } + if (trb_comp_code == COMP_SHORT_PACKET) + ep_ring->last_td_was_short = true; +--- a/drivers/usb/host/xhci.h ++++ b/drivers/usb/host/xhci.h +@@ -1570,6 +1570,7 @@ struct xhci_td { + struct xhci_segment *bounce_seg; + /* actual_length of the URB has already been set */ + bool urb_length_set; ++ bool error_mid_td; + unsigned int num_trbs; + }; +