From patchwork Sat Jun 15 00:23:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 10996897 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C89B9112C for ; Sat, 15 Jun 2019 00:30:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA0A1287A8 for ; Sat, 15 Jun 2019 00:30:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD935287AB; Sat, 15 Jun 2019 00:30:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46D5B287A9 for ; Sat, 15 Jun 2019 00:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726138AbfFOAaE (ORCPT ); Fri, 14 Jun 2019 20:30:04 -0400 Received: from gate.crashing.org ([63.228.1.57]:46446 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725981AbfFOAaE (ORCPT ); Fri, 14 Jun 2019 20:30:04 -0400 Received: from ufdda393ec48b57.ant.amazon.com (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x5F0TfFS010961; Fri, 14 Jun 2019 19:29:50 -0500 From: Benjamin Herrenschmidt To: linux-pci@vger.kernel.org Cc: Bjorn Helgaas , Ard Biesheuvel , Lorenzo Pieralisi , Sinan Kaya , Ali Saidi , Zeev Zilberman , linux-arm-kernel , Benjamin Herrenschmidt Subject: [PATCH 3/4] pci: Do not auto-enable PCI reallocation when _DSM #5 returns 0 Date: Sat, 15 Jun 2019 10:23:58 +1000 Message-Id: <20190615002359.29577-3-benh@kernel.crashing.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190615002359.29577-1-benh@kernel.crashing.org> References: <20190615002359.29577-1-benh@kernel.crashing.org> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This prevents auto-enabling of bridges reallocation when the FW tells us that the initial configuration must be preserved for a given host bridge. Signed-off-by: Benjamin Herrenschmidt --- drivers/pci/setup-bus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 0cdd5ff389de..049a5602b942 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1684,10 +1684,16 @@ static enum enable_type pci_realloc_detect(struct pci_bus *bus, enum enable_type enable_local) { bool unassigned = false; + struct pci_host_bridge *hb; if (enable_local != undefined) return enable_local; + /* Don't realloc if ACPI tells us not to */ + hb = pci_find_host_bridge(bus); + if (hb->preserve_config) + return auto_disabled; + pci_walk_bus(bus, iov_resources_unassigned, &unassigned); if (unassigned) return auto_enabled;