Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8318220ybl; Thu, 16 Jan 2020 14:31:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxHSfGGYJGNL0LpSaXFobGeHXPDU32CdCGCPbHHTrGQidNEAwk6emqI9/Uth96J9RdvyI+J X-Received: by 2002:a05:6808:191:: with SMTP id w17mr1111782oic.29.1579213881546; Thu, 16 Jan 2020 14:31:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579213881; cv=none; d=google.com; s=arc-20160816; b=RjPj+EpjPklo7a925dTxIkQ9IhkYviiWgfsEacnCsFCpabKw/e8dqvs6K86fARQsXu pcAZIhU36neYxuhNREN7y/3dmwntLUYJJdEMkSrcYk2W6vTzcMHv6SrAfZerpu2lnlZ8 wATVnkS1tKdyTxD6YGpXFYDFZMvJdd3fFVKN0hsVg57BWwsWueAxE24pq3EfNIAFkDRO UAynqzLgAHktj2x+DWkhmWnEWemJS4Ol6CotcipzwxILvCcy+GhuiECoiz0SWCqCBfEQ d6UvVlYu4GPFEH5zlRK8zQ13zWALs4E67MJakAagScAOgV9zrpW6PCVuFNZ+PEx3M2td ZKGw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NjTjEFm5BxagSUHFiRQrw5Sc/T5z8E4wjYhpT5mmnNM=; b=KuhpmJnR0AIUajAnEx5jsitJuPrg2gZdedDm98CZj1cpDiLsI20n5ayCtKSc8SFKZd 0HV3JXdc/OvcYxAvJ73P194PQ/lKLyuPUhTqZ/9k6cv39xTYKZn9ww+idlVW8fU7jUDH 872+CFBKEB8QSacmZPvHEDjNSRYk2RzoXTglxHUKPt/hWCZ4CGaImjXm0EDIbzD+orA5 l4Ngk8GhkUfDsnJwkqMGldGGQEBoVWJVXVXLMi+jEuut1ZTJu51aTWB5vlgbkxlf5laa Lb3FZmsXMgz8cW8NJiAhJ7PQ17jfde+pbtQj1NkhPxLGcHj4a6m9V2IKJzMgB1dB6VZw Ru7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="H333YmT/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u127si11822232oig.71.2020.01.16.14.31.10; Thu, 16 Jan 2020 14:31:21 -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="H333YmT/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387585AbgAPSAd (ORCPT + 99 others); Thu, 16 Jan 2020 13:00:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:59592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405781AbgAPRlr (ORCPT ); Thu, 16 Jan 2020 12:41:47 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0819624718; Thu, 16 Jan 2020 17:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579196506; bh=vDh1zh2NXIVh0tH7uGbKC5ZjFd32+DbtXkYJo7HcdK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H333YmT/XW5BFMByVvMfCgUpCqrnFsBWfeUrsrdvW86XmA/FOjxyrrbAhjru1D+rL oouaBhP0uSJIQd3epXnogaIaVHLjS8j5a/0Q9rzfBm8/J5Mje84AxEBOMzx42lyzSb Jzmp3rS23Xq/4QQxDBrmBIWbRq4rhcrDUCy46hPs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Oliver O'Halloran , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 4.9 246/251] powerpc/powernv: Disable native PCIe port management Date: Thu, 16 Jan 2020 12:36:35 -0500 Message-Id: <20200116173641.22137-206-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116173641.22137-1-sashal@kernel.org> References: <20200116173641.22137-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 [ Upstream commit 9d72dcef891030545f39ad386a30cf91df517fb2 ] 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: Sasha Levin --- arch/powerpc/platforms/powernv/pci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 98cc8ba07c23..00dbf1e895a9 100644 --- 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); -- 2.20.1