From: Stefan Roese Date: Fri, 15 Jan 2021 07:52:56 +0000 (+0100) Subject: usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx() X-Git-Tag: submit/tizen_6.0/20211217.073345~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5436c1aa3e3ca33182ddbcaa0e55bab40a60a53f;p=platform%2Fkernel%2Fu-boot.git usb: xhci: Fix compare to use physical addresses in xhci_bulk_tx() 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 Cc: Aaron Williams Cc: Chandrakala Chavva Cc: Ran Wang Cc: Nicolas Saenz Julienne Cc: Marek Vasut Cc: Bin Meng [backport of mainline commit cec804251d4b4765bbcaa207f4c931fef350585e] Signed-off-by: Marek Szyprowski Change-Id: Ia5cd6ce705e4b5f330a2bdae70efa0546562df51 --- diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 7fc762d051..e1f33b0237 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -724,8 +724,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);