Hi, We have a board with an NXP i.MX8 SoC. We are running Linux 4.19.35 from NXP on the SoC. There is a modem connected to the SoC via USB through a USB hub. The modem presents it self as a cdc-acm device with 4 tty:s. Sometimes we end up in a situation where all transfers over USB generetes 'USB transaction Errors". It is likely that the modem is misbehaving. When this happens we get a lot of "xhci-cdns3: ERROR unknown event type 37" in the terminal indicating that the xhci event ring is full. This often leads to RCU stalls and sometimes Kernel panics. If I enable dynamic debug on xhci_hcd and cdc-acm I can see that all transfers have error code -71 (-EPROTO which in xhci translates to 'USB transaction error"). When this happens it seems like xhci resets the ep, sets TR Deq Ptr to unstall the ep and then a new transfer is started which also fails. This behavior generates a lot of events on the event ring which causes 'ERROR unknown event type 37'. This loop of failing transfers seems to continue until we either unbind the USB driver or get a kernel panic. The SoC almost becomes unresponsive since it spends most of the time executing usb interrupts. If I pull the reset pin of the USB hub and keep it in reset state at this point, the event loop of failing transfers continues despite there is nothing on the USB bus any longer. The only way to get out of that loop is to either unbind the usb driver or power cycle the board. Is this the expected behavior when USB transaction error happens for all transfers when using cdc-acm class driver? Or could there be something wrong in the low level USB driver (Cadence in our case)? We need to figure out why we get all the transaction errors but we also need to make sure the kernel does not die on us when we have a misbehaving USB device. Does anyone have a suggestion on what we could do to improve the stability of the kernel in this situation? There is a small extract from the dynamic debug log in the attached text file. Thanks in advance! BR, Jonas
[ 1441.993575] cdc_acm 1-1.1:1.7: acm_read_bulk_callback - nonzero urb status received: -71 [ 1441.993583] xhci-cdns3: Transfer error for slot 4 ep 10 on endpoint [ 1441.993592] xhci-cdns3: Cleaning up stalled endpoint ring [ 1441.993598] xhci-cdns3: Finding endpoint context [ 1441.993603] xhci-cdns3: Cycle state = 0x1 [ 1441.993609] xhci-cdns3: New dequeue segment = 000000000c9bcd9e (virtual) [ 1441.993615] xhci-cdns3: New dequeue pointer = 0x960d57a0 (DMA) [ 1441.993618] xhci-cdns3: Queueing new dequeue state [ 1441.993628] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 000000000c9bcd9e (0x960d5000 dma), new deq ptr = 00000000517b4ddd (0x960d57a0 dma), new cycle = 1 [ 1441.993632] xhci-cdns3: // Ding dong! [ 1441.993638] xhci-cdns3: Giveback URB 0000000088e15531, len = 0, expected = 1024, status = -71 [ 1441.993646] cdc_acm 1-1.1:1.5: acm_read_bulk_callback - nonzero urb status received: -71 [ 1441.993653] xhci-cdns3: Transfer error for slot 4 ep 2 on endpoint [ 1441.993660] xhci-cdns3: Cleaning up stalled endpoint ring [ 1441.993666] xhci-cdns3: Finding endpoint context [ 1441.993670] xhci-cdns3: Cycle state = 0x1 [ 1441.993674] xhci-cdns3: New dequeue segment = 00000000f8498859 (virtual) [ 1441.993682] xhci-cdns3: New dequeue pointer = 0x960e1790 (DMA) [ 1441.993686] xhci-cdns3: Queueing new dequeue state [ 1441.993693] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000f8498859 (0x960e1000 dma), new deq ptr = 00000000859578a2 (0x960e1790 dma), new cycle = 1 [ 1441.993697] xhci-cdns3: // Ding dong! [ 1441.993704] xhci-cdns3: Giveback URB 00000000b4b1f8f0, len = 0, expected = 1024, status = -71 [ 1441.993713] cdc_acm 1-1.1:1.1: acm_read_bulk_callback - nonzero urb status received: -71 [ 1441.993720] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1441.993728] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960db780 [ 1441.993737] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1441.993744] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960cf790 [ 1441.993752] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1441.993760] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960d57a0 [ 1441.993768] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1441.993776] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960e1790 [ 1441.993783] xhci-cdns3: Transfer error for slot 4 ep 6 on endpoint [ 1441.993791] xhci-cdns3: Cleaning up stalled endpoint ring [ 1441.993795] xhci-cdns3: Finding endpoint context [ 1441.993800] xhci-cdns3: Cycle state = 0x1 [ 1441.993804] xhci-cdns3: New dequeue segment = 00000000ee417449 (virtual) [ 1441.993812] xhci-cdns3: New dequeue pointer = 0x960db790 (DMA) [ 1441.993817] xhci-cdns3: Queueing new dequeue state [ 1441.993826] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000ee417449 (0x960db000 dma), new deq ptr = 00000000fb2a5379 (0x960db790 dma), new cycle = 1 [ 1441.993830] xhci-cdns3: // Ding dong! [ 1441.993837] xhci-cdns3: Giveback URB 00000000df81c243, len = 0, expected = 1024, status = -71 [ 1441.993844] cdc_acm 1-1.1:1.3: acm_read_bulk_callback - nonzero urb status received: -71 [ 1441.993851] xhci-cdns3: ERROR unknown event type 37 [ 1441.998892] xhci-cdns3: Transfer error for slot 4 ep 14 on endpoint [ 1441.998904] xhci-cdns3: Cleaning up stalled endpoint ring [ 1441.998909] xhci-cdns3: Finding endpoint context [ 1441.998914] xhci-cdns3: Cycle state = 0x1 [ 1441.998919] xhci-cdns3: New dequeue segment = 00000000ac1d2602 (virtual) [ 1441.998923] xhci-cdns3: New dequeue pointer = 0x960cf7a0 (DMA) [ 1441.998927] xhci-cdns3: Queueing new dequeue state [ 1441.998935] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000ac1d2602 (0x960cf000 dma), new deq ptr = 0000000065ceabc8 (0x960cf7a0 dma), new cycle = 1 [ 1441.998940] xhci-cdns3: // Ding dong! [ 1441.998947] xhci-cdns3: Giveback URB 00000000ceb7124e, len = 0, expected = 1024, status = -71 [ 1441.998963] xhci-cdns3: Cancel URB 0000000008a0c978, dev 1.1, ep 0x81, starting at offset 0x960e1790 [ 1441.998966] cdc_acm 1-1.1:1.7: acm_read_bulk_callback - nonzero urb status received: -71 [ 1441.998975] xhci-cdns3: // Ding dong! [ 1441.998982] xhci-cdns3: Transfer error for slot 4 ep 10 on endpoint [ 1441.998990] xhci-cdns3: Cleaning up stalled endpoint ring [ 1441.998994] xhci-cdns3: Finding endpoint context [ 1441.998999] xhci-cdns3: Cycle state = 0x1 [ 1441.999004] xhci-cdns3: New dequeue segment = 000000000c9bcd9e (virtual) [ 1441.999008] xhci-cdns3: New dequeue pointer = 0x960d57b0 (DMA) [ 1441.999011] xhci-cdns3: Queueing new dequeue state [ 1441.999019] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 000000000c9bcd9e (0x960d5000 dma), new deq ptr = 00000000a1dba0e6 (0x960d57b0 dma), new cycle = 1 [ 1441.999023] xhci-cdns3: // Ding dong! [ 1441.999029] xhci-cdns3: Giveback URB 00000000bc5e4e6f, len = 0, expected = 1024, status = -71 [ 1441.999036] cdc_acm 1-1.1:1.5: acm_read_bulk_callback - nonzero urb status received: -71 [ 1441.999043] xhci-cdns3: Transfer error for slot 4 ep 2 on endpoint [ 1441.999050] xhci-cdns3: Cleaning up stalled endpoint ring [ 1441.999056] xhci-cdns3: Finding endpoint context [ 1441.999060] xhci-cdns3: Cycle state = 0x1 [ 1441.999067] xhci-cdns3: New dequeue segment = 00000000f8498859 (virtual) [ 1441.999071] xhci-cdns3: New dequeue pointer = 0x960e17a0 (DMA) [ 1441.999078] xhci-cdns3: Queueing new dequeue state [ 1441.999087] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000f8498859 (0x960e1000 dma), new deq ptr = 000000006daa01a0 (0x960e17a0 dma), new cycle = 1 [ 1441.999091] xhci-cdns3: // Ding dong! [ 1441.999097] xhci-cdns3: Giveback URB 0000000008a0c978, len = 0, expected = 1024, status = -71 [ 1441.999106] cdc_acm 1-1.1:1.1: acm_read_bulk_callback - urb shutting down with status: -2 [ 1441.999122] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1441.999136] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960db790 [ 1441.999144] xhci-cdns3: Transfer error for slot 4 ep 8 on endpoint [ 1441.999153] xhci-cdns3: Cleaning up stalled endpoint ring [ 1441.999157] xhci-cdns3: Finding endpoint context [ 1441.999161] xhci-cdns3: Cycle state = 0x1 [ 1441.999168] xhci-cdns3: New dequeue segment = 000000001a60a203 (virtual) [ 1441.999174] xhci-cdns3: New dequeue pointer = 0x960dd100 (DMA) [ 1441.999178] xhci-cdns3: Queueing new dequeue state [ 1441.999187] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 000000001a60a203 (0x960dd000 dma), new deq ptr = 00000000d1422a78 (0x960dd100 dma), new cycle = 1 [ 1441.999191] xhci-cdns3: // Ding dong! [ 1441.999199] xhci-cdns3: Giveback URB 00000000345763b1, len = 0, expected = 64, status = -71 [ 1441.999207] cdc_acm 1-1.1:1.2: acm_ctrl_irq - nonzero urb status received: -71 [ 1441.999213] cdc_acm 1-1.1:1.2: acm_ctrl_irq - usb_submit_urb failed: -19 [ 1441.999525] xhci-cdns3: Cancel URB 00000000a6a6ab1e, dev 1.1, ep 0x81, starting at offset 0x960e17a0 [ 1442.005923] xhci-cdns3: Transfer error for slot 4 ep 12 on endpoint [ 1442.005931] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.005937] xhci-cdns3: Finding endpoint context [ 1442.005941] xhci-cdns3: Cycle state = 0x1 [ 1442.005946] xhci-cdns3: New dequeue segment = 0000000025ea4691 (virtual) [ 1442.005950] xhci-cdns3: New dequeue pointer = 0x960d7100 (DMA) [ 1442.005954] xhci-cdns3: Queueing new dequeue state [ 1442.005961] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 0000000025ea4691 (0x960d7000 dma), new deq ptr = 000000009395bf33 (0x960d7100 dma), new cycle = 1 [ 1442.005966] xhci-cdns3: // Ding dong! [ 1442.005972] xhci-cdns3: Giveback URB 000000006bef3965, len = 0, expected = 64, status = -71 [ 1442.005979] cdc_acm 1-1.1:1.4: acm_ctrl_irq - nonzero urb status received: -71 [ 1442.005985] cdc_acm 1-1.1:1.4: acm_ctrl_irq - usb_submit_urb failed: -19 [ 1442.012694] xhci-cdns3: Transfer error for slot 4 ep 16 on endpoint [ 1442.012706] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.012710] xhci-cdns3: Finding endpoint context [ 1442.012716] xhci-cdns3: Cycle state = 0x1 [ 1442.012721] xhci-cdns3: New dequeue segment = 0000000059d8bf74 (virtual) [ 1442.012726] xhci-cdns3: New dequeue pointer = 0x960d1100 (DMA) [ 1442.012730] xhci-cdns3: Queueing new dequeue state [ 1442.012737] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 0000000059d8bf74 (0x960d1000 dma), new deq ptr = 00000000bb418036 (0x960d1100 dma), new cycle = 1 [ 1442.012743] xhci-cdns3: // Ding dong! [ 1442.012750] xhci-cdns3: Giveback URB 00000000a1d029a3, len = 0, expected = 64, status = -71 [ 1442.012762] cdc_acm 1-1.1:1.6: acm_ctrl_irq - nonzero urb status received: -71 [ 1442.012768] cdc_acm 1-1.1:1.6: acm_ctrl_irq - usb_submit_urb failed: -19 [ 1442.019481] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.019495] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960cf7a0 [ 1442.019507] xhci-cdns3: Removing canceled TD starting at 0x960e17a0 (dma). [ 1442.019513] xhci-cdns3: Finding endpoint context [ 1442.019518] xhci-cdns3: Cycle state = 0x1 [ 1442.019524] xhci-cdns3: New dequeue segment = 00000000f8498859 (virtual) [ 1442.019528] xhci-cdns3: New dequeue pointer = 0x960e17b0 (DMA) [ 1442.019537] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000f8498859 (0x960e1000 dma), new deq ptr = 00000000ab4e2e42 (0x960e17b0 dma), new cycle = 1 [ 1442.019542] xhci-cdns3: WARN Cannot submit Set TR Deq Ptr [ 1442.025032] xhci-cdns3: A Set TR Deq Ptr command is pending. [ 1442.030784] xhci-cdns3: // Ding dong! [ 1442.030797] cdc_acm 1-1.1:1.1: acm_read_bulk_callback - urb shutting down with status: -2 [ 1442.030829] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.030840] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960d57b0 [ 1442.030849] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.030857] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960e17a0 [ 1442.030866] xhci-cdns3: Transfer error for slot 4 ep 6 on endpoint [ 1442.030878] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.030883] xhci-cdns3: Finding endpoint context [ 1442.030888] xhci-cdns3: Cycle state = 0x1 [ 1442.030894] xhci-cdns3: New dequeue segment = 00000000ee417449 (virtual) [ 1442.030899] xhci-cdns3: New dequeue pointer = 0x960db7a0 (DMA) [ 1442.030902] xhci-cdns3: Queueing new dequeue state [ 1442.030910] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000ee417449 (0x960db000 dma), new deq ptr = 00000000a776aa38 (0x960db7a0 dma), new cycle = 1 [ 1442.030915] xhci-cdns3: // Ding dong! [ 1442.030923] xhci-cdns3: Giveback URB 00000000a65996b7, len = 0, expected = 1024, status = -71 [ 1442.030934] cdc_acm 1-1.1:1.3: acm_read_bulk_callback - nonzero urb status received: -71 [ 1442.030944] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.030953] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960dd100 [ 1442.030962] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.030970] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960d7100 [ 1442.030977] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.030986] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960d1100 [ 1442.030993] xhci-cdns3: Transfer error for slot 4 ep 14 on endpoint [ 1442.031001] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.031007] xhci-cdns3: Finding endpoint context [ 1442.031011] xhci-cdns3: Cycle state = 0x1 [ 1442.031018] xhci-cdns3: New dequeue segment = 00000000ac1d2602 (virtual) [ 1442.031024] xhci-cdns3: New dequeue pointer = 0x960cf7b0 (DMA) [ 1442.031028] xhci-cdns3: Queueing new dequeue state [ 1442.031035] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000ac1d2602 (0x960cf000 dma), new deq ptr = 00000000af71c4e0 (0x960cf7b0 dma), new cycle = 1 [ 1442.031039] xhci-cdns3: // Ding dong! [ 1442.031047] xhci-cdns3: Giveback URB 000000001c7f9bc2, len = 0, expected = 1024, status = -71 [ 1442.031055] cdc_acm 1-1.1:1.7: acm_read_bulk_callback - nonzero urb status received: -71 [ 1442.031064] xhci-cdns3: Cancel URB 000000002c66c1ab, dev 1.1, ep 0x81, starting at offset 0x960e17b0 [ 1442.031076] xhci-cdns3: // Ding dong! [ 1442.031083] xhci-cdns3: Transfer error for slot 4 ep 10 on endpoint [ 1442.031092] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.031096] xhci-cdns3: Finding endpoint context [ 1442.031100] xhci-cdns3: Cycle state = 0x1 [ 1442.031105] xhci-cdns3: New dequeue segment = 000000000c9bcd9e (virtual) [ 1442.031109] xhci-cdns3: New dequeue pointer = 0x960d57c0 (DMA) [ 1442.031113] xhci-cdns3: Queueing new dequeue state [ 1442.031120] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 000000000c9bcd9e (0x960d5000 dma), new deq ptr = 00000000499e04fe (0x960d57c0 dma), new cycle = 1 [ 1442.031124] xhci-cdns3: // Ding dong! [ 1442.031131] xhci-cdns3: Giveback URB 00000000706d0623, len = 0, expected = 1024, status = -71 [ 1442.031139] cdc_acm 1-1.1:1.5: acm_read_bulk_callback - nonzero urb status received: -71 [ 1442.031146] xhci-cdns3: Transfer error for slot 4 ep 2 on endpoint [ 1442.031153] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.031157] xhci-cdns3: Finding endpoint context [ 1442.031162] xhci-cdns3: Cycle state = 0x1 [ 1442.031166] xhci-cdns3: New dequeue segment = 00000000f8498859 (virtual) [ 1442.031171] xhci-cdns3: New dequeue pointer = 0x960e17c0 (DMA) [ 1442.031174] xhci-cdns3: Queueing new dequeue state [ 1442.031182] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000f8498859 (0x960e1000 dma), new deq ptr = 0000000095491dfe (0x960e17c0 dma), new cycle = 1 [ 1442.031191] xhci-cdns3: // Ding dong! [ 1442.031197] xhci-cdns3: Giveback URB 000000002c66c1ab, len = 0, expected = 1024, status = -71 [ 1442.031204] cdc_acm 1-1.1:1.1: acm_read_bulk_callback - urb shutting down with status: -2 [ 1442.031221] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.031232] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960db7a0 [ 1442.031240] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.031248] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960cf7b0 [ 1442.031260] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.031268] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960d57c0 [ 1442.031276] xhci-cdns3: Ignoring reset ep completion code of 1 [ 1442.031283] xhci-cdns3: Successful Set TR Deq Ptr cmd, deq = @960e17c0 [ 1442.031290] xhci-cdns3: Transfer error for slot 4 ep 6 on endpoint [ 1442.031298] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.031302] xhci-cdns3: Finding endpoint context [ 1442.031307] xhci-cdns3: Cycle state = 0x1 [ 1442.031311] xhci-cdns3: New dequeue segment = 00000000ee417449 (virtual) [ 1442.031319] xhci-cdns3: New dequeue pointer = 0x960db7b0 (DMA) [ 1442.031325] xhci-cdns3: Queueing new dequeue state [ 1442.031334] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000ee417449 (0x960db000 dma), new deq ptr = 00000000f5afdb5d (0x960db7b0 dma), new cycle = 1 [ 1442.031338] xhci-cdns3: // Ding dong! [ 1442.031346] xhci-cdns3: Giveback URB 0000000037b702d9, len = 0, expected = 1024, status = -71 [ 1442.031355] xhci-cdns3: Cancel URB 00000000994cb7b8, dev 1.1, ep 0x81, starting at offset 0x960e17c0 [ 1442.031358] cdc_acm 1-1.1:1.3: acm_read_bulk_callback - nonzero urb status received: -71 [ 1442.031365] xhci-cdns3: // Ding dong! [ 1442.031371] xhci-cdns3: Transfer error for slot 4 ep 14 on endpoint [ 1442.031378] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.031382] xhci-cdns3: Finding endpoint context [ 1442.031387] xhci-cdns3: Cycle state = 0x1 [ 1442.031391] xhci-cdns3: New dequeue segment = 00000000ac1d2602 (virtual) [ 1442.031396] xhci-cdns3: New dequeue pointer = 0x960cf7c0 (DMA) [ 1442.031406] xhci-cdns3: Queueing new dequeue state [ 1442.031413] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 00000000ac1d2602 (0x960cf000 dma), new deq ptr = 0000000095b33802 (0x960cf7c0 dma), new cycle = 1 [ 1442.031418] xhci-cdns3: // Ding dong! [ 1442.031425] xhci-cdns3: Giveback URB 00000000603b8c7f, len = 0, expected = 1024, status = -71 [ 1442.031432] cdc_acm 1-1.1:1.7: acm_read_bulk_callback - nonzero urb status received: -71 [ 1442.031439] xhci-cdns3: Transfer error for slot 4 ep 10 on endpoint [ 1442.031446] xhci-cdns3: Cleaning up stalled endpoint ring [ 1442.031449] xhci-cdns3: Finding endpoint context [ 1442.031454] xhci-cdns3: Cycle state = 0x1 [ 1442.031459] xhci-cdns3: New dequeue segment = 000000000c9bcd9e (virtual) [ 1442.031463] xhci-cdns3: New dequeue pointer = 0x960d57d0 (DMA) [ 1442.031467] xhci-cdns3: Queueing new dequeue state [ 1442.031476] xhci-cdns3: Set TR Deq Ptr cmd, new deq seg = 000000000c9bcd9e (0x960d5000 dma), new deq ptr = 0000000045f279ed (0x960d57d0 dma), new cycle = 1 [ 1442.031480] xhci-cdns3: // Ding dong! [ 1442.031486] xhci-cdns3: Giveback URB 00000000bcdb9296, len = 0, expected = 1024, status = -71