Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4353373pxk; Wed, 30 Sep 2020 00:12:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcGIyOPB5aQE3LG0upGFMyf48X1unl1+u6OHWJoFn2MTSWQrKeWkmdUpwH850Q/1xmX4QV X-Received: by 2002:a17:906:d9da:: with SMTP id qk26mr1354050ejb.435.1601449945451; Wed, 30 Sep 2020 00:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601449945; cv=none; d=google.com; s=arc-20160816; b=oW6LHJ/82uKoKdzb2ZsFelrJHdGPXUHr5wGbO/U1ujw2j7o+XrE+4/hSTyue8l7n58 grpPrN99FU+DLHpVVwh+iv7PE6/LadeOBoQ5yP1hHQDExWpKMX7XHUbCukzy2HL5eaAg 0d33XWf0jZ+mfzIyp/8HYn+qxhUP1AA/huiZ2Wb7ut7bLJkNC8Zk0cVJAzNv7eCwgl06 gF+wmUY2ZJTrFzm7hNpgk6J0jjJL5SaGYZ4DwRh5BUrqaUDbIXBaY4Ne9NaONxVHhPDY D9xSyT0Zur72cVoTptu19kVNYnwnFxbKb4j6E9AnYs9wIoUcb+gANvMkQx66bShoFYiN pH1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Cd85HbGdomIatcszaQsBe028Lmk8A4DWmIet/rjvJNA=; b=qbMAiPalNbaW8k9N7Gwfxb0M51J5Skfh7bDtcfw85gak0pYbppTnpzX1LYP8salOIX B0fk/eb704dbhumUAK8puLvbPSWQmaUlaFAlEHb9/F+1CIUoRiRlFxpSemJFnm/YlSRE l//XQ/tNwYfNpRc+ssvHURqS7L2+tS3qEpfgAYYWHWLHkScZtao4yQQ3h3uuc8vF804J H5EOVB/eTvyZ249SKuESaWrFEt7F+iHytHOvAs16snnu+U2ZEppASYrDtczQmI/3/jbD VFEd3avOx6PfCVugTmmgloWAwcYO3gVCu483/FsAp3j+Q3CACTrOfYG6sFCyclZdSizl oYDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=GWLZfJvE; 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x25si407121edi.558.2020.09.30.00.12.02; Wed, 30 Sep 2020 00:12:25 -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=@mediatek.com header.s=dk header.b=GWLZfJvE; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728771AbgI3HKU (ORCPT + 99 others); Wed, 30 Sep 2020 03:10:20 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:50984 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725440AbgI3HKU (ORCPT ); Wed, 30 Sep 2020 03:10:20 -0400 X-UUID: ff5ce9857e17491db4a124e29d10d057-20200930 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=Cd85HbGdomIatcszaQsBe028Lmk8A4DWmIet/rjvJNA=; b=GWLZfJvEIhax1zcJzT7uX2coW9dCL9m+JqhZqO7eecHoQaHDeyaepMzm4sAU5B0P4MT8RpqaTGTtTPBnEXnt9Kg/3lyYpAF3hE6yeoF8EBrdgbiG51e7f9oxqyAID+Mcc3swZFUzbqAczak7hniteP7OesEyJncV8oxX9z6ICqA=; X-UUID: ff5ce9857e17491db4a124e29d10d057-20200930 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1118781204; Wed, 30 Sep 2020 15:10:15 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 30 Sep 2020 15:10:13 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 30 Sep 2020 15:10:13 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy , Krzysztof Kozlowski , Will Deacon CC: Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , , Greg Kroah-Hartman , Subject: [PATCH v3 16/24] iommu/mediatek: Add iova reserved function Date: Wed, 30 Sep 2020 15:06:39 +0800 Message-ID: <20200930070647.10188-17-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200930070647.10188-1-yong.wu@mediatek.com> References: <20200930070647.10188-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 55AB3C9BE1447268D24CD38B123F0E26462D1AE382557C45894227B167097E4F2000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rm9yIG11bHRpcGxlIGlvbW11X2RvbWFpbnMsIHdlIG5lZWQgdG8gcmVzZXJ2ZSBzb21lIGlvdmEg cmVnaW9ucy4gVGFrZSBhDQp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