[PATCH] usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx()

Stefan Roese sr at denx.de
Mon Feb 8 13:39:14 CET 2021


Hi Marek,
Hi Bin,

On 15.01.21 08:52, Stefan Roese wrote:
> Testing with v2021.01 on MIPS Octeon has shown, that the latest patch
> for the "short packet event trb handling" did introduce a bug on
> platforms with virtual address != physical address. This patch fixes
> this issue by using the correct address types in the compare (both
> physical in this case).
> 
> Signed-off-by: Stefan Roese <sr at denx.de>
> Cc: Aaron Williams <awilliams at marvell.com>
> Cc: Chandrakala Chavva <cchavva at marvell.com>
> Cc: Ran Wang <ran.wang_1 at nxp.com>
> Cc: Nicolas Saenz Julienne <nsaenzjulienne at suse.de>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Bin Meng <bmeng.cn at gmail.com>

If you see no issues with this patch, can you please pull this in
soon'ish?

Thanks,
Stefan

> ---
>   drivers/usb/host/xhci-ring.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index d708fc928b..d6c47d579b 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -723,8 +723,8 @@ again:
>   		return -ETIMEDOUT;
>   	}
>   
> -	if ((uintptr_t)(le64_to_cpu(event->trans_event.buffer))
> -			!= (uintptr_t)last_transfer_trb_addr) {
> +	if ((uintptr_t)(le64_to_cpu(event->trans_event.buffer)) !=
> +	    (uintptr_t)virt_to_phys(last_transfer_trb_addr)) {
>   		available_length -=
>   			(int)EVENT_TRB_LEN(le32_to_cpu(event->trans_event.transfer_len));
>   		xhci_acknowledge_event(ctrl);
> 


Viele Grüße,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de


More information about the U-Boot mailing list