Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2021753imu; Fri, 14 Dec 2018 04:38:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/UDvXAw2+VfDNsJiu+ZZIbdq3WTVtYSWYdce/kzVZa1Mbpo88StEEFwfVzsMeqHC5sjQq6k X-Received: by 2002:a63:af52:: with SMTP id s18mr1472285pgo.385.1544791117263; Fri, 14 Dec 2018 04:38:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544791117; cv=none; d=google.com; s=arc-20160816; b=nWEdC2sJx5FIovtG+ATP1Ro7t2o23CTr6gQKCNqMTLpURGR+enq5b0JcyBZGM3wOn0 fJA2pCGkt0GOjyPb4zUb50+T3zL4fYjZDuL/e/0MUXe76H5jWYg3QAQ2s5bEzwduQ8xY jDqGw4HgkMVe5jHQq5S7K+Z0IrCgL5NDBeMChcfSc3PMGOr/CsX3jNwRBbDEiBBP7eTn VjGmNYPvdAoe6bY0pmj2VdINcTonYAHoSFmoqF3wFCMXqVe3KROZLOkH1ugFGRI8msjT QTHpTZCMIb09TgIIYB0jCtDhYAg6K9mnEKg5XOiuT7190xmcYExpzEku/l9M8MRXrOWf GjMw== 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:dkim-signature; bh=gethElgK4t4uthIH0qKj11ax8WB7r9nnrelsz3eSwtk=; b=YnbeI83tYTkDoEM7elxUquum8oj5Uhd6oUICw5mvF0RSEiohfRC8yiomhXcfMvqFCu igftTChS4WXLDxUJnz6IiqXx4nIfLAP0n3ygYHTSv1/bhmaltSZyM7ttCxo2EuIkf9FM NJzHvCehxwkGV9ve3feEP/xiK+bSiRS3eKT1aG3Syu0I6QhIZaI6zRIVFfqN0qMTwXfs rL4U6Q4hiPO5c4wD09uKVX9/uqD3N5H8VIdaj8DJxbp3U0vqQg2TFSNPAalZKJhF7+AS uPsguHoR653/X+MszJNgT/Snb79AqxitxYeylckNXpFXF41lUooNqf3X/mQXpdqC7WCp oqAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ryNQmOc1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si4094399pfm.149.2018.12.14.04.38.22; Fri, 14 Dec 2018 04:38:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ryNQmOc1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730870AbeLNMgc (ORCPT + 99 others); Fri, 14 Dec 2018 07:36:32 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58246 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730362AbeLNMg3 (ORCPT ); Fri, 14 Dec 2018 07:36:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gethElgK4t4uthIH0qKj11ax8WB7r9nnrelsz3eSwtk=; b=ryNQmOc1MuVg0deN9P4dvCWsx r8yb0koMWs1RdnpRrJ2v80NSTpua4n7y0QDugZqzH9MHlIf9E5eC3mCRWIfeaByYnrWapYyG58q4S S2Mxuk5VMVMM1Me4ZgwwkXXlvusSC6M7/iyxWUikjokdjTPVezcaJ4uW8vw4cxy5R/cfQcYfMeC5O kw5wujH1aWtHGsdDw1XX+bz3ETvS2VLa+XFFjntrToHUNMyLAKZsXER6d082wuIfVol9JNcTtk0dp N1MTwmGsaEOvUxYSIagDzCxsi7zBQ86nUjU/BiLxtOx0JEechOkopkDRZetfHNkx2wOtCkPJ7wwsf 85gUM/LXQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gXmhd-0002zl-0r; Fri, 14 Dec 2018 12:36:25 +0000 Date: Fri, 14 Dec 2018 04:36:24 -0800 From: Christoph Hellwig To: Tomasz Figa Cc: Christoph Hellwig , Laurent Pinchart , "Matwey V. Kornilov" , Linux Media Mailing List , Linux Kernel Mailing List , "Matwey V. Kornilov" , Alan Stern , Ezequiel Garcia , hdegoede@redhat.com, Hans Verkuil , Mauro Carvalho Chehab , rostedt@goodmis.org, mingo@redhat.com, Mike Isely , Bhumika Goyal , Colin King , Kieran Bingham , keiichiw@chromium.org Subject: Re: [PATCH v5 2/2] media: usb: pwc: Don't use coherent DMA buffers for ISO transfer Message-ID: <20181214123624.GA5824@infradead.org> References: <20180821170629.18408-3-matwey@sai.msu.ru> <2213616.rQm4DhIJ7U@avalon> <20181207152502.GA30455@infradead.org> <20181212090917.GA30598@infradead.org> <20181212135440.GA6137@infradead.org> <20181213140329.GA25339@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 14, 2018 at 12:12:38PM +0900, Tomasz Figa wrote: > > If the buffer always is physically contiguous, as it is in the currently > > posted series, we can always map it with a single dma_map_single call > > (if the hardware can handle that in a single segment is a different > > question, but out of scope here). > > Are you sure the buffer is always physically contiguous? At least the > ARM IOMMU dma_ops [1] and the DMA-IOMMU dma_ops [2] will simply > allocate pages without any continuity guarantees and remap the pages > into a contiguous kernel VA (unless DMA_ATTR_NO_KERNEL_MAPPING is > given, which makes them return an opaque cookie instead of the kernel > VA). > > [1] http://git.infradead.org/users/hch/misc.git/blob/2dbb028e4a3017e1b71a6ae3828a3548545eba24:/arch/arm/mm/dma-mapping.c#l1291 > [2] http://git.infradead.org/users/hch/misc.git/blob/2dbb028e4a3017e1b71a6ae3828a3548545eba24:/drivers/iommu/dma-iommu.c#l450 We never end up in this allocator for the new DMA_ATTR_NON_CONSISTENT case, and that is intentional.