[PATCH RFT 2/2] usb: xhci: pass hardware device to dma_alloc_coherent

Ahmad Fatoum a.fatoum at barebox.org
Mon Dec 1 13:18:54 PST 2025


We already pass the hardware device to dma_map_single in xhci-ring.c, do
the same for the coherent allocation, so dma-ranges is taken into
account.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 drivers/usb/host/xhci-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index aca3920427f4..6324bab730ad 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -86,7 +86,7 @@ static void *xhci_malloc(struct xhci_ctrl *ctrl, unsigned int size, dma_addr_t *
 {
 	void *ptr;
 
-	ptr = dma_alloc_coherent(DMA_DEVICE_BROKEN, size, dma_addr);
+	ptr = dma_alloc_coherent(ctrl->host.hw_dev, size, dma_addr);
 	if (!ptr)
 		return NULL;
 
-- 
2.47.3




More information about the barebox mailing list