Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1417318pxa; Thu, 20 Aug 2020 10:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj4kPHViLl9b0q9uMKkIFpzh7WX+/rE68FRJg7RR/bqCpQFsNx71f7U8A6c5lCOYqwU+ag X-Received: by 2002:a17:906:ca5a:: with SMTP id jx26mr4189401ejb.62.1597945375765; Thu, 20 Aug 2020 10:42:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597945375; cv=none; d=google.com; s=arc-20160816; b=lp98csqnlRBQqFD+c8LrJr8yH9wDxNlZvkaq6M2//z3ZsEd5SUbi2fmKfcCNI7dXc2 d2K3cE/BkcH4VtgAqQnoHDCSWLbGXM1Hu/O752tngKKxmApn/HTH2+A6eQGPlq8s3Xpw W2S9yQXy3kQkwvyn02h/CXru1yE7Hr5VGY5a6aT8dKoJ1cUQ5adqZgqGEE7K3bq8rXAx ldHZz5VHTh7OgjEBzqzxXgvRMymJjnaGMpEWRt5jLXgfBJZqZmuSDAlDraKh261zVTe1 TLNEHjg0ZsS6PZ0h2LHTJR/31I/wJuYvmoAzChFNX21a2psHQtGE08y5BEvk3IN2bf4h uX9Q== 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=TdWdmS9KmpqRDKTTx4ZFKlZV0sk8Q5cLOhIOkZ1gD+w=; b=OPE+mhW4xI3TeURmKdVdFNk2obwWwRIqjaAAIwujdBdw30PV4Qsz6CbDIw3WiF2dOM 0VBZzB3Qo5oD/PW3p81LyWmtJj8bYMbkEzkpRldAOIUBcdx5/1FEhLhbrqAoA9zykgpb U0uAFNeeRnBE8M/VI7hkqBZIsywTJQrOulplgxjxV17SlAPrnzMUbVhtT+QMIWEJL53m H7I5gQFOQxRneOP2hMVRkU5Knv1BhQYuzU8W9HKqEwGQKX/sDwQ8YkjGvD62lm72fSqU PgJsiyIXhw28h9HsSrStFQDJZ1JxOd45doeyJ1hBfLGnKXQOUnRR6GmBw7XsAnBfaMwy CKBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cAZtzVYP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id d11si1807278edr.595.2020.08.20.10.42.30; Thu, 20 Aug 2020 10:42:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cAZtzVYP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1728261AbgHTRlu (ORCPT + 99 others); Thu, 20 Aug 2020 13:41:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727084AbgHTRlU (ORCPT ); Thu, 20 Aug 2020 13:41:20 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A6D7C061387 for ; Thu, 20 Aug 2020 10:41:20 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id o18so3490640eje.7 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=RuLXf2kFkoio1iXrCYgfRSon8Nbk4Shaj9W/PTL5GiJ0mfCdn6O/gkFThFc6HcfAHI mGJGNeuxEpn4jF9IKlcB6dQkr+bR6mVKm3UfNHTKXF4eLEJGLjIFjrSaS6cktTHEz9Hu lcJ9Tggu34sP+3Leprt1ysgGg6BVghU3nSuGcOVbzNU0diEpXnymuKIdXF5MNr1Nf2nv NNvJDhkov/O4VMt8jdnDeOnuD8Pgwua78/V+gP+90Rqd4AePxobjkwiKmkp2e/3hwdmy n4NbWNjsFarE92TqpgdDe+Vc1ce2ah+FGxQ8+HpYxHnSr/M/OMSinS7aw5oZY19fHVWt ysog== X-Gm-Message-State: AOAM532ofhf5/A3F8M4p2Q+jA6/fPg/Ss7zAxFoQBkGbRioxewUWdlLO yj0Ca4sjYBA+PxP4MSRRaaZ0xRZJt4torA== X-Received: by 2002:a17:906:b248:: with SMTP id ce8mr4223939ejb.85.1597945278458; Thu, 20 Aug 2020 10:41:18 -0700 (PDT) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com. [209.85.128.43]) by smtp.gmail.com with ESMTPSA id n25sm1670566edy.79.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-f43.google.com with SMTP id o21so2420328wmc.0 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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