Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e4c4433 authored by Mayank Rana's avatar Mayank Rana
Browse files

dwc3-msm: Use dwc->sysdev instead of dwc->dev with DMA APIs



Currently DMA APIs are using usb controller device node (i.e. example
a600000.dwc3) instead of using sysdev which is parent of usb controller
device node (i.e. example a800000.ssusb). IOMMU based page table is
being created with sysdev device. Hence on enabling SMMU stage S1 and
configuraing USB IPA GSI hardware accelerated path, it results into
unmapped page related SMMU fault when USB hardware tries to access USB
GSI event ring. Fix this issue by using dwc->sysdev instead of dwc->dev
while creating USB GSI event ring.

Change-Id: I079a64bd16178ed6bbb39863578c1c8c6ed12884
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 0364b310
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1853,7 +1853,7 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event)
				break;
			evt->dwc	= dwc;
			evt->length	= DWC3_EVENT_BUFFERS_SIZE;
			evt->buf	= dma_alloc_coherent(dwc->dev,
			evt->buf	= dma_alloc_coherent(dwc->sysdev,
						DWC3_EVENT_BUFFERS_SIZE,
						&evt->dma, GFP_KERNEL);
			if (!evt->buf) {
@@ -1924,7 +1924,7 @@ static void dwc3_msm_notify_event(struct dwc3 *dwc, unsigned int event)
		for (i = 0; i < mdwc->num_gsi_event_buffers; i++) {
			evt = mdwc->gsi_ev_buff[i];
			if (evt)
				dma_free_coherent(dwc->dev, evt->length,
				dma_free_coherent(dwc->sysdev, evt->length,
							evt->buf, evt->dma);
		}
		break;