Received: by 10.223.176.46 with SMTP id f43csp4055810wra; Tue, 23 Jan 2018 03:36:22 -0800 (PST) X-Google-Smtp-Source: AH8x227cyVlhPgjzIhOMQK00rARhXEJeHyRFXGaa/cvJwJaneZwejawFiDX4ohzPaK0QosxdVZgQ X-Received: by 2002:a17:902:748b:: with SMTP id h11-v6mr5495681pll.259.1516707382310; Tue, 23 Jan 2018 03:36:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516707382; cv=none; d=google.com; s=arc-20160816; b=VrzPqm6RNfF03OVZgePA6+FGbs4EwBpuAsQOQsyY09ab+ddfEecLcMaaXknOv4TDTc G36hJuXaGR9JB9kxJjihIQgDXawORSNtB8u9qE54a8oEW2pyqakI373ChfEyAu5I1iCg l8qWWyHuia0CLRSg2BPW9vxI0kVYIsmiuBcUKvZ4F3dt9yyZIXDRggHDF3y4RvyLqBl8 J39m6dhZ1Klng2zqTd/6r+/LnkH1Pp5ooaZKWcH/75/QFLe4B6B7YuXxHT4PwUro160k J5x4nNkNUFodyrMZi9rCrDafidqvpk+WNACfrGFctB6Y2rcxHa8FILBEY1ypmBViRSls 6nYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:references:in-reply-to:date :subject:cc:to:from:arc-authentication-results; bh=knIfbrxuo3gZnmkvYmAnZ6R3yBOo92DDgDQWpNBn+oQ=; b=nSKZPUgMa5/IYud5s82uFheLQb1uDla1xdxW0p4gpysXbRTKyFE1+2Eh3a9Kh5pENI ksAVq/Tg5e95MQfi/XgLWQek9WPTTAmwDjlbs8R2qmmfJRKc0sdBCgZ/J397LI8kefTa AbgvlUoBKcmErTHjlLCZ7CyrHMTmjpdwYVdqEFJWvPghdtVDkkUvCEk4Fa8ksCYnnbW1 pBuZWAbqY93eUAXwOTi9x73vc0W2vUMw0+qzNMuTib5WMpHzUPrxbd4zDtmwB/CBW/7g o9jQFqhnBiBEZ1rUz+D/rv9dOqZ5fC0jyz0sKOk4yAFMxB08EVpoIZ7txl1D7Tu8Hh1m o15Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f13si1314377pfj.28.2018.01.23.03.36.08; Tue, 23 Jan 2018 03:36:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751696AbeAWLeq (ORCPT + 99 others); Tue, 23 Jan 2018 06:34:46 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36430 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751351AbeAWLb5 (ORCPT ); Tue, 23 Jan 2018 06:31:57 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0NBTTfb047814 for ; Tue, 23 Jan 2018 06:31:56 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2fp1ajqu4r-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 23 Jan 2018 06:31:56 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 23 Jan 2018 11:31:54 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 23 Jan 2018 11:31:52 -0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0NBVpG526083386; Tue, 23 Jan 2018 11:31:51 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 864E3A4057; Tue, 23 Jan 2018 11:25:31 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E64CA405D; Tue, 23 Jan 2018 11:25:31 +0000 (GMT) Received: from borneo.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.34]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 23 Jan 2018 11:25:31 +0000 (GMT) From: Frederic Barrat To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, gregkh@linuxfoundation.org, mpe@ellerman.id.au, andrew.donnellan@au1.ibm.com, alastair@au1.ibm.com Subject: [PATCH v2 02/13] powerpc/powernv: Set correct configuration space size for opencapi devices Date: Tue, 23 Jan 2018 12:31:37 +0100 X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180123113148.6024-1-fbarrat@linux.vnet.ibm.com> References: <20180123113148.6024-1-fbarrat@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18012311-0012-0000-0000-000005A6D13C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012311-0013-0000-0000-000019225889 Message-Id: <20180123113148.6024-3-fbarrat@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-23_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801230158 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrew Donnellan The configuration space for opencapi devices doesn't have a PCI Express capability, therefore confusing linux in thinking it's of an old PCI type with a 256-byte configuration space size, instead of the desired 4k. So add a PCI fixup to declare the correct size. Signed-off-by: Andrew Donnellan Signed-off-by: Frederic Barrat --- arch/powerpc/platforms/powernv/pci-ioda.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index e780263a14ee..d5af700820f3 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c @@ -4080,6 +4080,19 @@ void __init pnv_pci_init_npu2_opencapi_phb(struct device_node *np) pnv_pci_init_ioda_phb(np, 0, PNV_PHB_NPU_OCAPI); } +static void pnv_npu2_opencapi_cfg_size_fixup(struct pci_dev *dev) +{ + struct pci_controller *hose = pci_bus_to_host(dev->bus); + struct pnv_phb *phb = hose->private_data; + + if (!machine_is(powernv)) + return; + + if (phb->type == PNV_PHB_NPU_OCAPI) + dev->cfg_size = PCI_CFG_SPACE_EXP_SIZE; +} +DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, pnv_npu2_opencapi_cfg_size_fixup); + void __init pnv_pci_init_ioda_hub(struct device_node *np) { struct device_node *phbn; -- 2.14.1