Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4354086pxk; Wed, 30 Sep 2020 00:13:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCodIQ7uDkt5mkEnZ+hL7hWFj6rhbnGt/EaikN84QIQ77AHLXs0f1tU54gRsh18Wu47Fcs X-Received: by 2002:a17:906:e18:: with SMTP id l24mr1421179eji.334.1601450037026; Wed, 30 Sep 2020 00:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601450037; cv=none; d=google.com; s=arc-20160816; b=wbhuKZPSLWSRMqxjnOk6Yr/VF6M6j1gSsHyVubasYjLNVjAmsjqM8rlMCCsvtg+Ve2 nOS6UmqjJWgbbaZamCD4b0E3ZNe29yykQlTNCz7pwDPP7KZEZfAdx7v4rTW7+vOLy1ic +WiO3BlGWMqarKKxi9gEnbPQMRQLwLa8AwdBOV8uG+cO2+D1+3/M0rzethp35dnOZcJR jS7AXvzjHgs6hAXWGuOeJ74H5vNiWixZfmLzRSMp45/frkYpFHHvqoxJ0xBfgKKeL0Dx KVZ8ihwei6FvAxbzsZkvQ2lIJKjPyAnrdWbR+hak1uBi9u5ZQJkOo5b3lL7QUU67KIS/ nGXw== 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=32ll1ba3Marssu44z6TcC3QfRjSBtE6bugNhwwgxSZ4=; b=V/xxrB5eLTKUL/Y+J2U4E1/vYtA/DcxClPOl9h4Zt010IkCOKeQrM0Kk8vCH1WEjlT oDgZUeO6tXzFf+mPPCgnhxXyCCfhK12kYPtJRBccQv0BrZP7+394t4nCV90nkGvPNqWp +o1irZivbviXVsnY4Fz/V16ti/z9TrkZ1MJS6nA1eDGVkLpdUEKF+p42bd1S9q3o4JAG 1k+RUy1RDCn+h8AcyZ96C4esqNdA/QYeqSRC2yQEUVXODWyR2CnEpM9olNvMXu8HJH2j qwKFkbwYRwcd9qITsWguxlcnRiBhMm2/xS1imoilgpQcuQAGgRg4EV6bD5rrUkOiAsS6 e1bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=U1YoZS0O; 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 e8si581595ejj.575.2020.09.30.00.13.34; Wed, 30 Sep 2020 00:13:57 -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=U1YoZS0O; 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 S1728380AbgI3HKo (ORCPT + 99 others); Wed, 30 Sep 2020 03:10:44 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:51381 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728289AbgI3HKn (ORCPT ); Wed, 30 Sep 2020 03:10:43 -0400 X-UUID: 2e0710118a114872b8f6f2bfe7ff0f64-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=32ll1ba3Marssu44z6TcC3QfRjSBtE6bugNhwwgxSZ4=; b=U1YoZS0OUoVSTdGCLCm+zEeE73+s+T+YqI9ox6zxaEykO1IMieENfIOimRn0OZyA/SPGkvwfg/HVjPEL/VOwi79CWqni+JRbFBkIF5oME3FaVOmt3F0wBOiQmTC3Mu66btRbQI9YOAwtdSCzMQNZpY8xXPFBIPw8eNszR49o8bE=; X-UUID: 2e0710118a114872b8f6f2bfe7ff0f64-20200930 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 1226348511; Wed, 30 Sep 2020 15:10:38 +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:36 +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:36 +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 18/24] iommu/mediatek: Support master use iova over 32bit Date: Wed, 30 Sep 2020 15:06:41 +0800 Message-ID: <20200930070647.10188-19-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: 6C0FEB249B953302BA0C92E8A7C9EF6EEC673D8C975A6A7EEE073A7124B463A52000:8 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org QWZ0ZXIgZXh0ZW5kaW5nIHY3cywgb3VyIHBhZ2V0YWJsZSBhbHJlYWR5IHN1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