Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4643825ybl; Wed, 22 Jan 2020 01:55:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzGEWCEpdAZID+Nk1y/TxgoRabmsCvHxomx2ef13QMcF/9nRmzDOBLaU0l4umoWkpDIdjfp X-Received: by 2002:aca:4c9:: with SMTP id 192mr6555962oie.105.1579686957217; Wed, 22 Jan 2020 01:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579686957; cv=none; d=google.com; s=arc-20160816; b=MIBFO/QZIYECX2AxlOGpKiZipV0C3pUVc+1ReziYzBGWdg0B3evqoNFlpL2nHakGWy 1UMXEguyfpTn/x4SPGlcgPlHbMt6Ymke4YTH1XW0PwQ7leUi4pM+XIVZN6iEWhWgT3EG 8cBbJUPr40S6DlGRvDAb2K3CXsy2CKx5XS3Jwk+wjSY/CQ0GmwsKHwA139qeMCyS2fCa CsL4vYHJfCTpvrAUJ+b3joBnwzVC0yfwGfZNH+DOyC8X1E4KtU66KkKGkenAQzax7ucj Fb8uTFhxIl+AawQsodkiygu+Y0nLlCBC/kVWTJRxNbd/rY/XbhUKNNSDA68LTioRioza nfbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R7EGQpYcfOrjESrziJMdtZsRRAwvH7rprfJo2UzFzJA=; b=Il5E4KhQs29KXIfOzqR660T7OTNGgg4KDVwmVhT1T2q17zNvKWoz4yTQk8m67xRn2g SO5N1tROPY86scJYy3b2eydUZd3RfFMsqod2qoG8918x/x5LTx+FtxqrIF4uXGuFbXmp k/YRvhuGZxWN27NA/pDoeLRBYn1g/iWrXiErRNKIVheJsveSDzPgKSMFQM3S6dEWZSm6 5enZtsFnvSLmAs039+Gm7pEnC9Qw1dDSrSJxSJpYUzeqWSmZSB635DDmhi0qD1AciwMV epFeW6P4N7r+ctL67DU+m5OOM8QbbhkZ7grkNmyGSv1I9Y8WJHjDvWTkaCUCEUWju/ek 42Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EPG4AMzT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3si21400014oic.108.2020.01.22.01.55.45; Wed, 22 Jan 2020 01:55:57 -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; dkim=pass header.i=@kernel.org header.s=default header.b=EPG4AMzT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730346AbgAVJx4 (ORCPT + 99 others); Wed, 22 Jan 2020 04:53:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:49204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730249AbgAVJei (ORCPT ); Wed, 22 Jan 2020 04:34:38 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4B92A24672; Wed, 22 Jan 2020 09:34:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579685677; bh=K88eFO0gZvTi7Q0tnhqHBPO9ATbtplrOKROOFSFdn1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EPG4AMzTr4s74GXAGPLgwDtDByQqxX8Puvpn+J6DYbEniyOG7SsVsYX6HnT9jy5d5 Awmes0uOMQtG23Zl6JzQEkXlw8lY4yJJz7wIqr2zrUY/WC5o4+gtN7kq0IOqnqzwQr h2pPROALnE6iQzDcefIyvAstAsZqjZsmrKMB/oU8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver OHalloran , Michael Ellerman Subject: [PATCH 4.9 34/97] powerpc/powernv: Disable native PCIe port management Date: Wed, 22 Jan 2020 10:28:38 +0100 Message-Id: <20200122092801.991898907@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092755.678349497@linuxfoundation.org> References: <20200122092755.678349497@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oliver O'Halloran commit 9d72dcef891030545f39ad386a30cf91df517fb2 upstream. On PowerNV the PCIe topology is (currently) managed by the powernv platform code in Linux in cooperation with the platform firmware. Linux's native PCIe port service drivers operate independently of both and this can cause problems. The main issue is that the portbus driver will conflict with the platform specific hotplug driver (pnv_php) over ownership of the MSI used to notify the host when a hotplug event occurs. The portbus driver claims this MSI on behalf of the individual port services because the same interrupt is used for hotplug events, PMEs (on root ports), and link bandwidth change notifications. The portbus driver will always claim the interrupt even if the individual port service drivers, such as pciehp, are compiled out. The second, bigger, problem is that the hotplug port service driver fundamentally does not work on PowerNV. The platform assumes that all PCI devices have a corresponding arch-specific handle derived from the DT node for the device (pci_dn) and without one the platform will not allow a PCI device to be enabled. This problem is largely due to historical baggage, but it can't be resolved without significant re-factoring of the platform PCI support. We can fix these problems in the interim by setting the "pcie_ports_disabled" flag during platform initialisation. The flag indicates the platform owns the PCIe ports which stops the portbus driver from being registered. This does have the side effect of disabling all port services drivers that is: AER, PME, BW notifications, hotplug, and DPC. However, this is not a huge disadvantage on PowerNV since these services are either unused or handled through other means. Fixes: 66725152fb9f ("PCI/hotplug: PowerPC PowerNV PCI hotplug driver") Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20191118065553.30362-1-oohall@gmail.com Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powernv/pci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c @@ -923,6 +923,23 @@ void __init pnv_pci_init(void) if (!firmware_has_feature(FW_FEATURE_OPAL)) return; +#ifdef CONFIG_PCIEPORTBUS + /* + * On PowerNV PCIe devices are (currently) managed in cooperation + * with firmware. This isn't *strictly* required, but there's enough + * assumptions baked into both firmware and the platform code that + * it's unwise to allow the portbus services to be used. + * + * We need to fix this eventually, but for now set this flag to disable + * the portbus driver. The AER service isn't required since that AER + * events are handled via EEH. The pciehp hotplug driver can't work + * without kernel changes (and portbus binding breaks pnv_php). The + * other services also require some thinking about how we're going + * to integrate them. + */ + pcie_ports_disabled = true; +#endif + /* Look for IODA IO-Hubs. */ for_each_compatible_node(np, NULL, "ibm,ioda-hub") { pnv_pci_init_ioda_hub(np);