[PATCH] usb: ehci-hcd: Add IAA handshake for removing async QH

Marek Vasut marex at denx.de
Mon Mar 8 09:50:55 CET 2021


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 ?

> +			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.

> +	status = ehci_readl(&ctrl->hcor->or_usbsts);
> +	if ((status & STS_IAA))

Drop the double parenthesis here, one set of () is enough.

> +		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.


More information about the U-Boot mailing list