Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp284293imm; Thu, 30 Aug 2018 23:53:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYY3v/J8qwVhhFmeq+DPLC2VzdByAxgZSkBg96SRupthohZvKcFOrayFykxhwNc8zgnGaHM X-Received: by 2002:a62:bd4:: with SMTP id 81-v6mr14517328pfl.67.1535698428610; Thu, 30 Aug 2018 23:53:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535698428; cv=none; d=google.com; s=arc-20160816; b=o0nGseTkJZ6CPheWvnGY9ur31VT+7LvKr1nWlG/Nu40MO2xqe4IEInL3gLMNkBMlHb HJC8WJ8lOJ/0O8C8kIzd+9j7jyNuiTHbZGWXsRyrIgHLzHJNrRwM1sGQvPk7CtLJ7IYl HeftQsce9zDGFxt++Cn7V7B3B5WQfZY+uzXu7WYBCckv/4lDVYVxETOvrzu3qnBQmeux ffJiT94POVDO9jMT381ODqtZig8s6Xxs2F21ZZyNSyG91RNltNWfSTDp6aT38LK/4UI2 wFGFaCaAXZmixZYwPC3Jt8bZ1QX8IzVZtMZ3xmzkiwMy8ALMTuOE9FhbL9VTBX6ZJIU1 9Wzw== 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 :arc-authentication-results; bh=TZ/5ZVsKF6hpzEfu+yWQmFbyBRzNosTVXBr10CImg44=; b=MCeLTErwXvQ+NPEDI9aNajRCOG1NJx8LMo4/Ml1NIcZvSQ65sQD9J3fcmx1/28IK1/ dPy7A2ncFUEcAOLCSOMLaMwDpNPyzXWjNne1zNLYPCB7Q58HtaHOHckcqtna6RrF1y5z frial45jAfZa6PVeiFDK3n5zoDC4pXIqYS4s/6Rl0ndR+FGoWbkYYBQCfi1WNG8B7beW W6gW6XHzvE90Wns2WINfGt+/xfCAOUeuXQw3y0r7EHV/O8R6PpK3z7LZIzFvsOJKQKjQ Jj9F/a7PvdCwqu1GKHB7BHCr0KpGT7FXaEq1qChLeP0Pdy9PG++28OyPLxFeGw/zgcZE vx9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EeuGXnoF; 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 u18-v6si9338177pfa.28.2018.08.30.23.53.33; Thu, 30 Aug 2018 23:53:48 -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=EeuGXnoF; 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 S1727295AbeHaK6I (ORCPT + 99 others); Fri, 31 Aug 2018 06:58:08 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:35312 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727177AbeHaK6I (ORCPT ); Fri, 31 Aug 2018 06:58:08 -0400 Received: by mail-yb1-f193.google.com with SMTP id o17-v6so513180yba.2 for ; Thu, 30 Aug 2018 23:52:09 -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=TZ/5ZVsKF6hpzEfu+yWQmFbyBRzNosTVXBr10CImg44=; b=EeuGXnoFznVrYjNfnF5WTaykrX56m4WBd2foQBvzPTJF0Xmi0kYkDXvLlixdz/MSMB Su2JxDeG/egZcvuWi8QyT44wD+UUHCg/DSnxgZm3VaAZXfWtLlOyMhcYMNxBT2Qv3JPs PV964yFRSDqSJIH2qfZ9pxETQysm2/Dh/vECM= 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=TZ/5ZVsKF6hpzEfu+yWQmFbyBRzNosTVXBr10CImg44=; b=HkB4g0Kv1oL0ED1r9BgVBtB4y5ozR5kDeA9JQD77hMHFZIFlHSW/H/69SnmYWlPz02 c1T9OsBYtffqLxXobLabdRTmHRn0XTFqDbHm4xjPkhf/WYZ184h89yhGCk5GhCFV1192 OFnODGTAM7fJ7YqMvrcvPTvTQbiix4aQE+PE2bJoLXXsCGLerYFmTqUeLIzymVnzFob9 NUntvqt6P311H4wgc4wBTimIKlE0ihaBbO4fj7yhMnrDFIVi7BVZnsSBCB0mKbyhCN3C +CKg2Sep/R+5H5j1/6BWieK2uEdNOZupLxoQ313fzivKHSZwHXKN6pvYCZbT+NtHB7cx qdiw== X-Gm-Message-State: APzg51BIRf+FJ4l7l1YfqcjIaFWD7X0n6U/zlOfhF9T61VykCXEGPcIt HJiOqUDzB4/tMdc0M9mmZ3aPrkwyqXRYkg== X-Received: by 2002:a25:690e:: with SMTP id e14-v6mr7826160ybc.468.1535698328344; Thu, 30 Aug 2018 23:52:08 -0700 (PDT) Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com. [209.85.219.177]) by smtp.gmail.com with ESMTPSA id m82-v6sm3987724ywc.29.2018.08.30.23.52.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Aug 2018 23:52:07 -0700 (PDT) Received: by mail-yb1-f177.google.com with SMTP id f145-v6so513600ybg.4 for ; Thu, 30 Aug 2018 23:52:06 -0700 (PDT) X-Received: by 2002:a25:348a:: with SMTP id b132-v6mr7857994yba.373.1535698325907; Thu, 30 Aug 2018 23:52:05 -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: <20180831055047.GA9140@infradead.org> From: Tomasz Figa Date: Fri, 31 Aug 2018 15:51:54 +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 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. Best regards, Tomasz