On Wed, 2020-12-23 at 19:55 +0100, Nicolas Saenz Julienne wrote: > So far we've been content with passing physical addresses when > configuring memory addresses into XHCI controllers, but not all > platforms have buses with transparent mappings. Specifically the > Raspberry Pi 4 might introduce an offset to memory accesses incoming > from its PCIe port. > > Introduce xhci_virt_to_bus() and xhci_bus_to_virt() to cater with these > limitations, and make sure we don't break non DM users. > > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulie...@suse.de> > Reviewed-by: Simon Glass <s...@chromium.org> > Reviewed-by: Stefan Roese <s...@denx.de> ---
Upon testing this on more RPi4 variants I realized that I'm missing this: diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index eba2b89a88..6b31ad4398 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -726,7 +726,7 @@ again: return -ETIMEDOUT; } - if ((uintptr_t)(le64_to_cpu(event->trans_event.buffer)) + if ((uintptr_t)(le64_to_cpu(xhci_bus_to_virt(ctrl, event->trans_event.buffer))) != (uintptr_t)last_transfer_trb_addr) { available_length -= (int)EVENT_TRB_LEN(le32_to_cpu(event->trans_event.transfer_len)); Will update the patch on v6. Regards, Nicolas
signature.asc
Description: This is a digitally signed message part