public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Courbot <acourbot@nvidia.com>
To: Ben Skeggs <skeggsb@gmail.com>, Ben Skeggs <bskeggs@redhat.com>,
	"Dave Airlie" <airlied@linux.ie>
Cc: <nouveau@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [Nouveau] [PATCH] instmem/gk20a: use DMA API CPU mapping
Date: Thu, 12 Nov 2015 11:07:23 +0900	[thread overview]
Message-ID: <5643F45B.5080402@nvidia.com> (raw)
In-Reply-To: <5643C607.60204@gmail.com>

On 11/12/2015 07:49 AM, Ben Skeggs wrote:
> * PGP Signed by an unknown key
>
> On 11/11/2015 06:07 PM, Alexandre Courbot wrote:
>> Commit 69c4938249fb ("drm/nouveau/instmem/gk20a: use direct CPU access")
>> tried to be smart while using the DMA-API by managing the CPU mappings of
>> buffers allocated with the DMA-API by itself. In doing so, it relied
>> on dma_to_phys() which is an architecture-private function not
>> available everywhere. This broke the build on several architectures.
>>
>> Since there is no reliable and portable way to obtain the physical
>> address of a DMA-API buffer, stop trying to be smart and just use the
>> CPU mapping that the DMA-API can provide. This means that buffers will
>> be CPU-mapped for all their life as opposed to when we need them, but
>> anyway using the DMA-API here is a fallback for when no IOMMU is
>> available so we should not expect optimal behavior.
>>
>> This makes the IOMMU and DMA-API implementations of instmem diverge
>> enough that we should maybe put them into separate files...
>>
>> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
>> ---
>> Ben/Dave, since Dave's fix has reached mainline and builds are not
>> broken anymore, we can proceed one of two ways:
>>
>> 1) Ben merges this for 4.4 and let it flow for -rc2
>> 2) I send another fix against the kernel tree
> I just spoke to Dave, and I'll take this in my tree for 4.5 if
> everything works fine with the temporary hack fix.  Does that sound OK
> to you?

I would rather get rid of this illicit dma_to_phys() quickly so other 
people don't start thinking it's ok to use in drivers/ (or start 
throwing stones at me), but your call.

      reply	other threads:[~2015-11-12  2:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11  8:07 [PATCH] instmem/gk20a: use DMA API CPU mapping Alexandre Courbot
2015-11-11 22:49 ` [Nouveau] " Ben Skeggs
2015-11-12  2:07   ` Alexandre Courbot [this message]

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=5643F45B.5080402@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=airlied@linux.ie \
    --cc=akpm@linux-foundation.org \
    --cc=bskeggs@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nouveau@lists.freedesktop.org \
    --cc=skeggsb@gmail.com \
    /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