Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp291938ybh; Wed, 22 Jul 2020 00:18:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0f9WId0N73qSFSObBxnI4UK6/sMa7daPWayn+2lMBtQql5N9kgGRPWsQ79PIei8cvDqVk X-Received: by 2002:a17:906:3f82:: with SMTP id b2mr29863257ejj.240.1595402298767; Wed, 22 Jul 2020 00:18:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595402298; cv=none; d=google.com; s=arc-20160816; b=Mp+knsxkN64nBRoMeYRwZy2U6iQtv6LYlJz+nP4j++L11qaMaM400Nrc1uGOwpcV1N l6J4ELw6dmDX1xXhqcIyWx1OAR7HDYEa2zPgfk7pt4LtFG1h+tWZ7mm1XB7wUHTee2MS oV1TKNOUDbokWop73w1miwmi1fl9pE2gdrzabJcU8KWYXWUZmI/4bn+InqMBaQOO5fCo NboZ9wFlLDhWsSiYCSfbfSyHXtdAZdmaZ8mNGcdiacVzPTHOkKasDtxY1T3GFlVGofvS HkX7R9FmsomPkaV0k45lWX3wzjATXDViuP3hD36OfNsCr+QZaXSB8o7FSa74jD6k2dLf 3Iqg== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=0eYS2Sr9yV83oAq6NJ7EPUIvy6CetJuQT3lQICq8KtI=; b=yd1+DaUjdmbETvjM9nNHL8RgxlGlVPYfpB3r6892um76976yBv6ldmGAbpSPKVWuBm 9Olk0gtMEV3sf06JVoqUuK1muruDKEiPauTU7PhRHAGdHQk9h/aTPi5rR2CXer0t3MZ3 V9jknElDry7H4IGPOZkh5kBWyaBG6QEv48qlJSSpZeHXYsqlyDMYkX/BVRdiuZbmixaK ZtJ/yu3/LyH41sh4LDEYNVFOwrBYJKppYGJXjU9dd9oW7V+UO29Xqbfj9GW5hrkZIbrN hmZzLfmgvKwvh62Pmcy8qee0eMkqjdGeI7pE1pA2/yvw2q1GBfboZAkloHd80DFTNpJL loxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=eiGybXaI; 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 ef10si13372547ejb.519.2020.07.22.00.17.54; Wed, 22 Jul 2020 00:18:18 -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=eiGybXaI; 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 S1729248AbgGVHRa (ORCPT + 99 others); Wed, 22 Jul 2020 03:17:30 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:48334 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727096AbgGVHR2 (ORCPT ); Wed, 22 Jul 2020 03:17:28 -0400 X-UUID: 7a2513fa0d424fa1a7682445476d6c20-20200722 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=0eYS2Sr9yV83oAq6NJ7EPUIvy6CetJuQT3lQICq8KtI=; b=eiGybXaI8Y+E4yJdFDB9GZh+xxct51/zsUP0YJWa2H+gIUVbnQbJzQs9vxlYKJ/Vh+IID3oXb1Yhr34TJST3HN/oq9/qtgq61Kbq7kYRQBceIMrjc7Lu8rLPnXS0oHwJxN0F9zPU24Vg0Y5SzLpb9WG7p5iw7CQC8ew5Xmd/w44=; X-UUID: 7a2513fa0d424fa1a7682445476d6c20-20200722 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1610361252; Wed, 22 Jul 2020 15:17:21 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 22 Jul 2020 15:17:17 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 22 Jul 2020 15:17:18 +0800 Message-ID: <1595402238.10848.3.camel@mtkswgap22> Subject: Re: [PATCH v2] iommu/mediatek: check 4GB mode by reading infracfg From: Miles Chen To: Matthias Brugger CC: Yong Wu , Joerg Roedel , "Rob Herring" , , , , , , Mike Rapoport , David Hildenbrand , Yingjoe Chen , Christoph Hellwig , Chao Hao Date: Wed, 22 Jul 2020 15:17:18 +0800 In-Reply-To: <28bf052f-e388-d300-4abe-38f17bff01b6@gmail.com> References: <20200721021619.25575-1-miles.chen@mediatek.com> <1595330677.16172.55.camel@mhfsdcap03> <28bf052f-e388-d300-4abe-38f17bff01b6@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-TM-SNTS-SMTP: 58DFCF7CA20D7056E3E09FFF1EF0DBB987C420E96805A5AFD92BC2023E6D19FD2000: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 T24gVHVlLCAyM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