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 30D47C433E1 for ; Thu, 20 Aug 2020 17:43:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0CFB3207DE for ; Thu, 20 Aug 2020 17:43:28 +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 S1726309AbgHTRnZ (ORCPT ); Thu, 20 Aug 2020 13:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727118AbgHTRlV (ORCPT ); Thu, 20 Aug 2020 13:41:21 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A636FC061388 for ; Thu, 20 Aug 2020 10:41:20 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id kq25so3516085ejb.3 for ; Thu, 20 Aug 2020 10:41:20 -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=dc7UsrefuAJ6f4/pO3G2ND9DdQaShqSlrC0R9+JPHP/FFduBgVs1sH7JDgS+Tvp4jn SZn3EkdhrLDK1wEXbLRbUI7tIPpEPSd34sbj9MxYPQGFfQPBA3uCPtq6PnCW9OwPO1H+ Q+Jnbtp6V6Bshfsx0tfMWnXa0Z1cnSQw6osYGikbNBlBsRicIRT5e9pJ3a51gJ3kpLrX /u/BzpgiJ4G7fHYkpyAzEXVFNYnH2sWsEgvVdO4SNg5BetysSwhcImIDLGhm8UbvktJZ 4k+YGeozVtHGkTWIjoJCEeIROm8prC44I+7QutT3dUeeg1KhIz739FVrgaS3IwwgGMm4 wDtA== X-Gm-Message-State: AOAM533p5yKUsRkOU7E18OHV1MxbVzjRwMgAuv3ixCHvFZXtA7oPfKuX 7pmyrX+mfze7FH1IJq8gThkMrsFnAPWXqw== X-Google-Smtp-Source: ABdhPJwuJ7C2EyEro1knehOudNlgvFeeJTW4hdAG4m8ogEayahqQ7eYNqW63p7YZgcnV+TmUBlzj5A== X-Received: by 2002:a17:906:4f8c:: with SMTP id o12mr4466911eju.69.1597945279031; Thu, 20 Aug 2020 10:41:19 -0700 (PDT) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com. [209.85.128.52]) by smtp.gmail.com with ESMTPSA id zg6sm1781360ejb.106.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-f52.google.com with SMTP id u18so2401254wmc.3 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" Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@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