From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Date: Tue, 27 Nov 2018 23:39:40 -0800 Message-ID: <20181128073940.GA13072@infradead.org> References: <20181126213710.3084-1-vivek.gautam@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20181126213710.3084-1-vivek.gautam@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org To: Vivek Gautam Cc: airlied@linux.ie, robdclark@gmail.com, tfiga@chromium.org, linux-kernel@vger.kernel.org, freedreno@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Jordan Crouse , Sean Paul List-Id: linux-arm-msm@vger.kernel.org > + /* > + * dma_sync_sg_*() flush the physical pages, so point > + * sg->dma_address to the physical ones for the right behavior. > + */ > + for_each_sg(msm_obj->sgt->sgl, s, msm_obj->sgt->nents, i) > + sg_dma_address(s) = sg_phys(s); > + I'm sorry, but this is completely bogus and not acceptable. The only place that is allowed to initialize sg_dma_address is dma_map_sg. If the default dma ops don't work for your setup we have major a problem and need to fix the dma api / iommu integration instead of hacking around it.