From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6894EC6786C for ; Fri, 14 Dec 2018 12:36:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D8E020892 for ; Fri, 14 Dec 2018 12:36:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ryNQmOc1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2D8E020892 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730584AbeLNMgc (ORCPT ); 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.