From patchwork Tue Jan 31 03:43:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gavin Shan X-Patchwork-Id: 721792 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vCBxC5lNrz9sCg for ; Tue, 31 Jan 2017 14:45:35 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vCBxC4tnPzDqH1 for ; Tue, 31 Jan 2017 14:45:35 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vCBw95GtHzDq60 for ; Tue, 31 Jan 2017 14:44:41 +1100 (AEDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0V3dDQk006768 for ; Mon, 30 Jan 2017 22:44:39 -0500 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0a-001b2d01.pphosted.com with ESMTP id 28a69dxfc2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 30 Jan 2017 22:44:39 -0500 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Jan 2017 13:44:37 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 31 Jan 2017 13:44:35 +1000 Received: from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id D2AE62CE8057 for ; Tue, 31 Jan 2017 14:44:34 +1100 (EST) Received: from d23av06.au.ibm.com (d23av06.au.ibm.com [9.190.235.151]) by d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v0V3iQAA35455074 for ; Tue, 31 Jan 2017 14:44:34 +1100 Received: from d23av06.au.ibm.com (localhost [127.0.0.1]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v0V3i2Dt013979 for ; Tue, 31 Jan 2017 14:44:02 +1100 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av06.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v0V3i2UF013557; Tue, 31 Jan 2017 14:44:02 +1100 Received: from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) by ozlabs.au.ibm.com (Postfix) with ESMTP id CA8A0A01E6; Tue, 31 Jan 2017 14:43:37 +1100 (AEDT) Received: from gwshan.ozlabs.ibm.com (shangw.ozlabs.ibm.com [10.61.2.199]) by bran.ozlabs.ibm.com (Postfix) with ESMTP id BB363E3D24; Tue, 31 Jan 2017 14:43:37 +1100 (AEDT) Received: by gwshan.ozlabs.ibm.com (Postfix, from userid 1000) id 9935AAC09AE; Tue, 31 Jan 2017 14:43:37 +1100 (AEDT) From: Gavin Shan To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] drivers/misc/cxl: Avoid unnecessary error message Date: Tue, 31 Jan 2017 14:43:36 +1100 X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17013103-1617-0000-0000-000001A27CF1 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17013103-1618-0000-0000-000047A59C69 Message-Id: <1485834216-25191-1-git-send-email-gwshan@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-31_01:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701310033 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: imunsie@au1.ibm.com, andrew.donnellan@au1.ibm.com, Gavin Shan Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The following error message was observed. It's complaining M32 memory window is missed on virtual PHB, which is a bit confusing. The problem is the memory windows are never updated from its device-tree node. PCI: Memory resource 0 not set for host bridge \ /pciex@3fffe40000000/pci@0/device@0 This avoids the unnecessary error message by updating the PHB's memory windows with pci_process_bridge_OF_ranges(). The function is exported as well. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/pci-common.c | 1 + drivers/misc/cxl/vphb.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 74bec54..b5ffd8a 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -824,6 +824,7 @@ void pci_process_bridge_OF_ranges(struct pci_controller *hose, } } } +EXPORT_SYMBOL_GPL(pci_process_bridge_OF_ranges); /* Decide whether to display the domain number in /proc */ int pci_proc_domain(struct pci_bus *bus) diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c index 3519ace..8382761 100644 --- a/drivers/misc/cxl/vphb.c +++ b/drivers/misc/cxl/vphb.c @@ -215,6 +215,15 @@ int cxl_pci_vphb_add(struct cxl_afu *afu) if (!phb) return -ENODEV; + /* Parse IO and memory ranges */ + if (dev_is_pci(parent)) { + struct pci_dev *pdev; + + pdev = to_pci_dev(parent); + vphb_dn = pnv_pci_get_phb_node(pdev); + pci_process_bridge_OF_ranges(phb, vphb_dn, false); + } + /* Setup parent in sysfs */ phb->parent = parent;