From: Vivek Gautam <vivek.gautam@codeaurora.org>
To: hch@infradead.org
Cc: David Airlie <airlied@linux.ie>, Rob Clark <robdclark@gmail.com>,
Tomasz Figa <tfiga@chromium.org>,
open list <linux-kernel@vger.kernel.org>,
freedreno <freedreno@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Jordan Crouse <jcrouse@codeaurora.org>,
seanpaul@chromium.org
Subject: Re: [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg*
Date: Wed, 28 Nov 2018 14:32:34 +0530 [thread overview]
Message-ID: <CAFp+6iHDh3-5+RTikaPz1SMqxCaVMJ86WvPJjpSVp9GjzOfLfQ@mail.gmail.com> (raw)
In-Reply-To: <20181128073940.GA13072@infradead.org>
Hi Christoph ,
On Wed, Nov 28, 2018 at 1:10 PM Christoph Hellwig <hch@infradead.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
next prev parent reply other threads:[~2018-11-28 9:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 21:37 [PATCH v2 1/1] drm: msm: Replace dma_map_sg with dma_sync_sg* Vivek Gautam
2018-11-28 3:09 ` Tomasz Figa
2018-11-29 9:43 ` Vivek Gautam
2018-11-28 7:39 ` Christoph Hellwig
2018-11-28 9:02 ` Vivek Gautam [this message]
2018-11-28 12:38 ` Rob Clark
2018-11-29 9:44 ` Vivek Gautam
2018-11-28 14:19 ` Lukas Wunner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFp+6iHDh3-5+RTikaPz1SMqxCaVMJ86WvPJjpSVp9GjzOfLfQ@mail.gmail.com \
--to=vivek.gautam@codeaurora.org \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=hch@infradead.org \
--cc=jcrouse@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=seanpaul@chromium.org \
--cc=tfiga@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).