Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1884527pxk; Sat, 5 Sep 2020 01:17:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdxQ9VF8IXaL9O5ZKCxhofAhbiEFd81kRrput8/ad2/wt8hMojyWs1zU09B1J6d+fiHact X-Received: by 2002:a17:906:52c2:: with SMTP id w2mr11897836ejn.389.1599293840779; Sat, 05 Sep 2020 01:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599293840; cv=none; d=google.com; s=arc-20160816; b=OYK1enh8NAe/t86remWdoml4bUtRKKt/MhJ9t+0z4MXn8ZJ6zaMf/uM2gR2dzeo38d wO2QgWSLjKeomRBwA2JM3OzIiJoHO8B6qIHKYc0z6fXeElXXIpT9VHgU4A1ZOIpVXQdp nGqBPkBvLG53cQycwXNtqtHq2e4YSwwh3kX/RkjteX7gwWW8y33zPCM1RxjjOY/u314Z UfW4mfWcGyoE81xpwB8qlPb+odQMwgwrYOvNot6BKBfxuGVUFW+hwSZhpVFdjbdW/O6D igkyq9swEiQJ+lcX8qgDB/bAOUTHLG2FzaGv0FnOM0G0uDPM0nnrLlP8sQixuzeg+Uk/ pRaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=l8Aq+TVie3k2Aq8o0+LpX7YhzFPWXC7lxDHgVz1jlN4=; b=sw7//7E5ReOGTEEby4WkWkavAb3pxgbEPaBB07DwH4UOeSeoODved32vVriRQktm5P Rmv6xfl3lha+1F02+VATJQlSOyrxIihHkQNeK9ZpAcWWWTDHYuhzUrMXWfksPHN9nedq nNf9D88drtMgt+oUoOD6HKi/KmVUS2Jz3YMXWhYIhh0qTEyyliuVQrFbi1dWTp8i8D1W vIJ8E3tv4ga8nv7Cdtq5MRuAI0+3ISzK5hb/+qWEfbhvKdgI6lxhSkI2nPxkVQrd4nvF 0OAA4ECL0yoi05IA5JYVn2aHF6Uij01fHw3A/4D0/FnZ9tdjs9lI4PqL1mL0OpjaqLJS 8rbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=bkGz1rCh; 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 t5si6228651edi.523.2020.09.05.01.16.58; Sat, 05 Sep 2020 01:17:20 -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=bkGz1rCh; 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 S1728536AbgIEINl (ORCPT + 99 others); Sat, 5 Sep 2020 04:13:41 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:48717 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726648AbgIEINk (ORCPT ); Sat, 5 Sep 2020 04:13:40 -0400 X-UUID: 381da0d9dfc14e219da206127e3f36d9-20200905 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=l8Aq+TVie3k2Aq8o0+LpX7YhzFPWXC7lxDHgVz1jlN4=; b=bkGz1rChh67LqdQ67gfHpVcgAJ7yNbvPtp57KCbXZF0M+rEzthCI2pnA0M1Pv0no3n3ws3EYwimYcsdacuULKf1YrJpZDx815yDfXkD/FV2Q6gZWuJC1sVzw6ymzdazX6x/ii0egxQ7fmGXHqjAX5DjTJdHGunSgunJ5fo3pr0Y=; X-UUID: 381da0d9dfc14e219da206127e3f36d9-20200905 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] 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 202941406; Sat, 05 Sep 2020 16:13:35 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Sep 2020 16:13:31 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 5 Sep 2020 16:13:31 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Rob Herring , Robin Murphy CC: Will Deacon , Evan Green , Tomasz Figa , , , , , , , , , Nicolas Boichat , , , Subject: [PATCH v2 15/23] iommu/mediatek: Add iova reserved function Date: Sat, 5 Sep 2020 16:09:12 +0800 Message-ID: <20200905080920.13396-16-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200905080920.13396-1-yong.wu@mediatek.com> References: <20200905080920.13396-1-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 72F648CDE297A7F1184FD55C1EE483861396E92899FD3A72EB0D9BDF248D4C5D2000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rm9yIG11bHRpcGxlIGlvbW11X2RvbWFpbnMsIHdlIG5lZWQgdG8gcmVzZXJ2ZSBzb21lIGlvd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