Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1115240ybt; Fri, 10 Jul 2020 23:54:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxuBQzIKutrjVT5iL8+va7voNHH3YCPav+eiz7IhLnljoWicnaDbF0kE9B6CELHf41rYKKK X-Received: by 2002:a17:906:1357:: with SMTP id x23mr68043095ejb.148.1594450469262; Fri, 10 Jul 2020 23:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594450469; cv=none; d=google.com; s=arc-20160816; b=JgDlaHlLTPDskkNjmlXJ5wQS5qBVD65QNqKUAhX9umYAR++TyCAE+hNaDEZeekNk6M CZbjLxZy1PqbdQSNiRMIjwTz6BzGVCdyJ4N3IvfF3G0Wvof7YH5E/TIYXJVB1J9LblEU Ef36lR7Ijuq1s1B2NRzQliIkRUEi0fqx2iLozuTwrCmEoLYqnWXvkdzdkbRNy8j1ACTA JqkDAuGLwBPDFiTRsjKjkwI9UhPNfF/9px8+W6z0banFRFU1RocA/Fth7esXYZ6zPDYk jmVu0avjUaa3X5me/tdoQ/+/IR0z5gbWejI4vYK58LIoEBMydzyTeSFoQV1A6/kOjKjv P/5w== 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=W54Ty6QRMwKDgv6G7is1nGP3+DDMbubqS7XzqnzrYfY=; b=WJbZuTbduTu6msws/QE7LUX8+kilfuOmOp573vKET69spTGlblCRkkjQNUBOfp7C4w ymrTk3rJyy4CallnlXGC/oTuZikq/LeCxJs2VnRknkmLywSpL5XbiWLP3ChdFGeAo2cJ 20XI32jc9rdATh9cAwwrQ4noWNp8JjMlewA/ja5jK2eT+KSZFKtN0k+nX3Cim9UmMoes OunZGYJxxn+gB3W279B0N5ekkB8F7BDtx5p/MJh9nb/NjXg90EGvXsd/7AgXaNr7i8Uc y+xNCKe6uxy2gQExw+hbsne4PxESkCo40iojl+JReh8G2eMVJ+XO2ffMdwT/IkgpxIfb B9hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=JJT0GDkO; 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 du6si6541273ejc.189.2020.07.10.23.54.06; Fri, 10 Jul 2020 23:54:29 -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=JJT0GDkO; 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 S1728337AbgGKGwI (ORCPT + 99 others); Sat, 11 Jul 2020 02:52:08 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:32437 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727984AbgGKGwH (ORCPT ); Sat, 11 Jul 2020 02:52:07 -0400 X-UUID: 3beb8af861d2426e931ceaa8c58584eb-20200711 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=W54Ty6QRMwKDgv6G7is1nGP3+DDMbubqS7XzqnzrYfY=; b=JJT0GDkOQ47f4LZ7Nrj33bezqlwPqqEyR+2o7ygjoVTXr/84MyrBPjoeUmRASLJhXm8rMHo9Y/4F5BVNeP/tdsRClen34sL/tASKedhwLrF3YaKS5Xhg5JBhbz6zG90fZO5lkPlznyen+l42FUFhWAIfjBc+24z8gEYQ1VZdzM8=; X-UUID: 3beb8af861d2426e931ceaa8c58584eb-20200711 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1598117566; Sat, 11 Jul 2020 14:52:04 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sat, 11 Jul 2020 14:52:00 +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; Sat, 11 Jul 2020 14:51: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 15/21] iommu/mediatek: Support master use iova over 32bit Date: Sat, 11 Jul 2020 14:48:40 +0800 Message-ID: <20200711064846.16007-16-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200711064846.16007-1-yong.wu@mediatek.com> References: <20200711064846.16007-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 ZWFjaA0KMTZHQigzNGJpdCkuIHRoZSBtYXN0ZXIgZ290IHRoZSBpb3ZhIHZpYSBkbWFfYWxsb2Nf YXR0cnMgbWF5IHJlYWNoDQozNGJpd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