From: Alexandre Courbot <acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
To: Ben Skeggs <skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Ben Skeggs <bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
Dave Airlie <airlied-cv59FeDIM0c@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Subject: Re: [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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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.
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
WARNING: multiple messages have this Message-ID (diff)
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.
next prev parent reply other threads:[~2015-11-12 2:07 UTC|newest]
Thread overview: 6+ 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 8:07 ` Alexandre Courbot
[not found] ` <1447229271-22901-1-git-send-email-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2015-11-11 22:49 ` Ben Skeggs
2015-11-11 22:49 ` [Nouveau] " Ben Skeggs
[not found] ` <5643C607.60204-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-11-12 2:07 ` Alexandre Courbot [this message]
2015-11-12 2:07 ` Alexandre Courbot
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-ddmlm1+adcrqt0dzr+alfa@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=bskeggs-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.