From patchwork Thu Aug 16 12:12:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yijing Wang X-Patchwork-Id: 1331131 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1840940210 for ; Thu, 16 Aug 2012 12:14:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754143Ab2HPMO0 (ORCPT ); Thu, 16 Aug 2012 08:14:26 -0400 Received: from szxga01-in.huawei.com ([119.145.14.64]:11104 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753855Ab2HPMOZ (ORCPT ); Thu, 16 Aug 2012 08:14:25 -0400 Received: from 172.24.2.119 (EHLO szxeml214-edg.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id ANG98387; Thu, 16 Aug 2012 20:14:23 +0800 (CST) Received: from SZXEML414-HUB.china.huawei.com (10.82.67.153) by szxeml214-edg.china.huawei.com (172.24.2.29) with Microsoft SMTP Server (TLS) id 14.1.323.3; Thu, 16 Aug 2012 20:13:38 +0800 Received: from localhost (10.135.76.84) by SZXEML414-HUB.china.huawei.com (10.82.67.153) with Microsoft SMTP Server id 14.1.323.3; Thu, 16 Aug 2012 20:12:50 +0800 From: Yijing Wang To: Bjorn Helgaas , CC: Hanjun Guo , Jiang Liu , Yinghai Lu , Yijing Wang Subject: [PATCH 1/3] PCI, acpiphp: Add module parameter "complete_add" used to determine whether to hot add all devices regardless of be assigned resources fail Date: Thu, 16 Aug 2012 20:12:20 +0800 Message-ID: <1345119142-5896-1-git-send-email-wangyijing@huawei.com> X-Mailer: git-send-email 1.7.11.msysgit.1 MIME-Version: 1.0 X-Originating-IP: [10.135.76.84] X-CFilter-Loop: Reflected Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Default, when we hot add pci devices, if system allocate resources fail, this devices will be removed again. Module parameter complete_add = 1 will forces to hot add all pci devices regardless of be assigned resources fail. Signed-off-by: Yijing Wang --- drivers/pci/hotplug/acpiphp.h | 2 +- drivers/pci/hotplug/acpiphp_core.c | 4 +++- drivers/pci/hotplug/acpiphp_glue.c | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h index a1afb5b..b228dad 100644 --- a/drivers/pci/hotplug/acpiphp.h +++ b/drivers/pci/hotplug/acpiphp.h @@ -206,5 +206,5 @@ extern u8 acpiphp_get_adapter_status (struct acpiphp_slot *slot); /* variables */ extern bool acpiphp_debug; - +extern bool acpiphp_complete_add; #endif /* _ACPIPHP_H */ diff --git a/drivers/pci/hotplug/acpiphp_core.c b/drivers/pci/hotplug/acpiphp_core.c index 96316b7..6d31608 100644 --- a/drivers/pci/hotplug/acpiphp_core.c +++ b/drivers/pci/hotplug/acpiphp_core.c @@ -48,7 +48,7 @@ #define SLOT_NAME_SIZE 21 /* {_SUN} */ bool acpiphp_debug; - +bool acpiphp_complete_add; /* local variables */ static int num_slots; static struct acpiphp_attention_info *attention_info; @@ -61,7 +61,9 @@ MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); MODULE_PARM_DESC(debug, "Debugging mode enabled or not"); +MODULE_PARM_DESC(complete_add, "Hot add all pci devices regardless of be assign resources fail"); module_param_named(debug, acpiphp_debug, bool, 0644); +module_param_named(complete_add, acpiphp_complete_add, bool, 0644); /* export the attention callback registration methods */ EXPORT_SYMBOL_GPL(acpiphp_register_attention); diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index ad6fd66..a372ade 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -827,7 +827,8 @@ static int __ref enable_device(struct acpiphp_slot *slot) acpiphp_bus_add(func); pci_bus_assign_resources(bus); - acpiphp_sanitize_bus(bus); + if (!acpiphp_complete_add) + acpiphp_sanitize_bus(bus); acpiphp_set_hpp_values(bus); acpiphp_set_acpi_region(slot); pci_enable_bridges(bus); @@ -1115,7 +1116,8 @@ static int acpiphp_configure_bridge (acpi_handle handle) pci_bus_size_bridges(bus); pci_bus_assign_resources(bus); - acpiphp_sanitize_bus(bus); + if (!acpiphp_complete_add) + acpiphp_sanitize_bus(bus); acpiphp_set_hpp_values(bus); pci_enable_bridges(bus); return 0;