Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1386247pxa; Thu, 20 Aug 2020 09:56:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbWI0Yp4rQqfYABoBJfl4mQGVh5dDStwHN6LSU5VQxYYHY+xf/e4N0wwINhrY3fTNQEfak X-Received: by 2002:aa7:c606:: with SMTP id h6mr3882286edq.288.1597942590255; Thu, 20 Aug 2020 09:56:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597942590; cv=none; d=google.com; s=arc-20160816; b=BX9qi+iClfN06iSU3gX50/LRPiV32zqA4f1UmLscsXUkLPO4H1z7HID0MgBQ1lLYlY e0RxxwfpC+5J4UwrqFLtnErYxBB86BVVBR5hXHVvBjIyToyt98TAMpELx8yMe0CBUcQu ywKo+Sq6NO8AjcBTJLN5eSHoAIS/SSmGQS6clGGhL+/J7IDxhK1372eYV83UaO2gLrzK 5kMpTsElelaoToY0jriDpRMgUWLJ7ZaTecMnJ/HVD29FLT/Ibg/be959KWzQWN4jz4KZ TNeYK8iIK7m2VHKlwCxtBYHONXAC505mHnLbZzv5DZWEe0Ku+nf93y+ciaG6YPlwZvhH WanA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=z0jxXtppZhp+k9N3r8oWxvwBm4U5c8mbznTPcG2gEeU=; b=nTQtybwFbdJuYkJFLK2gBcNbIGAxpnJlWSSLG9fOzjpAzjNWfZuWbSTXcSGfTwehhS 0e2hSsf/TOvJIsixIgipTxFbPlSQ4w+1h5AHlIv7JyZSViMnPvKYny0gTxSLCkoyQdFo Agzto9Iv4zHuRAsjloyvqQb/f3PqimuMfcIp58PO8KhFETokaZSqDkgi2Iw4EdmZNuDt WiquWSX1nN6s/rsvZK8UHriLzy3B9skSimXCTDLVksoUQJrykQP/eNhIeeglD+cT8VBI /1F+hbmmdpNj4cF4ifWUU7yPGMPS5NMMRHYywG2f3ZbZX95tz7lgDw6l7+aE90+60Lty fkSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r26si1662452ejz.728.2020.08.20.09.56.06; Thu, 20 Aug 2020 09:56:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730152AbgHTQwS (ORCPT + 99 others); Thu, 20 Aug 2020 12:52:18 -0400 Received: from verein.lst.de ([213.95.11.211]:43074 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729701AbgHTQwR (ORCPT ); Thu, 20 Aug 2020 12:52:17 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 48F9168AFE; Thu, 20 Aug 2020 18:52:13 +0200 (CEST) Date: Thu, 20 Aug 2020 18:52:13 +0200 From: Christoph Hellwig To: Tomasz Figa Cc: Christoph Hellwig , Robin Murphy , alsa-devel@alsa-project.org, linux-ia64@vger.kernel.org, Linux Doc Mailing List , nouveau@lists.freedesktop.org, linux-nvme@lists.infradead.org, Linux Kernel Mailing List , "James E.J. Bottomley" , linux-mm@kvack.org, Marek Szyprowski , linux-samsung-soc , Joonyoung Shim , linux-scsi@vger.kernel.org, Kyungmin Park , Ben Skeggs , Matt Porter , Linux Media Mailing List , Tom Lendacky , Pawel Osciak , Mauro Carvalho Chehab , "list@263.net:IOMMU DRIVERS" , Joerg Roedel , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, netdev@vger.kernel.org, Seung-Woo Kim , linux-mips@vger.kernel.org Subject: Re: [PATCH 05/28] media/v4l2: remove V4L2-FLAG-MEMORY-NON-CONSISTENT Message-ID: <20200820165213.GC12693@lst.de> References: <20200819065555.1802761-1-hch@lst.de> <20200819065555.1802761-6-hch@lst.de> <62e4f4fc-c8a5-3ee8-c576-fe7178cb4356@arm.com> <2b32f1d8-16f7-3352-40a5-420993d52fb5@arm.com> <20200820050214.GA4815@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 20, 2020 at 12:24:31PM +0200, Tomasz Figa wrote: > > Of course this still uses the scatterlist structure with its annoying > > mix of input and output parametes, so I'd rather not expose it as > > an official API at the DMA layer. > > The problem with the above open coded approach is that it requires > explicit handling of the non-IOMMU and IOMMU cases and this is exactly > what we don't want to have in vb2 and what was actually the job of the > DMA API to hide. Is the plan to actually move the IOMMU handling out > of the DMA API? > > Do you think we could instead turn it into a dma_alloc_noncoherent() > helper, which has similar semantics as dma_alloc_attrs() and handles > the various corner cases (e.g. invalidate_kernel_vmap_range and > flush_kernel_vmap_range) to achieve the desired functionality without > delegating the "hell", as you called it, to the users? Yes, I guess I could do something in that direction. At least for dma-iommu, which thanks to Robin should be all you'll need in the foreseeable future.