Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668AbbKLCJB (ORCPT ); Wed, 11 Nov 2015 21:09:01 -0500 Received: from hqemgate14.nvidia.com ([216.228.121.143]:1120 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752340AbbKLCI7 (ORCPT ); Wed, 11 Nov 2015 21:08:59 -0500 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Wed, 11 Nov 2015 18:06:42 -0800 Subject: Re: [Nouveau] [PATCH] instmem/gk20a: use DMA API CPU mapping To: Ben Skeggs , Ben Skeggs , "Dave Airlie" References: <1447229271-22901-1-git-send-email-acourbot@nvidia.com> <5643C607.60204@gmail.com> CC: , , "Andrew Morton" , Guenter Roeck From: Alexandre Courbot Message-ID: <5643F45B.5080402@nvidia.com> Date: Thu, 12 Nov 2015 11:07:23 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5643C607.60204@gmail.com> X-Originating-IP: [10.19.62.246] X-ClientProxiedBy: DRBGMAIL104.nvidia.com (10.18.16.23) To HKMAIL103.nvidia.com (10.18.16.12) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1910 Lines: 39 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 >> --- >> 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/