Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1883843pxk; Sat, 5 Sep 2020 01:15:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYjT6OGZRfK9yeaMPYQB8YBV+x2SNtB4ElInwVyj+mr0vxzJRy/N9W7dnUF9wSb/HVzd64 X-Received: by 2002:a50:aaca:: with SMTP id r10mr13045804edc.307.1599293743444; Sat, 05 Sep 2020 01:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599293743; cv=none; d=google.com; s=arc-20160816; b=N027dYyZGsiY9YgEDUv40nmT9zWwzTaWX+XfVKVJzekMQ1DxBFX6AUGINTGPDeobc5 ZxZ45e9EtmOsKurYx2rCuSLGo+sHZGpbuN1niaYqIqP3p/wo6cYnRHA7h3tvFw0IMOWk 7wBYaCj2i8PJexontvwlDywtPsEF+3vuUYXiAzaL9fNQ7pS2P7zMx1Goy4dvrcxwm8Tn oVSqMoZbPkeRMTcHDgPFHcrRSQU077ADCNz4JFovZe0SQeOL8Cf5Wwc2lS3gAS5u/b9a pyj5qwfOCid6wf9UPrL53m69H/Ayq9qB7/rISPASsNg7OGOoa38V+NaTyow87hsrCHiA y1UQ== 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=yfi9vzm0fW6xqegWSEoNYQMITtGrjQdMcYatXg3F9hk=; b=DpfZEzMKB69uVLdaj85MXlSOfWBx6Mtp8Z8lgFh0JwFt45TWdFvFqGM9YhSAes3Jri TmmIXVjvbaF1ecqp59sWcWChu9U8ZR2gagMkzcrGErLcVT5jVFHXhec++DCeBeKl4Xv5 ppqK8PpSQsGcobcxpDMhZlAZuFh5ycz5ZNAOTHLTeTbGyH0t2Jc9F7QXaFDucfFxUZK+ TCvixXFJJ4cmPTVfLrMrqIIzex1L4vBe7JXmDCxrGHYqJAGoBHtmhaLnIgDIhsZDTo9M 2c0zY/W9jcQJlrceQOET7LBouE+7azpIbJkuW6nvn/1sUhVFtXpJwZmsvCivxHUqoiOP CuEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=McRNkxZh; 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 n25si5562767edq.555.2020.09.05.01.15.20; Sat, 05 Sep 2020 01:15:43 -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=McRNkxZh; 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 S1728563AbgIEIOI (ORCPT + 99 others); Sat, 5 Sep 2020 04:14:08 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:13377 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726398AbgIEIOH (ORCPT ); Sat, 5 Sep 2020 04:14:07 -0400 X-UUID: c1e2d3bec24a4cc3b21e633c4557400c-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=yfi9vzm0fW6xqegWSEoNYQMITtGrjQdMcYatXg3F9hk=; b=McRNkxZhk5Dw3xI8zdQRHkBnzwWEXIsDySgl4LCjcWQCe+7waXGxVHzmly4CjoIhwtNUaaftxGMtXmz/Ovtfnd+x6mSyVcNwoBuZZLQoEizwNvEaR6mcOgw6R/HD55DyfIOKfPkNN269RPksbklKbrKJH1LjG/xDNiHCBOS9ow0=; X-UUID: c1e2d3bec24a4cc3b21e633c4557400c-20200905 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] 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 319648558; Sat, 05 Sep 2020 16:14:02 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 5 Sep 2020 16:13:59 +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:59 +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 17/23] iommu/mediatek: Support master use iova over 32bit Date: Sat, 5 Sep 2020 16:09:14 +0800 Message-ID: <20200905080920.13396-18-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-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 QWZ0ZXIgZXh0ZW5kaW5nIHY3cywgb3VyIHBhZ2V0YWJsZSBhbHJlYWR5IHN1cHBvcnQgaW92YSBy ZWFjaA0KMTZHQigzNGJpdCkuIHRoZSBtYXN0ZXIgZ290IHRoZSBpb3Zh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