From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752840AbbBKMzx (ORCPT ); Wed, 11 Feb 2015 07:55:53 -0500 Received: from mail-wi0-f180.google.com ([209.85.212.180]:35426 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbbBKMzu (ORCPT ); Wed, 11 Feb 2015 07:55:50 -0500 Date: Wed, 11 Feb 2015 13:56:46 +0100 From: Daniel Vetter To: Rob Clark Cc: Russell King - ARM Linux , Marek Szyprowski , Sumit Semwal , Linux Kernel Mailing List , "linux-media@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linaro-mm-sig@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" , linux-mm , Robin Murphy , Linaro Kernel Mailman List , Tomasz Stanislawski , Daniel Vetter Subject: Re: [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms Message-ID: <20150211125646.GR24485@phenom.ffwll.local> Mail-Followup-To: Rob Clark , Russell King - ARM Linux , Marek Szyprowski , Sumit Semwal , Linux Kernel Mailing List , "linux-media@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linaro-mm-sig@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" , linux-mm , Robin Murphy , Linaro Kernel Mailman List , Tomasz Stanislawski References: <1422347154-15258-1-git-send-email-sumit.semwal@linaro.org> <1422347154-15258-2-git-send-email-sumit.semwal@linaro.org> <54DB12B5.4080000@samsung.com> <20150211111258.GP8656@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 3.16-2-amd64 User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 11, 2015 at 06:23:52AM -0500, Rob Clark wrote: > On Wed, Feb 11, 2015 at 6:12 AM, Russell King - ARM Linux > wrote: > > As I've already pointed out, there's a major problem if you have already > > had a less restrictive attachment which has an active mapping, and a new > > more restrictive attachment comes along later. > > > > It seems from Rob's descriptions that we also need another flag in the > > importer to indicate whether it wants to have a valid struct page in the > > scatter list, or whether it (correctly) uses the DMA accessors on the > > scatter list - so that exporters can reject importers which are buggy. > > to be completely generic, we would really need a way that the device > could take over only just the last iommu (in case there were multiple > levels of address translation).. I still hold that if the dma api steals the iommu your gpu needs for context switching then that's a bug in the platform setup code. dma api really doesn't have any concept of switchable hw contexts. So trying to work around this brokeness by mandating it as a valid dma-buf use-case is totally backwards. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-we0-f182.google.com ([74.125.82.182]:45981 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751546AbbBKMzv (ORCPT ); Wed, 11 Feb 2015 07:55:51 -0500 Received: by mail-we0-f182.google.com with SMTP id l61so3189130wev.13 for ; Wed, 11 Feb 2015 04:55:49 -0800 (PST) Date: Wed, 11 Feb 2015 13:56:46 +0100 From: Daniel Vetter To: Rob Clark Cc: Russell King - ARM Linux , Marek Szyprowski , Sumit Semwal , Linux Kernel Mailing List , "linux-media@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linaro-mm-sig@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" , linux-mm , Robin Murphy , Linaro Kernel Mailman List , Tomasz Stanislawski , Daniel Vetter Subject: Re: [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms Message-ID: <20150211125646.GR24485@phenom.ffwll.local> References: <1422347154-15258-1-git-send-email-sumit.semwal@linaro.org> <1422347154-15258-2-git-send-email-sumit.semwal@linaro.org> <54DB12B5.4080000@samsung.com> <20150211111258.GP8656@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-media-owner@vger.kernel.org List-ID: On Wed, Feb 11, 2015 at 06:23:52AM -0500, Rob Clark wrote: > On Wed, Feb 11, 2015 at 6:12 AM, Russell King - ARM Linux > wrote: > > As I've already pointed out, there's a major problem if you have already > > had a less restrictive attachment which has an active mapping, and a new > > more restrictive attachment comes along later. > > > > It seems from Rob's descriptions that we also need another flag in the > > importer to indicate whether it wants to have a valid struct page in the > > scatter list, or whether it (correctly) uses the DMA accessors on the > > scatter list - so that exporters can reject importers which are buggy. > > to be completely generic, we would really need a way that the device > could take over only just the last iommu (in case there were multiple > levels of address translation).. I still hold that if the dma api steals the iommu your gpu needs for context switching then that's a bug in the platform setup code. dma api really doesn't have any concept of switchable hw contexts. So trying to work around this brokeness by mandating it as a valid dma-buf use-case is totally backwards. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f45.google.com (mail-la0-f45.google.com [209.85.215.45]) by kanga.kvack.org (Postfix) with ESMTP id 4E7356B0032 for ; Wed, 11 Feb 2015 07:55:53 -0500 (EST) Received: by lams18 with SMTP id s18so3048734lam.11 for ; Wed, 11 Feb 2015 04:55:52 -0800 (PST) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com. [2a00:1450:400c:c05::22d]) by mx.google.com with ESMTPS id hq17si3222866wib.123.2015.02.11.04.55.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Feb 2015 04:55:50 -0800 (PST) Received: by mail-wi0-f173.google.com with SMTP id bs8so19993979wib.0 for ; Wed, 11 Feb 2015 04:55:49 -0800 (PST) Date: Wed, 11 Feb 2015 13:56:46 +0100 From: Daniel Vetter Subject: Re: [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms Message-ID: <20150211125646.GR24485@phenom.ffwll.local> References: <1422347154-15258-1-git-send-email-sumit.semwal@linaro.org> <1422347154-15258-2-git-send-email-sumit.semwal@linaro.org> <54DB12B5.4080000@samsung.com> <20150211111258.GP8656@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: owner-linux-mm@kvack.org List-ID: To: Rob Clark Cc: Russell King - ARM Linux , Marek Szyprowski , Sumit Semwal , Linux Kernel Mailing List , "linux-media@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "linaro-mm-sig@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" , linux-mm , Robin Murphy , Linaro Kernel Mailman List , Tomasz Stanislawski , Daniel Vetter On Wed, Feb 11, 2015 at 06:23:52AM -0500, Rob Clark wrote: > On Wed, Feb 11, 2015 at 6:12 AM, Russell King - ARM Linux > wrote: > > As I've already pointed out, there's a major problem if you have already > > had a less restrictive attachment which has an active mapping, and a new > > more restrictive attachment comes along later. > > > > It seems from Rob's descriptions that we also need another flag in the > > importer to indicate whether it wants to have a valid struct page in the > > scatter list, or whether it (correctly) uses the DMA accessors on the > > scatter list - so that exporters can reject importers which are buggy. > > to be completely generic, we would really need a way that the device > could take over only just the last iommu (in case there were multiple > levels of address translation).. I still hold that if the dma api steals the iommu your gpu needs for context switching then that's a bug in the platform setup code. dma api really doesn't have any concept of switchable hw contexts. So trying to work around this brokeness by mandating it as a valid dma-buf use-case is totally backwards. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: daniel@ffwll.ch (Daniel Vetter) Date: Wed, 11 Feb 2015 13:56:46 +0100 Subject: [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms In-Reply-To: References: <1422347154-15258-1-git-send-email-sumit.semwal@linaro.org> <1422347154-15258-2-git-send-email-sumit.semwal@linaro.org> <54DB12B5.4080000@samsung.com> <20150211111258.GP8656@n2100.arm.linux.org.uk> Message-ID: <20150211125646.GR24485@phenom.ffwll.local> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Feb 11, 2015 at 06:23:52AM -0500, Rob Clark wrote: > On Wed, Feb 11, 2015 at 6:12 AM, Russell King - ARM Linux > wrote: > > As I've already pointed out, there's a major problem if you have already > > had a less restrictive attachment which has an active mapping, and a new > > more restrictive attachment comes along later. > > > > It seems from Rob's descriptions that we also need another flag in the > > importer to indicate whether it wants to have a valid struct page in the > > scatter list, or whether it (correctly) uses the DMA accessors on the > > scatter list - so that exporters can reject importers which are buggy. > > to be completely generic, we would really need a way that the device > could take over only just the last iommu (in case there were multiple > levels of address translation).. I still hold that if the dma api steals the iommu your gpu needs for context switching then that's a bug in the platform setup code. dma api really doesn't have any concept of switchable hw contexts. So trying to work around this brokeness by mandating it as a valid dma-buf use-case is totally backwards. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms Date: Wed, 11 Feb 2015 13:56:46 +0100 Message-ID: <20150211125646.GR24485@phenom.ffwll.local> References: <1422347154-15258-1-git-send-email-sumit.semwal@linaro.org> <1422347154-15258-2-git-send-email-sumit.semwal@linaro.org> <54DB12B5.4080000@samsung.com> <20150211111258.GP8656@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 821086E04D for ; Wed, 11 Feb 2015 04:55:50 -0800 (PST) Received: by mail-wi0-f176.google.com with SMTP id h11so3451815wiw.3 for ; Wed, 11 Feb 2015 04:55:49 -0800 (PST) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Rob Clark Cc: Linaro Kernel Mailman List , Russell King - ARM Linux , Tomasz Stanislawski , Linux Kernel Mailing List , "dri-devel@lists.freedesktop.org" , "linaro-mm-sig@lists.linaro.org" , linux-mm , Marek Szyprowski , Robin Murphy , "linux-arm-kernel@lists.infradead.org" , "linux-media@vger.kernel.org" List-Id: dri-devel@lists.freedesktop.org T24gV2VkLCBGZWIgMTEsIDIwMTUgYXQgMDY6MjM6NTJBTSAtMDUwMCwgUm9iIENsYXJrIHdyb3Rl Ogo+IE9uIFdlZCwgRmViIDExLCAyMDE1IGF0IDY6MTIgQU0sIFJ1c3NlbGwgS2luZyAtIEFSTSBM aW51eAo+IDxsaW51eEBhcm0ubGludXgub3JnLnVrPiB3cm90ZToKPiA+IEFzIEkndmUgYWxyZWFk eSBwb2ludGVkIG91dCwgdGhlcmUncyBhIG1ham9yIHByb2JsZW0gaWYgeW91IGhhdmUgYWxyZWFk eQo+ID4gaGFkIGEgbGVzcyByZXN0cmljdGl2ZSBhdHRhY2htZW50IHdoaWNoIGhhcyBhbiBhY3Rp dmUgbWFwcGluZywgYW5kIGEgbmV3Cj4gPiBtb3JlIHJlc3RyaWN0aXZlIGF0dGFjaG1lbnQgY29t ZXMgYWxvbmcgbGF0ZXIuCj4gPgo+ID4gSXQgc2VlbXMgZnJvbSBSb2IncyBkZXNjcmlwdGlvbnMg dGhhdCB3ZSBhbHNvIG5lZWQgYW5vdGhlciBmbGFnIGluIHRoZQo+ID4gaW1wb3J0ZXIgdG8gaW5k aWNhdGUgd2hldGhlciBpdCB3YW50cyB0byBoYXZlIGEgdmFsaWQgc3RydWN0IHBhZ2UgaW4gdGhl Cj4gPiBzY2F0dGVyIGxpc3QsIG9yIHdoZXRoZXIgaXQgKGNvcnJlY3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