From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0915C433E1 for ; Thu, 20 Aug 2020 17:41:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 653B5207DE for ; Thu, 20 Aug 2020 17:41:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cAZtzVYP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 653B5207DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DB3016B0095; Thu, 20 Aug 2020 13:41:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D614A6B0096; Thu, 20 Aug 2020 13:41:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2B188D004B; Thu, 20 Aug 2020 13:41:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id ACBA06B0095 for ; Thu, 20 Aug 2020 13:41:20 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 64795824556B for ; Thu, 20 Aug 2020 17:41:20 +0000 (UTC) X-FDA: 77171663520.21.corn80_4313a1927032 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 30B12180442C0 for ; Thu, 20 Aug 2020 17:41:20 +0000 (UTC) X-HE-Tag: corn80_4313a1927032 X-Filterd-Recvd-Size: 5952 Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Aug 2020 17:41:19 +0000 (UTC) Received: by mail-ej1-f68.google.com with SMTP id kq25so3516033ejb.3 for ; Thu, 20 Aug 2020 10:41:19 -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=TdWdmS9KmpqRDKTTx4ZFKlZV0sk8Q5cLOhIOkZ1gD+w=; b=cAZtzVYP2n3YvXgVkbJ7dbST+g3SP0UPbXQ9iKKyhX4VXr8jHpSYHqZMaG5ucNVipI bzzpnQCIz78GKzn14VpRAj8Y6mpMr87iyH7UMbPsjr5O6z0niDquexdhhjTmn1y5QjQv l8iJOpqbyOslL4LKhF6zS+g3cTQ+z78POnoVc= 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=TdWdmS9KmpqRDKTTx4ZFKlZV0sk8Q5cLOhIOkZ1gD+w=; b=fTQNePyjlVJzU56alPvKpN3dtrbILW5eoMuwylwVBpJEYYbAFGxQxoontCz418brEE ShjNpNUMWRUfJQnKTswvE+uZE+VRNSwC3XWIgI7dxzaHORTDn5F4oQHQO4g4Yxsmrr0D VAXEqU/70eqXqcC0Du5o1/sQwQOgnLxejH4HRkh+/Zp7aSm6rulLb6F6YfhOkSUl41wQ VhcbUKwBKkOa8f4hBWRdWKr4ufqPaMx5rbgErQStl3Su+8+uxK8QlwWvic9oUeh/HjQj CWrDcTxRtBldHpPxJDWVsHco853Ss94Pvbx4RUE5uf1DWO+O9b7C8lPX8sQi8/SKQtpG n3VA== X-Gm-Message-State: AOAM532ejY/UcMjKO3v0ydlRIj0Fs7I5G1mtVqnyQqZgEIyKq7HQbglt 2U3t217s1Hdi1MDNwmcS/daDFSbUDiS6DQ== X-Google-Smtp-Source: ABdhPJw8uNBuBhu79HzDcfzf8WXY1ceWLP7hKIHTp92uTwruWZgXSSOpfuEuvpmGey9gnOQ/0v8KfQ== X-Received: by 2002:a17:907:7255:: with SMTP id ds21mr4630778ejc.44.1597945278093; Thu, 20 Aug 2020 10:41:18 -0700 (PDT) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com. [209.85.128.46]) by smtp.gmail.com with ESMTPSA id t18sm1833438ejf.38.2020.08.20.10.41.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Aug 2020 10:41:17 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id p14so2398494wmg.1 for ; Thu, 20 Aug 2020 10:41:16 -0700 (PDT) X-Received: by 2002:a1c:4d12:: with SMTP id o18mr4512279wmh.55.1597945276327; Thu, 20 Aug 2020 10:41:16 -0700 (PDT) MIME-Version: 1.0 References: <20200819065555.1802761-1-hch@lst.de> <20200819065555.1802761-6-hch@lst.de> <62e4f4fc-c8a5-3ee8-c576-fe7178cb4356@arm.com> <2b32f1d8-16f7-3352-40a5-420993d52fb5@arm.com> <20200820050214.GA4815@lst.de> <20200820165213.GC12693@lst.de> In-Reply-To: <20200820165213.GC12693@lst.de> From: Tomasz Figa Date: Thu, 20 Aug 2020 19:41:03 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 05/28] media/v4l2: remove V4L2-FLAG-MEMORY-NON-CONSISTENT To: Christoph Hellwig Cc: Robin Murphy , alsa-devel@alsa-project.org, linux-ia64@vger.kernel.org, Linux Doc Mailing List , nouveau@lists.freedesktop.org, linux-nvme@lists.infradead.org, Linux Kernel Mailing List , "James E.J. Bottomley" , linux-mm@kvack.org, Marek Szyprowski , linux-samsung-soc , Joonyoung Shim , linux-scsi@vger.kernel.org, Kyungmin Park , Ben Skeggs , Matt Porter , Linux Media Mailing List , Tom Lendacky , Pawel Osciak , Mauro Carvalho Chehab , "list@263.net:IOMMU DRIVERS" , Joerg Roedel , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Thomas Bogendoerfer , linux-parisc@vger.kernel.org, netdev@vger.kernel.org, Seung-Woo Kim , linux-mips@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 30B12180442C0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Aug 20, 2020 at 6:52 PM Christoph Hellwig wrote: > > On Thu, Aug 20, 2020 at 12:24:31PM +0200, Tomasz Figa wrote: > > > Of course this still uses the scatterlist structure with its annoying > > > mix of input and output parametes, so I'd rather not expose it as > > > an official API at the DMA layer. > > > > The problem with the above open coded approach is that it requires > > explicit handling of the non-IOMMU and IOMMU cases and this is exactly > > what we don't want to have in vb2 and what was actually the job of the > > DMA API to hide. Is the plan to actually move the IOMMU handling out > > of the DMA API? > > > > Do you think we could instead turn it into a dma_alloc_noncoherent() > > helper, which has similar semantics as dma_alloc_attrs() and handles > > the various corner cases (e.g. invalidate_kernel_vmap_range and > > flush_kernel_vmap_range) to achieve the desired functionality without > > delegating the "hell", as you called it, to the users? > > Yes, I guess I could do something in that direction. At least for > dma-iommu, which thanks to Robin should be all you'll need in the > foreseeable future. That would be really great. Let me know if we can help by testing with V4L2/vb2 or in any other way. Best regards, Tomasz