Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp54464imm; Tue, 17 Jul 2018 13:52:00 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe9IxN7nP67WcqrfQHqddqgx2w2+pinE5rzPfqxa2l/UE7H5k7y4FLXSi2bCiiRwju5+sbQ X-Received: by 2002:a17:902:708b:: with SMTP id z11-v6mr3067199plk.262.1531860720623; Tue, 17 Jul 2018 13:52:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531860720; cv=none; d=google.com; s=arc-20160816; b=LuF4RieyQZEq5fXAX8fOqqeuyDWClz3kYgycywrRnRWFKgV0iMOIjOjc54rnYkE3as 31a/KmQo1tTtBd0fH3gGeyyavZwM41gq5wz+4i8LORM5LQnxdde5Lv94iI+DuSbdEAIq iC2hyzdJ57aVLI32tWFHwFh+1/AWv+Dna85MuPi5k+xQiwofGAUQLlMZKKR/fqmmWXbO /glMASywpvtgIimPPlV1Kg+Vk3EuNiaPWKx0LAFlxaA5TsCC92LNVk4aAaRkvuLGiKt1 vqJIiDiGVLhkwkMo1u3jAEVzPs29EfgN4hW0lF9vbhDzOQnetyp5I/EdCy4cK0FNs0n0 84Eg== 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=QpdKMeTb5S4xA9qi10MgtxGiGPQnv18YygaAOY6Bm0c=; b=q8lCFHCd/6SjtRmdrJ3GpSKDTU83KBI/bAsA3QlqtEhRfdQuAP0nwpupjKLzi2Hjeh KX/esbpSmzXvrAC8Co24nbOeCqoSgsMwS3Z6e6pkxoGhi+UV1laY6dc/tO8rzqQw2wVu kp7TQba91uBF5zoyQNUk/mo4ZiDRhAPmCNOIOJstSs0lxJEAouESAv1RV/yvDfq/76+y Ns0tt2IvJsv/zdppZJg4uSgJqSF5wPsH1P8pvnEQILMScJQ7nHJXBkAU9+eCssDPUJA/ I/dHkAqScpjI65EgrCP6+ZtDAQi3MpVDynPWHmUVKWzcDLOEiqCK+sVcfmdFWugvW8xu K2eQ== 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 t10-v6si1742795pge.624.2018.07.17.13.51.45; Tue, 17 Jul 2018 13:52:00 -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 S1730063AbeGQVZf (ORCPT + 99 others); Tue, 17 Jul 2018 17:25:35 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:46548 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1729738AbeGQVZf (ORCPT ); Tue, 17 Jul 2018 17:25:35 -0400 Received: (qmail 4549 invoked by uid 2102); 17 Jul 2018 16:51:10 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 17 Jul 2018 16:51:10 -0400 Date: Tue, 17 Jul 2018 16:51:10 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Ezequiel Garcia cc: "Matwey V. Kornilov" , Hans de Goede , , , Laurent Pinchart , , , , , , , open list 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 Tue, 17 Jul 2018, Ezequiel Garcia wrote: > Hi Matwey, > > First of all, sorry for the delay. > > Adding Alan and Hans. Guys, do you have any feedback here? ... > > > So, what is the benefit of using consistent > > > for these URBs, as opposed to streaming? > > > > I don't know, I think there is no real benefit and all we see is a > > consequence of copy-pasta when some webcam drivers were inspired by > > others and development priparily was going at x86 platforms. > > You are probably right about the copy-pasta. > > > It would > > be great if somebody corrected me here. DMA Coherence is quite strong > > property and I cannot figure out how can it help when streaming video. > > The CPU host always reads from the buffer and never writes to. > > Hardware perepherial always writes to and never reads from. Moreover, > > buffer access is mutually exclusive and separated in time by Interrupt > > fireing and URB starting (when we reuse existing URB for new request). > > Only single one memory barrier is really required here. > > > > Yeah, and not setting URB_NO_TRANSFER_DMA_MAP makes the USB core > create DMA mappings and use the streaming API. Which makes more > sense in hardware without hardware coherency. As far as I know, the _only_ advantage to using coherent DMA in this situation is that you then do not have to pay the overhead of constantly setting up and tearing down the streaming mappings. So it depends very much on the platform: If coherent buffers are cached then it's a slight win and otherwise it's a big lose. Alan Stern