From patchwork Sat Sep 10 15:03:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Rui Y" X-Patchwork-Id: 668385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3sWd4x064xz9ssP for ; Sun, 11 Sep 2016 01:18:40 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754753AbcIJPSh (ORCPT ); Sat, 10 Sep 2016 11:18:37 -0400 Received: from mga09.intel.com ([134.134.136.24]:22017 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754091AbcIJPSh (ORCPT ); Sat, 10 Sep 2016 11:18:37 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP; 10 Sep 2016 08:18:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,311,1470726000"; d="scan'208";a="7170996" Received: from wr-optiplex-9010.xa.intel.com ([10.238.71.86]) by orsmga004.jf.intel.com with ESMTP; 10 Sep 2016 08:18:33 -0700 From: Rui Wang To: bp@alien8.de Cc: bhelgaas@google.com, torvalds@linux-foundation.org, peterz@infradead.org, tglx@linutronix.de, helgaas@kernel.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, rjw@rjwysocki.net, tony.luck@intel.com, mingo@kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, rui.y.wang@intel.com Subject: Re: 584c5c422f6c ("x86/ioapic: Support hot-removal of IOAPICs present during boot") Date: Sat, 10 Sep 2016 23:03:29 +0800 Message-Id: <1473519809-31107-1-git-send-email-rui.y.wang@intel.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <20160910143031.5s4psayo4wqrmpt2@pd.tnic> References: <20160910143031.5s4psayo4wqrmpt2@pd.tnic> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Sat, Sep 10, 2016 10:31 PM, Borislav Petkov wrote: > > On Sat, Sep 10, 2016 at 09:11:30PM +0800, Rui Wang wrote: > > Thanks for the analysis. Looks like acpi_gbl_root_node == 0. It is > > Is ACPI_HANDLE(root_bus->bridge) == ACPI_ROOT_OBJECT? > > Because this is what the code does but I can't see it from the code that the > handle is of type ACPI_ROOT_OBJECT... > I seem to have the clue. It is because ACPI_HANDLE(root_bus->bridge) == NULL. Then this root bridge doesn't have a corresponding ACPI device. In this case we shouldn't call acpi_ioapic_add(). This can be true for some old platforms. If that's the case then the patch below can fix it. Thanks Rui From b37d806c78e5eea70dbb890c1e3dbb8b7e5038e6 Mon Sep 17 00:00:00 2001 From: Rui Wang Date: Sat, 10 Sep 2016 10:56:34 -0400 Subject: [PATCH] x86/ioapic: Ignore root bridges without a companion ACPI device Some PCI root bridges don't have a corresponding ACPI device. Don't call acpi_ioapic_add() on these bridges because they can't support ioapic hotplug. Signed-off-by: Rui Wang --- drivers/pci/setup-bus.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index ec538d3..2b05ac6 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1852,10 +1852,15 @@ dump: void __init pci_assign_unassigned_resources(void) { struct pci_bus *root_bus; + acpi_handle root_handle; list_for_each_entry(root_bus, &pci_root_buses, node) { pci_assign_unassigned_root_bus_resources(root_bus); - acpi_ioapic_add(ACPI_HANDLE(root_bus->bridge)); + root_handle = ACPI_HANDLE(root_bus->bridge); + + /* make sure the root bridge has a companion ACPI device */ + if (root_handle) + acpi_ioapic_add(root_handle); } }