[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFp+6iHDh3-5+RTikaPz1SMqxCaVMJ86WvPJjpSVp9GjzOfLfQ@mail.gmail.com>
Date: Wed, 28 Nov 2018 14:32:34 +0530
From: Vivek Gautam <vivek.gautam@...eaurora.org>
To: hch@...radead.org
Cc: David Airlie <airlied@...ux.ie>, Rob Clark <robdclark@...il.com>,
Tomasz Figa <tfiga@...omium.org>,
open list <linux-kernel@...r.kernel.org>,
freedreno <freedreno@...ts.freedesktop.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
Jordan Crouse <jcrouse@...eaurora.org>, seanpaul@...omium.org
Subject: Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*
Hi Christoph ,
On Wed, Nov 28, 2018 at 1:10 PM Christoph Hellwig <hch@...radead.org> wrote:
>
> > + /*
> > + * 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.
Thanks for reviewing this change.
>From what I understand the things in drm, we don't use the default
iommu-dma domain
for drm devices. Rather we allocate a new iommu domain, and therefore we can't
use the default dma ops. Hence we need separate dma_sync_sg*() to
flush/invalidate
the cache. For this we need to initialize the sg's addresses.
Please correct me if my understanding is incomplete.
Best regards
Vivek
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
Powered by blists - more mailing lists