lkml.org 
[lkml]   [2019]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: xhci: inherit dma_mask from bus if set correctly
Date
From: Sriram Dash <sriram.dash@samsung.com>

The xhci forcefully converts the dma_mask to either 64 or 32 and the
dma-mask set by the bus is somewhat ignored. If the platform sets the
correct dma_mask, then respect that.

Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
Signed-off-by: Sriram Dash <sriram.dash@samsung.com>
---
drivers/usb/host/xhci.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 005e659..55cf89e 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -5119,6 +5119,16 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
}

+ /*
+ * A platform may require coherent masks other than 64/32 bit, and we
+ * should respect that. If the firmware has already requested for a
+ * dma-range, we inherit the dma_mask presuming the platform knows
+ * what it is doing.
+ */
+
+ if (dev->bus_dma_mask)
+ dma_set_mask_and_coherent(dev, dev->bus_dma_mask);
+
xhci_dbg(xhci, "Calling HCD init\n");
/* Initialize HCD and host controller data structures. */
retval = xhci_init(hcd);
--
2.7.4
\
 
 \ /
  Last update: 2019-04-02 11:42    [W:0.247 / U:1.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site