public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ye Li <ye.li@nxp.com>
To: u-boot@lists.denx.de
Subject: [EXT] Re: [PATCH] usb: ehci-hcd: Add IAA handshake for removing async QH
Date: Tue, 9 Mar 2021 03:18:17 +0000	[thread overview]
Message-ID: <1615205942.14467.16.camel@nxp.com> (raw)
In-Reply-To: <8a5a0e31-bfc3-69ac-6ae5-74dfed24b08c@denx.de>

Hi Marek,

On Mon, 2021-03-08 at 09:50 +0100, Marek Vasut wrote:
> Caution: EXT Email
> 
> On 3/8/21 4:35 AM, Ye Li wrote:
> [...]
> > 
> > +static int ehci_iaa_cycle(struct ehci_ctrl *ctrl)
> > +{
> > +?????u32 cmd, status;
> > +?????int ret;
> > +
> > +?????/* Enable Interrupt on Async Advance Doorbell. */
> > +?????cmd = ehci_readl(&ctrl->hcor->or_usbcmd);
> > +?????cmd |= CMD_IAAD;
> > +?????ehci_writel(&ctrl->hcor->or_usbcmd, cmd);
> > +
> > +?????ret = handshake((uint32_t *)&ctrl->hcor->or_usbsts, STS_IAA,
> > STS_IAA,
> Is the (uint32_t *) cast really needed ?
> 
I will remove it in v2.

> > 
> > +?????????????????????10 * 1000); /* 10ms timeout */
> > +?????if (ret < 0)
> > +?????????????printf("EHCI fail timeout STS_IAA set\n");
> Shouldn't there be some abort ^ if ret < 0 ?
> Also, add the return value into the printf, it is useful for
> debugging.
I don't think need to abort anything when ret < 0. The ret value is
very simple in handshake, when ret < 0, it must be -1.?
Actually the codes refer the?ehci_enable_async for the usage of
handshake.


> 
> > 
> > +?????status = ehci_readl(&ctrl->hcor->or_usbsts);
> > +?????if ((status & STS_IAA))
> Drop the double parenthesis here, one set of () is enough.
> 
I will remove it v2.

> > 
> > +?????????????ehci_writel(&ctrl->hcor->or_usbsts, STS_IAA);
> > +
> > +?????return ret;
> > +}
> Is this a bugfix for this release or is this for next release ?
> We're in rc3 already, so I would suggest to be careful.
It is ok to add the fix for next release. From our tests, the issue is
not very easy to reproduce by just using usb read/write. ?In 
SCT, generally we need to run about 1 hour to see the issue.?

Best regards,
Ye Li

  reply	other threads:[~2021-03-09  3:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08  3:35 [PATCH] usb: ehci-hcd: Add IAA handshake for removing async QH Ye Li
2021-03-08  8:50 ` Marek Vasut
2021-03-09  3:18   ` Ye Li [this message]
2021-03-09  8:08     ` [EXT] " Marek Vasut
2021-03-09  9:32       ` Ye Li
2021-03-09 10:00         ` Marek Vasut

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=1615205942.14467.16.camel@nxp.com \
    --to=ye.li@nxp.com \
    --cc=u-boot@lists.denx.de \
    /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