Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5469942imd; Tue, 30 Oct 2018 18:57:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5df1glg02ouocrd20OYVo5lJcYrKyCm7sEldA+EU/KWdaf/9Rnd+G09G/MTaR/ND2m6ua4a X-Received: by 2002:a17:902:598f:: with SMTP id p15-v6mr1236088pli.260.1540951059265; Tue, 30 Oct 2018 18:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540951059; cv=none; d=google.com; s=arc-20160816; b=GMg4W+o0JMHZfh3VjN8K7HJ2LmEFkP5F7xEBJJXE17DC4x2hsPwJH4HS+KZjGi7rza h/TctROQ1OGcLZJjSw+lSmae7sEqvLl1xlQukUf/5lpT00DlDutiJAhAS26RqJqz5Pqk pZA1uyrq/kIseHe22aYdwd8t39ltK2SDrZgacXoYUZ86R9B6jek4UbyBJYGx/N+huLQl YoO03XJ8fFOQagS4fk6dmGP4ZSAx0YzXcpKNr6s8uiimhjhIO9YpMww1lwMuJKja4xOa stVdZzjtdgIqIQDH3ylapx1R9IZVns73GOp07SR86o6p92tuqGqAVqIhHfjpB3vWBHwf dWXw== 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=dANn4BAtzoKkFNbKfn+sdmraBQiu6PinfiQ2zd82Nq8=; b=ltfHFku/TTzJjSqd8TZ5Ruk4Q5gcbN4rUrotGjxLv+gbS2u0WfcG7YQXF8mT0eZDj6 wEsSN7b4h7pVhvki1OyvLoDrQbYrBjKERgH7TYDPuFiibizlI0lg5yk5nGHXM/4Qmeje Po7B3l5BgHxeuYeC9CRgji6lG/a3Cern2zFgzwo+WN5VVl3irhzyYOloFOMSO4dUQKYx TpeMIcORpZB7DYRKGPqZBJ/UHSG/Q5ONd8osau86KZBbr0cqUf98X8AcsWxnWDmhSWn4 QPxFbQm7AjD3Dk7lL5Muex98Ve8+EhI5fFMC7Y4dAnkMaoKkB7Lpkni6UmDOZec9Lori cmlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PLwQTHFH; 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 cf14-v6si25379775plb.422.2018.10.30.18.57.23; Tue, 30 Oct 2018 18:57:39 -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=pass header.i=@chromium.org header.s=google header.b=PLwQTHFH; 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 S1728658AbeJaKvc (ORCPT + 99 others); Wed, 31 Oct 2018 06:51:32 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:41689 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728341AbeJaKvc (ORCPT ); Wed, 31 Oct 2018 06:51:32 -0400 Received: by mail-yb1-f196.google.com with SMTP id e16-v6so5943964ybk.8 for ; Tue, 30 Oct 2018 18:55:37 -0700 (PDT) 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=dANn4BAtzoKkFNbKfn+sdmraBQiu6PinfiQ2zd82Nq8=; b=PLwQTHFHp3R3kjqFtLsPrlokMscSQ6YnAmv+4xHgg9d5vqURS2QoNAD3/tP9jqB24j ENTzRXr+Y9bluGHDSrEa97c5UWnR18/2UXeaev5zGfWujwAEZvvPgT99m/C5qRycMrCE jPfVpsTtbWjIZ3L+GK2iIktCqci4ltMDNeMxo= 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=dANn4BAtzoKkFNbKfn+sdmraBQiu6PinfiQ2zd82Nq8=; b=Bh0MT6Mw6o48nyPo27ts/1awgCdSS1WSOG3aazZvZ0hrfQN5laFX1J8K5uQb6RP5st P+XaMpT5ilX8lu69KPM2VAU43ILrBmRaZaHAFm9PV+GZLbJz4V3O8gd9RATkAYpk3xBv qZ8nBw9M3+7d+TOvybWbCPY4Nt0pqkkAba9QyoiZ4XVAoz8MmNd2+gWGKm7v5Uxgl8AW u9YocCr02iNhrJM2V+gn4aDUwcKWbU8BNSmKDrOknpxXNsw2jZrt1ni/8pdA453IxvgX og8UiTIOF4sGFc3VyyXtynMkwaxAWsG1yX/Et5wwWEX4dXkgBWnVGWNRd2gsoHH/culB bofw== X-Gm-Message-State: AGRZ1gIQi500pYCDLuUzrqVYhc1aY3uahhwFU4V9PYxcsacsATsR3E6w 1HcRQUKyxN+KKyFD2Kctc153s2HvBEA= X-Received: by 2002:a25:308a:: with SMTP id w132-v6mr1197476ybw.106.1540950937073; Tue, 30 Oct 2018 18:55:37 -0700 (PDT) Received: from mail-yw1-f46.google.com (mail-yw1-f46.google.com. [209.85.161.46]) by smtp.gmail.com with ESMTPSA id c128-v6sm7537307ywb.68.2018.10.30.18.55.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 18:55:35 -0700 (PDT) Received: by mail-yw1-f46.google.com with SMTP id v77-v6so5809868ywc.4 for ; Tue, 30 Oct 2018 18:55:35 -0700 (PDT) X-Received: by 2002:a81:350c:: with SMTP id c12-v6mr1185701ywa.342.1540950934970; Tue, 30 Oct 2018 18:55:34 -0700 (PDT) MIME-Version: 1.0 References: <20180830172030.23344-1-ezequiel@collabora.com> <20180830172030.23344-3-ezequiel@collabora.com> <20180830175850.GA11521@infradead.org> <4fc5107f93871599ead017af7ad50f22535a7683.camel@collabora.com> <20180831055047.GA9140@infradead.org> In-Reply-To: From: Tomasz Figa Date: Wed, 31 Oct 2018 10:55:23 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 2/3] USB: core: Add non-coherent buffer allocation helpers To: Christoph Hellwig Cc: Ezequiel Garcia , Linux Media Mailing List , linux-usb@vger.kernel.org, "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Linux Kernel Mailing List , Laurent Pinchart , "Matwey V. Kornilov" , Alan Stern , kernel@collabora.com, keiichiw@chromium.org 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 Hi Christoph and everyone, On Fri, Aug 31, 2018 at 3:51 PM Tomasz Figa wrote: > > On Fri, Aug 31, 2018 at 2:50 PM Christoph Hellwig wrote: > > > > On Thu, Aug 30, 2018 at 07:11:35PM -0300, Ezequiel Garcia wrote: > > > On Thu, 2018-08-30 at 10:58 -0700, Christoph Hellwig wrote: > > > > Please don't introduce new DMA_ATTR_NON_CONSISTENT users, it is > > > > a rather horrible interface, and I plan to kill it off rather sooner > > > > than later. I plan to post some patches for a better interface > > > > that can reuse the normal dma_sync_single_* interfaces for ownership > > > > transfers. I can happily include usb in that initial patch set based > > > > on your work here if that helps. > > > > > > Please do. Until we have proper allocators that go thru the DMA API, > > > drivers will have to kmalloc the USB transfer buffers, and have > > > streaming mappings. Which in turns mean not using IOMMU or CMA. > > > > dma_map_page will of course use the iommu. > > Sure, dma_map*() will, but using kmalloc() defeats (half of) the > purpose of it, since contiguous memory would be allocated > unnecessarily, risking failures due to fragmentation. Have we reached a conclusion here? It sounds like it's a quite significant problem, at least for some of the camera (media) devices over there and there are people interested in solving it, so all we need here is a conclusion on how to do it. :) Best regards, Tomasz