linux-stable/drivers/usb/dwc2
Oliver Neukum 451c5a6172 USB: dwc2: write HCINT with INTMASK applied
commit 0583bc776c upstream.

dwc2_hc_n_intr() writes back INTMASK as read but evaluates it
with intmask applied. In stress testing this causes spurious
interrupts like this:

[Mon Aug 14 10:51:07 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 7 - ChHltd set, but reason is unknown
[Mon Aug 14 10:51:07 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001
[Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 0 - ChHltd set, but reason is unknown
[Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001
[Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 4 - ChHltd set, but reason is unknown
[Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001
[Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_update_urb_state_abn(): trimming xfer length

Applying INTMASK prevents this. The issue exists in all versions of the
driver.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Tested-by: Ivan Ivanov <ivan.ivanov@suse.com>
Tested-by: Andrea della Porta <andrea.porta@suse.com>
Link: https://lore.kernel.org/r/20231115144514.15248-1-oneukum@suse.com
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-03 07:32:12 +01:00
..
core.c
core.h
core_intr.c
debug.h
debugfs.c
drd.c
gadget.c
hcd.c usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency 2023-11-20 11:52:10 +01:00
hcd.h
hcd_ddma.c
hcd_intr.c USB: dwc2: write HCINT with INTMASK applied 2023-12-03 07:32:12 +01:00
hcd_queue.c
hw.h
Kconfig
Makefile
params.c
pci.c
platform.c usb: dwc2: Fix some error handling paths 2023-07-19 16:21:49 +02:00