Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp746979ybf; Wed, 26 Feb 2020 22:30:29 -0800 (PST) X-Google-Smtp-Source: APXvYqxZGKUwYtmosRCpkvEbZTtqk3BIQdEMUuDOoL1e5s22/hZ+I5hLPCxLyb2eJmCvb6flC0e/ X-Received: by 2002:a9d:63c6:: with SMTP id e6mr1965230otl.365.1582785029543; Wed, 26 Feb 2020 22:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582785029; cv=none; d=google.com; s=arc-20160816; b=ije0K7JiU9Dp+M8fcHexDFdQYgw6CYLYGNCX6P/GF7B7kMBVNefyXt7BWqQla7TG8m D+sWU7Pphmst5Jed1p+N5P9Zs+VwTHmJUo3NbZh2OZfKG1dpYptKLAHytEuHFzelECBj NxbCQ4Ucn7Uo9NLBUUhU0N/72uiN8tcAYsVotLIC4fsmE/ywxHhIQl67Ri+1475zzM/W mGiaONE1teph+pE/P1iPc5DqbxJxudkRwtiAJWxpP7D9jeI5aK1LPddolPn3MCC7SxVu yIN54CxII6u4YHzymHum3VX3JFwWZkEpreo6SP0IzOD828Gm0KvYyeggW5uZjTsoMYCZ V1yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qc/8gjwoSjhv1WAaPphN4gG7vMp46r7eAyhBiGEqLNs=; b=S+/Mra4cu+rcGeH1UcgR2n0QBuUgNT8XmYOq9U8CEA1LliLfYC82HXx4CTeTxFDUKN lWwDSBoTcHZJRqem94tMeB+6gR/KOLvJaMyH70ADnYFRemziQzs8jWPBLQBZGNPLjZeE SyWe0wzq4iNk/byPXS/pliS+aICIlOvMMmlhDB5MK/FbhgGJQ8oiaN8DADcBd/g4Gdio sICuR6bxHdDIXNCEOC2WBV4el5MZhv0BoRKf8AZp3PdhtlAVLDgYZAH6VKFm4meRBPcm Q0/gF8IVbkiJ6G7rtk3SC+Rn8eKyqngTGEO47A8YH/Cqy4GWOYD4f3hR7JJoJugPSGjc xv/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="npI8N/06"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k13si827002oij.118.2020.02.26.22.30.18; Wed, 26 Feb 2020 22:30:29 -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=pass header.i=@chromium.org header.s=google header.b="npI8N/06"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728421AbgB0G2W (ORCPT + 99 others); Thu, 27 Feb 2020 01:28:22 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:40373 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726575AbgB0G2V (ORCPT ); Thu, 27 Feb 2020 01:28:21 -0500 Received: by mail-ed1-f65.google.com with SMTP id p3so1886585edx.7 for ; Wed, 26 Feb 2020 22:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qc/8gjwoSjhv1WAaPphN4gG7vMp46r7eAyhBiGEqLNs=; b=npI8N/06lMSjD76Xcc/BTWLlQT34lMDfw3GeZ58xWNJ/dhjfX4cJcHqhnYAfRrwMGr LPb5I8MHPsPEpf2j+kjjnkLdm8FNl5MfQtq+AbsEdOOBGKNg+gXW3/3mQSDUno7qspET QfGdFEYcQnKlfIjSUH4HN6s5OYzN1k0UHSvRs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qc/8gjwoSjhv1WAaPphN4gG7vMp46r7eAyhBiGEqLNs=; b=Jxly89TSxZpTgNen3ECR6NjIKyc4QRE2hLzrwSGllm78GqJBF9Noq/dqHgEMhje3nQ zl5FDC5PJnZHkZSjsyMrgeAhrk+rKSA9wVzI2vCf/4jIudiJ2Z15SIB2Ayd2b9JkARvU d8YJUzH0RRj/gTL0kOkNitxiIdQOZvEYIeJZ+k9bpnhjSfx88Z33ET1fSx0xUdvP2vO2 BqlpUnbcFV2LG9trmI4ELukY2WfxZVfnq0hFaKEN2I3p0BogohWazdV4YALZeDWan0kv KVzp93XJCFO70MDvseRs7qYDWO9o+r21QY/MraHE7+bMPSWKkFQT5kH+/SbSv5co9gdz XTFw== X-Gm-Message-State: APjAAAXDemcMG4CKR8ChiJN3rjTYfhpuXKgOC8H+rehfEXmu/fKKCeBd 3uOVui8O0Fz3wMhzbetAeNuhyDF2F5S3Sw== X-Received: by 2002:a50:ee91:: with SMTP id f17mr2227211edr.130.1582784898962; Wed, 26 Feb 2020 22:28:18 -0800 (PST) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com. [209.85.128.50]) by smtp.gmail.com with ESMTPSA id e21sm281321eds.36.2020.02.26.22.28.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 26 Feb 2020 22:28:17 -0800 (PST) Received: by mail-wm1-f50.google.com with SMTP id a5so2158259wmb.0 for ; Wed, 26 Feb 2020 22:28:17 -0800 (PST) X-Received: by 2002:a05:600c:2c48:: with SMTP id r8mr3065839wmg.183.1582784896863; Wed, 26 Feb 2020 22:28:16 -0800 (PST) MIME-Version: 1.0 References: <20190802131226.123800-1-shik@chromium.org> <20190930082310.GA1750@infradead.org> <20191001063744.GA10402@infradead.org> In-Reply-To: <20191001063744.GA10402@infradead.org> From: Tomasz Figa Date: Thu, 27 Feb 2020 15:28:05 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] media: uvcvideo: Use streaming DMA APIs to transfer buffers To: Christoph Hellwig , Sergey Senozhatsky Cc: Nicolas Boichat , Shik Chen , Linux Media Mailing List , notify@kernel.org, Keiichi Watanabe , Ricky Liang , Mauro Carvalho Chehab , Laurent Pinchart , lkml , Kieran Bingham , Vlastimil Babka , Christoph Lameter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +Sergey Senozhatsky who's going to be looking into this. Hi Christoph, On Tue, Oct 1, 2019 at 3:37 PM Christoph Hellwig wrote: > > On Mon, Sep 30, 2019 at 01:23:10AM -0700, Christoph Hellwig wrote: > > And drivers really have no business looking at the dma mask. I have > > a plan for dma_alloc_pages API that could replace that cruft, but > > until then please use GFP_KERNEL and let the dma subsystem bounce > > buffer if needed. > > Can you try this series: > > http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma_alloc_pages > > and see if it does whay you need for usb? Reviving this thread. Sorry for no updates for a long time. dma_alloc_pages() still wouldn't be an equivalent replacement of the existing dma_alloc_coherent() (used behind the scenes by usb_alloc_coherent()). That's because the latter can allocate non-contiguous memory if the DMA device can handle it (i.e. is behind an IOMMU), but the former can only allocate a contiguous range of pages. That said, I noticed that you also put a lot of effort into making the NONCONSISTENT attribute more usable. Perhaps that's the way to go here then? Of course we would need to make sure that the attribute is handled properly on ARM and ARM64, which are the most affected platforms. Right now neither handles them. The former doesn't use the generic DMA mapping ops, while the latter does, but doesn't enable a Kconfig option needed to allow generic inconsistent allocations. Any hints would be appreciated. Best regards, Tomasz