]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx()
authorStefan Roese <sr@denx.de>
Fri, 15 Jan 2021 07:52:56 +0000 (08:52 +0100)
committerMarek Vasut <marex@denx.de>
Wed, 10 Feb 2021 21:23:24 +0000 (22:23 +0100)
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@denx.de>
Cc: Aaron Williams <awilliams@marvell.com>
Cc: Chandrakala Chavva <cchavva@marvell.com>
Cc: Ran Wang <ran.wang_1@nxp.com>
Cc: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Cc: Marek Vasut <marex@denx.de>
Cc: Bin Meng <bmeng.cn@gmail.com>
drivers/usb/host/xhci-ring.c

index d708fc928b247d1b9e63b9d83221047ead318849..d6c47d579bc2f7760a017667c2a48120589b6ce0 100644 (file)
@@ -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);