Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp782488ybh; Mon, 13 Jul 2020 00:35:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyThKzhewsWBPu6Z1uddkCl7CaqwApLrugTGDGjLedr7tJclGuOHlfOsWxa6dcjOsXWG67h X-Received: by 2002:a17:906:c007:: with SMTP id e7mr5889259ejz.481.1594625724190; Mon, 13 Jul 2020 00:35:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594625724; cv=none; d=google.com; s=arc-20160816; b=sfneX/WW22OCSBbnD1yxS3xEQ/dMIneAY+5xG1//Uce1fifyF5qWvA4BOXvPle6uJv ZR9C56hRYkdMyxIXNfVYhDRJds2BVsecmRxR7XGRkYcVE5aS2ceDZaRqBtsLtGaTRLw+ AOMTcTJabe/67l6raVzkZDq9dypwtgWww+q++slMIdzBuC7GJjXdxCTiVgZE6XFDsZjo DlqunLWMMo5F7hTMp6QtR0qB5lkpR8pav74sbiNNvUWXNWbEHP/jOietwvQf2Jqi7Imi Et4wMUB/cwDWEJqwcHzJUYNJ7jPAKDwiSLMImh1BzrXL8vuz11RZWlU7RfR23gxP6g6u oE3w== 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=Mv5WdsbJHcmRfr1CWAqVLgCzyD2WDHyCcH3cW9CT870=; b=IPk2iis5x1wfzV29ISpuFxkjmvyvZwtfruKD8+lsc6A7CBQB+flqOZ+2p2lLGrq/gN 1qHG9dL/Xj5cDYGNwRWk4vqcPm/RmqdFTnvrkyvkJv8aWPDSKWqIlYF5XVdL78/1bxzv 8BRAPy5KAaF1ywJK0ul6zv9bR063cqcsypY/TL5g8GP/P0eJUK+YwDTsVTSjg40DSkqV oQYKeSpvo+MK9otZkItoB0qOyVQII7aQLCD9UeQrMxSros9aVH2d8cgnKDVGShKxLHG1 rYwL3j3PcmlS/8/p7LhJdUjZP3uKUFNWp23w/8cfxgrc9/g1kLI28A28YB2pTWgix3zP nhUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mn5gncYv; 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 dm20si11122308ejc.159.2020.07.13.00.35.01; Mon, 13 Jul 2020 00:35:24 -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=mn5gncYv; 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 S1728919AbgGMHe3 (ORCPT + 99 others); Mon, 13 Jul 2020 03:34:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbgGMHe3 (ORCPT ); Mon, 13 Jul 2020 03:34:29 -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 C1511C061794 for ; Mon, 13 Jul 2020 00:34:28 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id dr13so15257890ejc.3 for ; Mon, 13 Jul 2020 00:34:28 -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=Mv5WdsbJHcmRfr1CWAqVLgCzyD2WDHyCcH3cW9CT870=; b=mn5gncYvlT0Ikasjdu4y+nGbhp8qf0g/S/fJiCGf6woiq1WyBZiFigDT3Qp1D2tYTI pmW6YdaDNjwHR3PrL+IiKlbCPjioM14hSjLWkaH1Hv6Cac70Zw6Oxga2x9v5s8SMy/5x GmsD0Ru1j+a4thlGopDDg3e8+Sd1/EIjJPBh0= 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=Mv5WdsbJHcmRfr1CWAqVLgCzyD2WDHyCcH3cW9CT870=; b=VQ1n/+RmV/IdYdjgBXSBBiV0w3fc0ne2DmuRWeknKRwCqMnYKs6lT0zmcpAHRZaXrI ABAywKenS/KKdnGiXSDdUk9KYigKJy95RLiWqak2yOpGP0w3MURyhyTwmq2OV5zgMNPG XRNEox3FB1GisPZnGRIWlAZZCLdh4oanIFio4epZ+xKUIEv2JTPSiPCQHZ0zT6Wh0wgX mO6bvnG/XK7Hv4FXS5KIg1SIkfv/hB0RA9FroKNz9pmn9OWD3SF3GY6ldN4RzItxxVZ7 mQIiIMMYvYdJfWxG2bnspin5M5AJRjFNqwLF4MaF3W/f/UFOo78SSUFzirv+M3eAl6qw 1DRw== X-Gm-Message-State: AOAM532kfCGh8YaRl1qA8ww3Urq5usj8CjrpYafKK/ZUqF3FCjy/CQbL /rJdanKtAOyAsTKx/Ny4qmT60xs6WQTZZ+GWYZ9ajQ== X-Received: by 2002:a17:906:1db1:: with SMTP id u17mr64544271ejh.72.1594625666473; Mon, 13 Jul 2020 00:34:26 -0700 (PDT) MIME-Version: 1.0 References: <20200711064846.16007-1-yong.wu@mediatek.com> <20200711064846.16007-13-yong.wu@mediatek.com> In-Reply-To: <20200711064846.16007-13-yong.wu@mediatek.com> From: Pi-Hsun Shih Date: Mon, 13 Jul 2020 15:33:50 +0800 Message-ID: Subject: Re: [PATCH 12/21] iommu/mediatek: Add iova reserved function To: Yong Wu Cc: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy , Will Deacon , Evan Green , Tomasz Figa , "moderated list:ARM/Mediatek SoC support" , srv_heupstream@mediatek.com, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list , "moderated list:ARM/Mediatek SoC support" , iommu@lists.linux-foundation.org, =?UTF-8?B?WW91bGluIFBlaSAo6KO05Y+L5p6XKQ==?= , Nicolas Boichat , anan.sun@mediatek.com, cui.zhang@mediatek.com, chao.hao@mediatek.com, ming-fan.chen@mediatek.com, Hao Chao 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 Sat, Jul 11, 2020 at 2:51 PM Yong Wu wrote: > > For multiple iommu_domains, we need to reserve some iova regions, so we > will add mtk_iommu_iova_region structure. It includes the base address > and size of the range. > This is a preparing patch for supporting multi-domain. > > Signed-off-by: Anan sun > Signed-off-by: Hao Chao > Signed-off-by: Yong Wu > --- > drivers/iommu/mtk_iommu.c | 37 +++++++++++++++++++++++++++++++++++++ > drivers/iommu/mtk_iommu.h | 5 +++++ > 2 files changed, 42 insertions(+) > > diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c > index 03a6d66f4bef..fdfdb75706e0 100644 > --- a/drivers/iommu/mtk_iommu.c > +++ b/drivers/iommu/mtk_iommu.c > @@ -151,6 +151,11 @@ static LIST_HEAD(m4ulist); /* List all the M4U HWs */ > ... > + > +static void mtk_iommu_put_resv_regions(struct device *dev, > + struct list_head *head) > +{ > + struct iommu_resv_region *entry, *next; > + > + list_for_each_entry_safe(entry, next, head, list) > + kfree(entry); > +} > + This is the same as generic_iommu_put_resv_regions, use that as the .put_resv_regions callback instead? > ... > -- > 2.18.0