From: Nicolas Saenz Julienne Date: Thu, 24 Dec 2020 13:23:10 +0100 Subject: [PATCH v5 10/13] xhci: translate virtual addresses into the bus's address space In-Reply-To: <20201223185539.5937-11-nsaenzjulienne@suse.de> References: <20201223185539.5937-1-nsaenzjulienne@suse.de> <20201223185539.5937-11-nsaenzjulienne@suse.de> Message-ID: <82e17501fc89bc03d9935643d10ad478a1b80623.camel@suse.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 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 > Reviewed-by: Simon Glass > Reviewed-by: Stefan Roese --- 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: This is a digitally signed message part URL: