Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4196195pxv; Mon, 19 Jul 2021 20:05:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzNmwzhqapFem772ga7lMbMUuDu+gJ7EmGh8i6MQHqZofrZE3VhdBUKVugZdqgu3lyb0D2 X-Received: by 2002:a17:906:4b43:: with SMTP id j3mr16599963ejv.524.1626750308774; Mon, 19 Jul 2021 20:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626750308; cv=none; d=google.com; s=arc-20160816; b=LLHAMKjrROYg6U4CpcRWPAzizoYAhwg+fbYSkrF/WptE4aJgMRoMZ2+YKUs4P9ctmt D+0RSELkGwepmfO6jE0nS4K/mb+gjt+GBnH1j/Ybnvsd2YxsRybCHGt13mbq3aHsoVzb BgHvjBgGCB90+l/gfXiDTa5qI9Mc5FEyWk3OclLy+Ez/hVRmPUfT6HCBck9jXgB/L4Iq ACY3f2stMUSBuuCwAlEoQ80s2WDz49swiPODZHUgcqJXYXXqe6C9PlD4q5FV8FCYrWHs kykXzue2StIcvTA0y9D+ry5DYv9uvwJQ47tJOaDX4fqnQM1XkNoBHoy1YUU69RO0HHLe fK2Q== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=Oix+NKONo3dc98HO65gjSGiue5LNvnVPNsPdxoehHC0=; b=fvpPcEfseBeXY4UsXuDWMgHUy7vd3KJgIABq7a6p5okrm6CAE5GGn/fcHxtMayRTRZ hxuVO0XHXYUsbBUe7KW+a8LYIxt5dq7VZyGeFBxbNvV/azZqVzcju9Ykgg5FOnDWCO4/ BWJcGnWWlquNygIOzq+CdvOo+IRvfbNYz82/LFlVUJiPOolGPpeu+2bDJ3Toy3IC/1Vb ALctNGwT9CFtbM82bwE1VpdK5EJMWY3teAdLbsp3oJl2vZ7xKywBEYjpNo2Yy0bLhyk6 5z5PpWqGDDXJwmEVevJ8CxiNuFbUvQFkInp9KlLvlkZz6wWACr+TJTFC9ZTVAGOGVvgT AaNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=qLWHGOLy; 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 w3si20147680edc.112.2021.07.19.20.04.45; Mon, 19 Jul 2021 20:05:08 -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=qLWHGOLy; 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 S1345771AbhGTCWH (ORCPT + 99 others); Mon, 19 Jul 2021 22:22:07 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:56484 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S238258AbhGTCTE (ORCPT ); Mon, 19 Jul 2021 22:19:04 -0400 X-UUID: d03943b525674c34ba6f5a4f6dc3276c-20210720 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=Oix+NKONo3dc98HO65gjSGiue5LNvnVPNsPdxoehHC0=; b=qLWHGOLye72IHuvgDNrvZDRZTx7oqfgxPPBK6n93kWohTEF/p3qJEAqac1XprwzjvardCfHm5gHlw4wR1yl1tWk/nQuupgsTCieQTvCFBUL9tfNhpQV0Ymw6cUb209krQw4dwxFZcX3t08kX8gddoFxebhrMHJmsO5UTsgvh3o0=; X-UUID: d03943b525674c34ba6f5a4f6dc3276c-20210720 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 498812155; Tue, 20 Jul 2021 10:59:40 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 20 Jul 2021 10:59:39 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 20 Jul 2021 10:59:38 +0800 Message-ID: <1626749978.2466.14.camel@mhfsdcap03> Subject: Re: [PATCH v11 2/4] PCI: mediatek: Add new method to get shared pcie-cfg base address and parse node From: Chuanjia Liu To: , Bjorn Helgaas , "Matthias Brugger" , Lorenzo Pieralisi CC: , , , , , , Frank Wunderlich , , , , , , Chuanjia Liu Date: Tue, 20 Jul 2021 10:59:38 +0800 In-Reply-To: <20210719073456.28666-3-chuanjia.liu@mediatek.com> References: <20210719073456.28666-1-chuanjia.liu@mediatek.com> <20210719073456.28666-3-chuanjia.liu@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-MTK: N Content-Transfer-Encoding: base64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gTW9uLCAyMDIxLTA3LTE5IGF0IDE1OjM0ICswODAwLCBDaHVhbmppYSBMaXUgd3JvdGU6DQo+ IEZvciB0aGUgbmV3IGR0cyBmb3JtYXQsIGFkZCBhIG5ldyBtZXRob2QgdG8gZ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