From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224/5Dzo1T7yV0AUPx8U4mLuwY90bhqCEllRVO3m9JxzaNO82cuVXCOGZpDOzyVZWT8IfhZD ARC-Seal: i=1; a=rsa-sha256; t=1516707118; cv=none; d=google.com; s=arc-20160816; b=EZfYbtpOGyRnzJ5fF4kMrUNmJLiTKFQ5eRZxspYZnvYR7YcOPcgJAroHvRJnSBZatr S1XqjwfYyFBDnkIZB1xlHIJfo9FOVMCx+xyBevHdjPUK3/nRtJlMubqhPgmItfpkC6OW a75HKYVJVUqRMCQ1M3a35W5HwHqSaUIK9cYyKNGf/ZjYT16gfjTs42DjxyDC76j4wAQB 6zgJerBaTcNln/st8AMYCN17YU+96Cvn+F8UMnR49aOQ/X8xHnIcQPeYT0K5DgWqivvT 2CcW4UY6CtsfKSZWvbo/qHMV4aBle1WElpddE9UW9qTMNCFtqfB3kj4+I88vJvawOeod AuVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:references:in-reply-to:date:subject:cc:to:from :arc-authentication-results; bh=knIfbrxuo3gZnmkvYmAnZ6R3yBOo92DDgDQWpNBn+oQ=; b=K9KZMnzddPBcZF84j50XUBww3eJyVLkj5bDkSzNLfbxRTLEPCjhncf5K2LwCnutqyd i8o50iJdeaKfLRTKPs/Zng4h30rJXWvpP3HPTmEcpXn5j025yiDN08LjxTwi5+aAJyhR ybSvNkcsOWlpOypsDhoM22TIi/E/lypM6Y3l5DYTydB8uZj4b2QWumTrc4jY79ozXkS2 h38kq1W3244Lmpqf2roY5BYziotgYdXV1kKaev1nARQjaVGqKKfj1ykopm6kY5ZFtA2J ioiwK6iPh3Q4bfB0T/aOBlYXy0T94WT9M1ZZqDVax2S+6d+dryYxsS7aPXVth/1VYCIv iuQw== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of fbarrat@linux.vnet.ibm.com) smtp.mailfrom=fbarrat@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.156.1 is neither permitted nor denied by best guess record for domain of fbarrat@linux.vnet.ibm.com) smtp.mailfrom=fbarrat@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1590382683582678924?= X-GMAIL-MSGID: =?utf-8?q?1590382683582678924?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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