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 84E0EC4727D for ; Wed, 23 Sep 2020 07:45:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1FC2321924 for ; Wed, 23 Sep 2020 07:45:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HSsqMwkL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FC2321924 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 6FAC26B006E; Wed, 23 Sep 2020 03:45:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 684486B0070; Wed, 23 Sep 2020 03:45:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54BED6B0071; Wed, 23 Sep 2020 03:45:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0199.hostedemail.com [216.40.44.199]) by kanga.kvack.org (Postfix) with ESMTP id 37A7C6B006E for ; Wed, 23 Sep 2020 03:45:36 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id EB4B3180AD801 for ; Wed, 23 Sep 2020 07:45:35 +0000 (UTC) X-FDA: 77293541430.18.fan33_6208b8d27154 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id 07736100FE207 for ; Wed, 23 Sep 2020 07:45:35 +0000 (UTC) X-HE-Tag: fan33_6208b8d27154 X-Filterd-Recvd-Size: 4803 Received: from mail-yb1-f196.google.com (mail-yb1-f196.google.com [209.85.219.196]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Wed, 23 Sep 2020 07:45:34 +0000 (UTC) Received: by mail-yb1-f196.google.com with SMTP id 67so14777399ybt.6 for ; Wed, 23 Sep 2020 00:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/GHpmKCCGcexOvtlcyC9uP2q4Nd41VuwJ5FfEQainNU=; b=HSsqMwkLY+zUqzjY7UyjOZKpIvQ7wlqcBiaPf6F2IIb2yOEO87qCbmqf4tXTT04Zb1 2tVgBD5mbMmp9WJWzAZ0ZFFOqDckzewIHs9K5CuT8fblr2U4C9o+33xhpCtPplzwCqdd +N7hzAecUTUdHBPwoXABtx948UViuFkLgzwybNmquwMZcmk5UGQA566K1s2kcgc3VoZW C/TGc0bC/+w1Amsy2S93XHYOa/l7yLFFBfOhv8XbrmmNSpLFIcdkkdzT3XXbpYR5F6hQ vPySNn6CYb7OyBEiSqTMMgeEbvSAwMCWibKqNpZrGTTbtWz6UKAqP2lz2hoDgPOgeAKx CMvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/GHpmKCCGcexOvtlcyC9uP2q4Nd41VuwJ5FfEQainNU=; b=glXgfBYBag8NxPhpwmw2uflhvtx74B9BxsVjEpF6f+NtPKvcbELLjMUIMXY5ZChwk3 MqNkbVHimNf29XhEXNQXwmFP74uQtutjW0PkWfnAV04c3euQlrPrd8EsGkpMpwGmPfYn Mk2WcoB8llOfMMdZHIpKnxML386inYY58XUeb0jha9mlm7pRpvEno36kxw8EVp9fpyIV Se5HvPNYuDr2lQ6BfFitH7DOFFbghm0ams6NIVK4QDsLSeO4wbsREOnqED7paGkCn7Yy 7vAhz9N2ui8vK8rm43F+hK991kp0RSrnDBI7g2kvI1t3fFQB+i8XnPvIV4p43093jWSi LPCg== X-Gm-Message-State: AOAM533Z8v7UJdVUt64oPO3BXYVemAuE0y8TrjfQk2L3yv6OhgGNt4O+ 4+sWTuhbLoCtGht2eWcyFJGqYDRnt1D6+/R1n2U= X-Google-Smtp-Source: ABdhPJwTbE5iL/lGdCAxASuHqeib/oo/4BHL2s4NmZET3Mh4YBt2LS13hfc0AT8zSCatXXrEJzBHAnvsusQ6jAIgnfI= X-Received: by 2002:a25:320b:: with SMTP id y11mr10422663yby.394.1600847133912; Wed, 23 Sep 2020 00:45:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a26:9820:0:0:0:0:0 with HTTP; Wed, 23 Sep 2020 00:45:33 -0700 (PDT) In-Reply-To: <20200923065808.GA16366@lst.de> References: <59cda41f-170c-a1ad-a345-bc38b9ed4d73@arm.com> <11584d09-5995-6133-3bd3-8f7a0afd0e01@samsung.com> <20200923065808.GA16366@lst.de> From: Ajay kumar Date: Wed, 23 Sep 2020 13:15:33 +0530 Message-ID: Subject: Re: IOVA allocation dependency between firmware buffer and remaining buffers To: Christoph Hellwig Cc: Marek Szyprowski , Shaik Ameer Basha , Robin Murphy , Linux IOMMU , linux-mm@kvack.org, Joerg Roedel , Rob Clark , Thierry Reding , jean-philippe@linaro.org, will@kernel.org, baolu.lu@linux.intel.com, Shaik Ameer Basha 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/ Christopher- the user part would be MFC devices on exynos platforms Thanks, Ajay On 9/23/20, 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. >