qcacmn: Remove improper kernel API for coherent memory

Memory allocated by dma_alloc_coherent() doesn't need cache sync, which
is only needed for stream dma mapping, eg, mapping passed-in memory
using dma_map_single().

More seriously, when SMMU enabled, physical memory returned by
dma_alloc_coherent() is no longer continuous. If pass this memory to
dma_sync_single_for_device(), a do_bad_area exception will hang system,
noting that dma_sync_single_for_device() only handles single contiguous
memory. Refer to Documentation/DMA-API.txt for more info.

Change-Id: Ia0b5bdcc2cb9335aa2e309efccd91e57e844c7cc
CRs-Fixed: 2381886
This commit is contained in:
Nijun Gong
2019-02-19 14:07:35 +08:00
committed by nshrivas
szülő 03bd4b6b30
commit 1eb84e39fe

Fájl megtekintése

@@ -224,8 +224,6 @@ QDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *hif_ctx,
goto done;
}
qdf_mem_zero(data_buf, orig_nbytes);
qdf_mem_dma_sync_single_for_device(scn->qdf_dev, CE_data_base,
orig_nbytes, DMA_FROM_DEVICE);
remaining_bytes = orig_nbytes;
CE_data = CE_data_base;