Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2297408imm; Sun, 5 Aug 2018 00:51:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcQnml/auXZpo3Hg2IKc/lWZ7zjw1es+CAMoHB+gS6RPYjikg3WJc2yTX17O9jG0tKx2RZ2 X-Received: by 2002:a62:225d:: with SMTP id i90-v6mr11847526pfi.246.1533455473132; Sun, 05 Aug 2018 00:51:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533455473; cv=none; d=google.com; s=arc-20160816; b=kfG3SZVSNhsmkI4Z1elMhEdgW7hkSX3xg/OKmMmlehnOoGCGQBeXtpiJKPudTz+T6I Q4gRJL/XevwzXmYqdQYx9OOev9LiiEKDLGsSg1qAbU3gaCg394z4hVt0pdrCWGzf4ExR Q8VchEYOnZB+WfU+pa+7KjLSh+p/q2M+luEwkaWOer4hUyO57etkJUHNebPrcwGent9i OCQQgudapf/GZkYl+K4M+uav4StGjSgnR4GC32Ystby3VN9bDAFoHbx4qs5pmqGqiK1Q d4XudkFwm9XEl59ExIyiLYDQmqzJxQxenTWI6E3r59J18Aq4k+cTUqn58BTi3vbikweI bMKg== 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:arc-authentication-results; bh=mDLJUZVnfGck7/mRN0Qwhj6/jholuzBwu2E3TSEDagc=; b=gvweCUiZuc3vHmFbBy15Ls5fX2+7s4F/IqCNXGBZKeVuRRB2DmzXqXk1xkNh9RMw2x YNsGHq1xc+uTALloZeW+AHAVy+MvP9zypsUw5PXa7NtSuS3OXqp2f6apI51tKQQcoNZH jZ5ShFGB4gj48DNm12345wlE4Shk/nZ2MSMvvJNXxmN9rTJBFO7qTLtPjDYlz7rLYrk8 uyR3nacFMiw1SH3kMAjUN95C/SO/qJJ0NFidIKeuWAFQH57yCnkj4LsKDY2L2aXXibs9 JQVHvPTYZnNoS0eOPLByUF9vN8UBDmVvwXJ81aWu8xNBt668O+RVIMc+NcHHu8xlQaOd L6uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jqPq8aIQ; 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 v18-v6si9773037pgh.162.2018.08.05.00.50.58; Sun, 05 Aug 2018 00:51:13 -0700 (PDT) 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=jqPq8aIQ; 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 S1726282AbeHEJxu (ORCPT + 99 others); Sun, 5 Aug 2018 05:53:50 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:53808 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeHEJxt (ORCPT ); Sun, 5 Aug 2018 05:53:49 -0400 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=mDLJUZVnfGck7/mRN0Qwhj6/jholuzBwu2E3TSEDagc=; b=jqPq8aIQKdOtKUGcgkjWZ+xt/ /iEAxjrwyDuPzirBqdfqmR/AWyz21RL1eDkOgnL1S75Z9r5TGy+aWqWo3r919xKm7Zc/vb9oymyQ5 8MwgInmkqjvookN23by44U4ZLIYRDfTlKKWXEZb/8NypjZZ0P3+G5hB94Sm0+HuQstYfzLHVpCnyj 4swVi8bwSDTzrvrOeJHrT6X2yGVBRDvBiph/asi1J5mUMj8wVWIW1z4Y1amct3HjInRYtQRjuJ7Np hbsVlNFGSDLwQzdQTZOFbZEP1aEQZqHYI7w9hwq2LD2Ra65wREQO38BKA+aWY+ciQ0ci20Mx6zzow ekHtan/ug==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmDnP-00058m-2u; Sun, 05 Aug 2018 07:49:47 +0000 Date: Sun, 5 Aug 2018 00:49:46 -0700 From: Christoph Hellwig To: Alan Stern Cc: "Matwey V. Kornilov" , Laurent Pinchart , Tomasz Figa , Ezequiel Garcia , Hans de Goede , Hans Verkuil , Mauro Carvalho Chehab , Steven Rostedt , mingo@redhat.com, Mike Isely , Bhumika Goyal , Colin King , Linux Media Mailing List , Linux Kernel Mailing List , Kieran Bingham , keiichiw@chromium.org Subject: Re: [PATCH 2/2] media: usb: pwc: Don't use coherent DMA buffers for ISO transfer Message-ID: <20180805074946.GA14119@infradead.org> References: 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 Sat, Aug 04, 2018 at 10:46:35AM -0400, Alan Stern wrote: > > 2) dma_unmap and dma_map in the handler: > > 2A) dma_unmap_single call: 28.8 +- 1.5 usec > > 2B) memcpy and the rest: 58 +- 6 usec > > 2C) dma_map_single call: 22 +- 2 usec > > Total: 110 +- 7 usec > > > > 3) dma_sync_single_for_cpu > > 3A) dma_sync_single_for_cpu call: 29.4 +- 1.7 usec > > 3B) memcpy and the rest: 59 +- 6 usec > > 3C) noop (trace events overhead): 5 +- 2 usec > > Total: 93 +- 7 usec > > > > So, now we see that 2A and 3A (as well as 2B and 3B) agree good within > > error ranges. > > Taken together, those measurements look like a pretty good argument for > always using dma_sync_single_for_cpu in the driver. Provided results > on other platforms aren't too far out of line with these results. Logically speaking on no-mmio no-swiotlb platforms dma_sync_single_for_cpu and dma_unmap should always be identical. With the migration towards everyone using dma-direct and dma-noncoherent this is actually going to be enforced, and I plan to move that enforcement to common code in the next merge window or two.