• Oliver Neukum's avatar
    USB: dwc2: write HCINT with INTMASK applied · 0583bc77
    Oliver Neukum authored
    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: default avatarOliver Neukum <oneukum@suse.com>
    Tested-by: default avatarIvan Ivanov <ivan.ivanov@suse.com>
    Tested-by: default avatarAndrea 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    0583bc77
hcd_intr.c 65.4 KB