From: Marek Vasut Date: Wed, 10 Mar 2021 11:48:43 +0100 Subject: [PATCH v2] usb: ehci-hcd: Add IAA handshake for removing async QH In-Reply-To: <1615260417-80606-1-git-send-email-ye.li@nxp.com> References: <1615260417-80606-1-git-send-email-ye.li@nxp.com> Message-ID: <16728dd0-1c6c-2011-ecd4-9b00b6ef815d@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 3/9/21 4:26 AM, Ye Li wrote: > According to EHCI spec, software needs to do handshake with HC for > safely removing QH from async list. This handshake is implemented by > setting IAAD (Interrupt on Async Advance Doorbell) bit in USB_USBCMD > register and poll the IAA (Interrupt on Async Advance bit) in the > USB_USBSTS to ensure the HC has released all on-chip state that may > potentially reference one of the data structures just removed. > > Current codes only check active status of the last QTD, but this can't > ensure the QH is released from HC. We can meet unrecoverable > "EHCI timed out on TD" errors when running UEFI SCT tests on USB disk. > The USB_ASYNCLISTADDR register is changed to a invalid address when the > issue happens. It is fixed after adding the IAA handshake. > > Steps to reproduce the issue: > 1. Build the UEFI SCT from https://github.com/tianocore/edk2-test > 2. Build the EDK2 UEFI Shell from https://github.com/tianocore/edk2 > 3. Copy SCT files and Shell.efi to USB disk FAT partition > 4. Load the Shell.efi from USB FAT, and run bootefi to execute it > 5. After booting into Shell, enter the SCT directory and run "sct -a" > to execute all tests. > 6. Tests run about 1 hour and stop with many EHCI timeout errors like > EHCI timed out on TD - token=0x801f8c80 Applied to usb/next, thanks.