Hi Andrea, On 12/18/23 18:36, Andrea della Porta wrote: > Hi Minas, > > On 12:23 Thu 14 Dec , Minas Harutyunyan wrote: >> Hi Andrea, >> >> On 12/3/23 10:52, Andrea della Porta wrote: >>> Hi Minas, >>> >>> On 10:26 Fri 01 Dec , Minas Harutyunyan wrote: >>>> Hi Ivan, >>>> >>>> On 11/28/23 18:43, Ivan Ivanov wrote: >>>>> >>>>> Hi Minas, >>>>> >>>>> On Tue, 2023-11-28 at 11:48 +0000, Minas Harutyunyan wrote: >>>>>> >>>>>> Does this "spurious" interrupt broke your tests? >>>>> >>>>> It is not just some kind of synthetic test case that was broken. >>>>> but real world usage. You can find complains about this error on >>>>> various internet forums, just search for dwc2_hc_chhltd_intr_dma >>>>> and it is not so difficult to reproduce. >>>>> >>>>> Without databook I am not sure we can create better fix, but if >>>>> you develop different solution I will gladly tested it. >>>>> >>>>> Regards, >>>>> Ivan >>>> 1. In addition to HCCHARx and ep_type printing please add printing of >>>> GRXFSTSR if EP is IN or GNPTXSTS if EP is OUT, and provide dmesg with >>>> error case. >>> >>> Here's the log, before comenting the 'goto' out: >>> >>> >>> [684829.206854] --Host Channel Interrupt--, Channel 2 >>> [684829.206866] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 >>> [684829.206875] hcchar[2] = 0x015c9810, chan->ep_type=3 >>> [684829.206883] GRXSTSR = 0x000E0002 >>> [684829.214851] --Host Channel Interrupt--, Channel 6 >>> [684829.214864] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 >>> [684829.214876] hcchar[6] = 0x015c9810, chan->ep_type=3 >>> [684829.214886] GRXSTSR = 0x000E0007 >>> [684829.217853] --Host Channel Interrupt--, Channel 5 >>> [684829.217869] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 >>> [684829.217881] hcchar[5] = 0x009c8801, chan->ep_type=3 >>> [684829.217891] GRXSTSR = 0x000E0005 >>> [684829.222647] --Host Channel Interrupt--, Channel 0 >>> [684829.222659] hcint 0x00000021, hcintmsk 0x00000426, hcint&hcintmsk 0x00000020 >>> [684829.222671] hcchar[0] = 0x01d8d200, chan->ep_type=2 >>> [684829.222681] GRXSTSR = 0x00070044 >>> [684829.222696] --Host Channel Interrupt--, Channel 0 >>> [684829.222704] hcint 0x00000002, hcintmsk 0x00000406, hcint&hcintmsk 0x00000002 >>> [684829.222714] hcchar[0] = 0x01d8d200, chan->ep_type=2 >>> [684829.222724] GRXSTSR = 0x00070044 >>> [684829.222740] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 0 - ChHltd set, but reason is unknown >>> [684829.222758] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04000009 >> >> >> Sorry for delayed response. >> I guess the cause of issue is because of channel halted interrupt late >> for about ~40-50us. In above log, Channel 0 twice assert interrupt: >> first for ACK (XferComplete masked) and second for Channel_Halted. These >> all interrupts related to same BULK IN transfer. Ideally these 3 source >> of interrupt (ACK, XferCompl and ChHalt) should be asserted together. >> To check it lets do follow: >> 1. Do not allow unmask ACK interrupt in function >> dwc2_hc_enable_dma_ints(). Just comment "hcintmsk |= HCINTMSK_ACK;" >> 2. remove comment for "goto error" >> 3. remove printing GRXSTSR and GNPTXSTS >> 4. build in non verbose debug mode >> It's just temporary solution to check ACK influence on the issue. >> >> Thanks, >> Minas > > Testing the changes you suggested revealed that "ChHltd set, but reason is unknown" error > is not showing up anymore, but we now have some "Transaction error" as shown in the > following log: > > > [13941.590252] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.590263] hcchar[5] = 0x00dc8801, chan->ep_type=3 > [13941.592240] --Host Channel Interrupt--, Channel 4 > [13941.592249] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.592258] hcchar[4] = 0x015c9810, chan->ep_type=3 > [13941.600243] --Host Channel Interrupt--, Channel 2 > [13941.600263] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.600273] hcchar[2] = 0x015c9810, chan->ep_type=3 > [13941.605521] --Host Channel Interrupt--, Channel 3 > [13941.605539] hcint 0x00000003, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.605549] hcchar[3] = 0x01d83200, chan->ep_type=2 > [13941.608242] --Host Channel Interrupt--, Channel 6 > [13941.608256] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.608266] hcchar[6] = 0x015c9810, chan->ep_type=3 > [13941.609685] --Host Channel Interrupt--, Channel 1 > [13941.609696] hcint 0x00000023, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.609706] hcchar[1] = 0x01d8d200, chan->ep_type=2 > [13941.616243] --Host Channel Interrupt--, Channel 5 > [13941.616262] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.616272] hcchar[5] = 0x015c9810, chan->ep_type=3 > [13941.619514] --Host Channel Interrupt--, Channel 0 > [13941.619527] hcint 0x00000023, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.619538] hcchar[0] = 0x01d8d200, chan->ep_type=2 > [13941.620015] --Host Channel Interrupt--, Channel 2 > [13941.620027] hcint 0x00000003, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.620037] hcchar[2] = 0x01d83200, chan->ep_type=2 > [13941.624240] --Host Channel Interrupt--, Channel 3 > [13941.624249] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.624259] hcchar[3] = 0x015c9810, chan->ep_type=3 > [13941.627347] --Host Channel Interrupt--, Channel 4 > [13941.627363] hcint 0x00000092, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.627373] hcchar[4] = 0x01d8d200, chan->ep_type=2 > [13941.627391] dwc2 3f980000.usb: --Host Channel 4 Interrupt: Transaction Error-- > [13941.627432] --Host Channel Interrupt--, Channel 6 > [13941.627440] hcint 0x00000010, hcintmsk 0x00000416, hcint&hcintmsk 0x00000010 > [13941.627450] hcchar[6] = 0x81d8d200, chan->ep_type=2 > [13941.632240] --Host Channel Interrupt--, Channel 1 > [13941.632248] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.632257] hcchar[1] = 0x015c9810, chan->ep_type=3 > [13941.635528] --Host Channel Interrupt--, Channel 5 > [13941.635543] hcint 0x00000003, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.635553] hcchar[5] = 0x01d83200, chan->ep_type=2 > [13941.640244] --Host Channel Interrupt--, Channel 0 > [13941.640263] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.640272] hcchar[0] = 0x015c9810, chan->ep_type=3 > [13941.642078] --Host Channel Interrupt--, Channel 6 > [13941.642086] hcint 0x00000023, hcintmsk 0x00000406, hcint&hcintmsk 0x00000002 > [13941.642095] hcchar[6] = 0x01d8d200, chan->ep_type=2 > [13941.648243] --Host Channel Interrupt--, Channel 3 > [13941.648262] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.648272] hcchar[3] = 0x015c9810, chan->ep_type=3 > [13941.652240] --Host Channel Interrupt--, Channel 4 > [13941.652248] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.652257] hcchar[4] = 0x009c8801, chan->ep_type=3 > [13941.656241] --Host Channel Interrupt--, Channel 1 > [13941.656256] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.656266] hcchar[1] = 0x015c9810, chan->ep_type=3 > [13941.664240] --Host Channel Interrupt--, Channel 5 > [13941.664248] hcint 0x00000012, hcintmsk 0x00000006, hcint&hcintmsk 0x00000002 > [13941.664257] hcchar[5] = 0x015c9810, chan->ep_type=3 > > > The ping flood is otherwise working, except for a minor percentage loss (~0.7%). > Many thanks, > > Andrea Thanks for testing. Minas