Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6129452imm; Mon, 23 Jul 2018 11:58:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd/OkSdhiHT/fpCBfWsko3AQ82pyymItONSpeXZELHPWyv58D7g9O4Jh2Wsg7xoUKJflFag X-Received: by 2002:a63:db4f:: with SMTP id x15-v6mr1038053pgi.214.1532372323874; Mon, 23 Jul 2018 11:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532372323; cv=none; d=google.com; s=arc-20160816; b=VGbL+HCL+uCOjxJ+77avHF6hX5AjxOiPzfA8fDvpDYcNtE176TXjDT/zliB88A/KCX AXH7exvmgYSH4V58++HMu2AWa1lpzPhMQ2ldG8xrJkvpaxAf0ITj8flSXhLFmWWx9y3o rduf8ygLdmbBAe3FJGIUF8v7LQ/gIrxehvL3tYMfOlQvi7gSh8v3XSJS2l3kJ0D6L9NP OBFdMpHqNYNb2wYdFSVq9e86r7K1jNVTCForjI4A7enpf7vFGnbbMIhJkudWSipiXWGj Gm3SICaKtRLrfHRI3sIVFpArz6MMFC8q+4Qm1Giu6/2ARQICq6/jRTVM1qcvclZk/Opf sawQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=R+8LfpSSJ6Tdje/kh4a41dKkWSNLRkV9Cs44iQVxQII=; b=oRGF6VA7yVktMun/CcFNNbr8LEnhHCuwUKIOb7E+wDurjwcspATFhCvbMIB779kxbx dOMp4QbiNDUye4u1fm302w6+J09GLyj8DVE65N+QQiKa7UjV6Nx7DG56pRwYESjTaWBc ExBY27m9bJXb8mzxcpyN06sXJloBOi3pHhTgaQqms16ghYsplifOjWKF8oRagvdRaud3 KGSm4EgNZpw6/kRb5+6JwIlsywaEDf/Y87uHKceUZVFaQNb94iFvHdkFWaTvR+xAFCzv 1JvESMvWnGmgmA3c2GSMLnHtrMIof2xa7qffij1erGll4OPDbn6elajDB7UCslN6qcCS eQTw== ARC-Authentication-Results: i=1; mx.google.com; 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 1-v6si8297854plu.282.2018.07.23.11.58.22; Mon, 23 Jul 2018 11:58:43 -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; 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 S2388087AbeGWT76 (ORCPT + 99 others); Mon, 23 Jul 2018 15:59:58 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:35630 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S2387970AbeGWT76 (ORCPT ); Mon, 23 Jul 2018 15:59:58 -0400 Received: (qmail 1416 invoked by uid 2102); 23 Jul 2018 14:57:23 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 23 Jul 2018 14:57:23 -0400 Date: Mon, 23 Jul 2018 14:57:23 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Matwey V. Kornilov" cc: Tomasz Figa , Ezequiel Garcia , Hans de Goede , Hans Verkuil , Mauro Carvalho Chehab , Laurent Pinchart , Steven Rostedt , , Mike Isely , Bhumika Goyal , Colin King , Linux Media Mailing List , Linux Kernel Mailing List , Kieran Bingham , Subject: Re: [PATCH 2/2] media: usb: pwc: Don't use coherent DMA buffers for ISO transfer In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Jul 2018, Matwey V. Kornilov wrote: > I've tried to strategies: > > 1) Use dma_unmap and dma_map inside the handler (I suppose this is > similar to how USB core does when there is no URB_NO_TRANSFER_DMA_MAP) Yes. > 2) Use sync_cpu and sync_device inside the handler (and dma_map only > once at memory allocation) > > It is interesting that dma_unmap/dma_map pair leads to the lower > overhead (+1us) than sync_cpu/sync_device (+2us) at x86_64 platform. > At armv7l platform using dma_unmap/dma_map leads to ~50 usec in the > handler, and sync_cpu/sync_device - ~65 usec. > > However, I am not sure is it mandatory to call > dma_sync_single_for_device for FROM_DEVICE direction? According to Documentation/DMA-API-HOWTO.txt, the CPU should not write to a DMA_FROM_DEVICE-mapped area, so dma_sync_single_for_device() is not needed. Alan Stern