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.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 422ACC2D0A8 for ; Wed, 23 Sep 2020 08:25:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BA42D2395B for ; Wed, 23 Sep 2020 08:25:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MNb6WQXP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA42D2395B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DE3926B005D; Wed, 23 Sep 2020 04:25:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D95496B0062; Wed, 23 Sep 2020 04:25:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA9326B0068; Wed, 23 Sep 2020 04:25:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id B34426B005D for ; Wed, 23 Sep 2020 04:25:52 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 71C05181AEF15 for ; Wed, 23 Sep 2020 08:25:52 +0000 (UTC) X-FDA: 77293642944.01.music80_081681127154 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 4EC111004A099 for ; Wed, 23 Sep 2020 08:25:52 +0000 (UTC) X-HE-Tag: music80_081681127154 X-Filterd-Recvd-Size: 4865 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Sep 2020 08:25:51 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id w5so20006561wrp.8 for ; Wed, 23 Sep 2020 01:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fzROUGMKNRgnnDL4NwgHcw/pm1uqI4QZGJMEsixQdd8=; b=MNb6WQXPUqp24elHaHfaMk9QtEc3fyoOSavaOMJTbAuFVx4EHB79HJMVm4ABBZ1utd SJCTPziVz1iwOghnysLN2vE89R0zmeUHHyBXVUFWpffc3tfGrjPavnLTaAC9FY38EUcN 8olvxROZ8MdkA17jt7Go2ajTn8or4BhGQ7hhJEo/D14nuBiN/5HwjUNFmq7pAB01dprA RYvFwCYA9KdEQYqxgigA9A+y9Ix//47Ob3xnag8A4MaxUdc3u6SJpzJHRYR1jpoQT0rQ QcT6AgfIhBsZumsjMWr82I8RkIzWbnDim0V0tn/FfobKtHK7BZ0MOlwmcApWm6/KWWRy PpEA== 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=fzROUGMKNRgnnDL4NwgHcw/pm1uqI4QZGJMEsixQdd8=; b=qb9QBHqtz96h9zPYVWK/e1bx3IWY9mI4uDaG3UAZUFBO+PsMtB2qD9GW0gBxa+Iuyo ABqzeoEzyM6IBB4TEQXFZjUxfTTDQh0uzYQ1idllhjk8xbZpAhj73b4cObfTHDMprCZe kzdV1uCnzkyDWpUV4mmxItUG5Wpkr5strYA3Eq3INJPMbEShg0Kw680ccof+AkuyU1VD QROC2dVr+oLJvl1NLXMMNkmt0k0NLnrmwKdMYo6I2f0ftqRZ/3/+tUPj1jko+1aXIWk+ A3rVBHIVk+G3S3Ey3AFjBp3bXZXuqS2RM4DEeA/WFFTY3b6jkSv9BmFW+tNc+ZFQueTA YtjA== X-Gm-Message-State: AOAM533y0H9PYfs/A6t41Y8BgR+bseFJjFqy9dQPcHiHk7JdEF24oEDY SRXXljBAFPpwW6XH5yhjP0SPFOjGQzUANYGqzJE= X-Google-Smtp-Source: ABdhPJzY/stJggWOWyJdw5UFRsFPhz2J70u/U6Ytdc7H4uw7tqDrNHhrWvo1p4HWhuGgvZmSpp6K9Ko6daWcDcSJgdQ= X-Received: by 2002:adf:dd44:: with SMTP id u4mr9368679wrm.22.1600849550309; Wed, 23 Sep 2020 01:25:50 -0700 (PDT) MIME-Version: 1.0 References: <59cda41f-170c-a1ad-a345-bc38b9ed4d73@arm.com> <11584d09-5995-6133-3bd3-8f7a0afd0e01@samsung.com> <20200923065808.GA16366@lst.de> In-Reply-To: <20200923065808.GA16366@lst.de> From: Ajay Kumar Date: Wed, 23 Sep 2020 13:55:39 +0530 Message-ID: Subject: Re: IOVA allocation dependency between firmware buffer and remaining buffers To: Christoph Hellwig Cc: Marek Szyprowski , jean-philippe@linaro.org, will@kernel.org, linux-mm@kvack.org, Linux IOMMU , Thierry Reding , Ajay kumar , Shaik Ameer Basha , Robin Murphy , ajaykumar.rs@samsung.com, sathya.panda@samsung.com Content-Type: text/plain; charset="UTF-8" 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: Hello all, We pretty much tried to solve the same issue here with a new API in DMA-IOMMU: https://lore.kernel.org/linux-iommu/20200811054912.GA301@infradead.org/T/ Christoph - the user part would be MFC devices on exynos platforms Thanks, Ajay On Wed, Sep 23, 2020 at 12:28 PM Christoph Hellwig wrote: > > On Wed, Sep 23, 2020 at 08:48:26AM +0200, Marek Szyprowski wrote: > > Hi Shaik, > > > > I've run into similar problem while adapting S5P-MFC and Exynos4-IS > > drivers for generic IOMMU-DMA framework. Here is my first solution: > > https://lore.kernel.org/linux-samsung-soc/20200918144833.14618-1-m.szyprowski@samsung.com/T/ > > > > > > It allows to remap given buffer at the specific IOVA address, although > > it doesn't guarantee that those specific addresses won't be later used > > by the IOVA allocator. Probably it would make sense to add an API for > > generic IOMMU-DMA framework to mark the given IOVA range as > > reserved/unused to protect them. > > If you want to use IOVA addresses in a device otherwise managed by > dma-iommu we need to expose an API through the dma API. Can you please > include the iommu list in the discussion of your series? > > I don't think using the raw IOMMU API is a very idea in these drivers, > we probably want a way to change the allocator algorithm or hint the > next IOVA and keep using the normal DMA API. Maybe Robin has a better > idea. > _______________________________________________ > iommu mailing list > iommu@lists.linux-foundation.org > https://lists.linuxfoundation.org/mailman/listinfo/iommu