From 1eb84e39fe6e8ece6cc516e2ff78007662568462 Mon Sep 17 00:00:00 2001 From: Nijun Gong Date: Tue, 19 Feb 2019 14:07:35 +0800 Subject: [PATCH] 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 --- hif/src/ce/ce_diag.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hif/src/ce/ce_diag.c b/hif/src/ce/ce_diag.c index 7bbb9db299c9..543c45d6b4b3 100644 --- a/hif/src/ce/ce_diag.c +++ b/hif/src/ce/ce_diag.c @@ -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;