Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1414660

[PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device

From Baolin Wang <baolin.wang@linaro.org>
Newsgroups linux.kernel
Subject [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device
Date 2016-06-06 08:00 +0200
Message-ID <rGVJT-Mi-1@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


On ARM64 platform, it will set 'dummy_dma_ops' for device dma_ops if
it did not call 'arch_setup_dma_ops' at device creation time, that will
cause failure when setting the dma mask for device.

Thus this patch set the xhci device dma_ops from the parent device if
the xhci device dma_ops is 'dummy_dma_ops'.

Changes since v1:
 - Add CONFIG_ARM64 macro.

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/usb/dwc3/host.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index c679f63..edb666d 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -32,6 +32,11 @@ int dwc3_host_init(struct dwc3 *dwc)
 		return -ENOMEM;
 	}
 
+#ifdef CONFIG_ARM64
+	if (get_dma_ops(&xhci->dev) == get_dma_ops(NULL))
+		xhci->dev.archdata.dma_ops = get_dma_ops(dwc->dev);
+#endif
+
 	dma_set_coherent_mask(&xhci->dev, dwc->dev->coherent_dma_mask);
 
 	xhci->dev.parent	= dwc->dev;
-- 
1.7.9.5

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device Baolin Wang <baolin.wang@linaro.org> - 2016-06-06 08:00 +0200
  Re: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device Felipe Balbi <balbi@kernel.org> - 2016-06-06 17:00 +0200
    Re: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device Baolin Wang <baolin.wang@linaro.org> - 2016-06-07 04:20 +0200
    Re: [PATCH v2] usb: dwc3: host: Set the dma_ops for xhci device Baolin Wang <baolin.wang@linaro.org> - 2016-06-08 10:20 +0200

csiph-web