public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea della Porta <aporta@suse.de>
To: Minas Harutyunyan <Minas.Harutyunyan@synopsys.com>
Cc: Ivan Ivanov <ivan.ivanov@suse.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	Oliver Neukum <oneukum@suse.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	Andrea della Porta <andrea.porta@suse.com>
Subject: Re: [PATCH] USB: dwc2: write HCINT with INTMASK applied
Date: Mon, 18 Dec 2023 15:36:24 +0100	[thread overview]
Message-ID: <ZYBY6LdDLRc0XBx_@apocalypse> (raw)
In-Reply-To: <07250e1e-c5ca-0586-b53f-7f2bb3d19b39@synopsys.com>

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

  reply	other threads:[~2023-12-18 14:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 14:45 [PATCH] USB: dwc2: write HCINT with INTMASK applied Oliver Neukum
2023-11-22 12:35 ` Minas Harutyunyan
2023-11-27  9:04   ` Andrea della Porta
2023-11-27 10:46     ` Minas Harutyunyan
2023-11-28  9:00       ` Andrea della Porta
2023-11-28 11:48         ` Minas Harutyunyan
2023-11-28 14:43           ` Ivan Ivanov
2023-12-01 10:26             ` Minas Harutyunyan
2023-12-03  6:52               ` Andrea della Porta
2023-12-14 12:23                 ` Minas Harutyunyan
2023-12-18 14:36                   ` Andrea della Porta [this message]
2023-12-19 10:19                     ` Minas Harutyunyan
2023-12-19 10:18 ` Minas Harutyunyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZYBY6LdDLRc0XBx_@apocalypse \
    --to=aporta@suse.de \
    --cc=Minas.Harutyunyan@synopsys.com \
    --cc=andrea.porta@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ivan.ivanov@suse.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox