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 A3B5CC433E1 for ; Thu, 20 Aug 2020 17:48:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AADB20885 for ; Thu, 20 Aug 2020 17:48:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="cAZtzVYP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbgHTRsY (ORCPT ); Thu, 20 Aug 2020 13:48:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726723AbgHTRsW (ORCPT ); Thu, 20 Aug 2020 13:48:22 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 606DDC061385 for ; Thu, 20 Aug 2020 10:48:22 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id jp10so3565720ejb.0 for ; Thu, 20 Aug 2020 10:48:22 -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=t/kPVI1zhvsASZd5YUnLGRmts0SeCCKPbA0VRDt71mBoFTYOndX2VwXVLAbqiLSo7N 114PYd0oVXsEIKPj5TWQMvfbeM68PA9hMYOnaHD2QH+FwYPFyM2Cc/Th8iUpgs31NmqL NO3Q4pgaWR5VY8y0C77llC+3ri3MaceFzdlFU/jyWCPZq/tEiSzJjLmF1e8Bno9QOZZA nn8cA36R8JmWySw7ysCitj71MVgSz9eT7zrchQ8outJuexqUmoLn5NgxoPm4tZBAeqXJ 0MAiAdYyji7jsmMi1UwpO0zRD1tZKYciI646u/BxSkyCq3hbuypVLwu8Zwbs75d6Zf6R z9yQ== X-Gm-Message-State: AOAM5323rrvoK3FxcK6qwIqMJ+0fh64M43os97dodxfWO23RICFKs4Ln P9rckKvuyhrW6xS4N637ANYwwOspn7xxOw== X-Google-Smtp-Source: ABdhPJw5iGdAmNaEMQ1SvZNkmIye8Ofdbatw5/3Xqrwt/nwsMW57+0k+bY2ITTp8AnIAZlQQg86/Rg== X-Received: by 2002:a17:906:89a:: with SMTP id n26mr4169614eje.363.1597945700829; Thu, 20 Aug 2020 10:48:20 -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 kt27sm1790061ejb.15.2020.08.20.10.48.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Aug 2020 10:48:20 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id 9so2428514wmj.5 for ; Thu, 20 Aug 2020 10:48:20 -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" Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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