Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1402642pxy; Mon, 2 Aug 2021 00:08:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoGu8v0FXLj9IvMW46Y+t70I9lPdYwzboCQG2Y6JBAvLgytSZRRPfLnBEK2UZjjeHdloCD X-Received: by 2002:a02:c6c3:: with SMTP id r3mr1900489jan.7.1627888111773; Mon, 02 Aug 2021 00:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627888111; cv=none; d=google.com; s=arc-20160816; b=ujPtFGjSzm/PzVFoUYM0iLZr62oRVSpUf3+TMzDlGw6JniAWAjP3DmX/1HoiJM9l1t 5T8MA9Rx8vnY8IIg0tg+Csod4wJ+duEqtuz/72Ga2pnyWwNOhZOTnra87QpE+YCBfZaK AGmtRELDQYKPIHPdLSamnF5MiJCKqbVYs+6FpJz+k2qL5SYtui6JYu7t2Qehuhk+ckFv R6GulZADqCWipSS3Zs42XSNySKOZ/Kdxf9Qfk6OXe1JsXIObC/3NEzXbOnxTURtBAAUX x40C2lmisvfdwlPsSZ7WBCntWE/kd5otKLl80fiQr66C6LvMezCqJrNzaPbFvN67vlSM k7kA== 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=21ZQL0O+AYNYOVFc0STZ7qW2KMKVaTPFPt6AU1g4ZHY=; b=r/8r6eIsSFxktoMJDRlQ2CWX854qZ6pm5XInRcAsl5pUYdesCtnIhbGuYqlEF1hqfg EzoemEqjf/xw31P+g6atP2HCf+qvRSnBXhfzEc0yk07Rt4uxzOm9MO2NJA/izUGfTEGD p16Nj21+AoEvbpEmnJlfNuebvJCR5a34yJWzpoNHGu+iYxIP5YHSnjzAig7yRvHIImwF awEcuYxboT1X0dIvKTJy5ZDMEb5kXIO6DfotgpZHxkOC8ktlvhUrUMzA08ugBGQd4mit +JXSECb7TKxj46v3ZyIaBbECX6EuFk8rzwhyW3JIArQykw2aoruSG0H6SyOUYeP77JfL N49g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=WX6FnVSF; 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 q1si11987563ile.21.2021.08.02.00.08.20; Mon, 02 Aug 2021 00:08:31 -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=WX6FnVSF; 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 S232443AbhHBHHg (ORCPT + 99 others); Mon, 2 Aug 2021 03:07:36 -0400 Received: from mailgw01.mediatek.com ([60.244.123.138]:58432 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229500AbhHBHHg (ORCPT ); Mon, 2 Aug 2021 03:07:36 -0400 X-UUID: 63fb95fb88ef46a9a61516fd821c764e-20210802 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=21ZQL0O+AYNYOVFc0STZ7qW2KMKVaTPFPt6AU1g4ZHY=; b=WX6FnVSFJdUXjVhxXqOCRqwFQMaxZI7xH8q6uVRPDecNMKc8lNp+iGETgUqb/ZyFIE/O1EIFMttw7fS6uLyrQ2EcmRuLfnSrXhc3C2TfcQ6/C3ogCIisvzPSISmKORffyO0id1ZmeqbF8/dl3sRb3MOGcKzSdHF5FEfLtS8jHqE=; X-UUID: 63fb95fb88ef46a9a61516fd821c764e-20210802 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 17423531; Mon, 02 Aug 2021 15:07:24 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 2 Aug 2021 15:07:23 +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; Mon, 2 Aug 2021 15:07:22 +0800 Message-ID: <1627888042.1118.2.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 , , , , , , Date: Mon, 2 Aug 2021 15:07:22 +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 T24gTW9uLCAyMDIxLTA3LTE5IGF0IDE1OjM0ICswODAwLCBDaHVhbmppYSBMaXUgd3JvdGU6DQoN CkdlbnRseSBwaW5nLi4uDQo+IEZvciB0aGUgbmV3IGR0cyBmb3JtYXQsIGFkZCBhIG5ldyB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