From patchwork Thu Feb 25 02:59:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shaohua Li X-Patchwork-Id: 81871 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1P2xtvP014484 for ; Thu, 25 Feb 2010 02:59:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758864Ab0BYC7z (ORCPT ); Wed, 24 Feb 2010 21:59:55 -0500 Received: from mga01.intel.com ([192.55.52.88]:40580 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758841Ab0BYC7y (ORCPT ); Wed, 24 Feb 2010 21:59:54 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 24 Feb 2010 18:57:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.49,536,1262592000"; d="scan'208";a="775710667" Received: from sli10-conroe.sh.intel.com (HELO sli10-desk.sh.intel.com) ([10.239.13.164]) by fmsmga001.fm.intel.com with ESMTP; 24 Feb 2010 18:59:43 -0800 Received: from david by sli10-desk.sh.intel.com with local (Exim 4.69) (envelope-from ) id 1NkTxA-0007Hf-QO; Thu, 25 Feb 2010 10:59:52 +0800 From: Shaohua Li To: linux-acpi@vger.kernel.org Cc: lenb@kernel.org, akpm@linux-foundation.org, pm@debian.org, Shaohua Li Subject: [PATCH] acpiphp: Execute ACPI _REG method for hotadded devices Date: Thu, 25 Feb 2010 10:59:34 +0800 Message-Id: <1267066774-27764-1-git-send-email-shaohua.li@intel.com> X-Mailer: git-send-email 1.6.3.3 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Feb 2010 02:59:56 +0000 (UTC) diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c index cb2fd01..b5dad9f 100644 --- a/drivers/pci/hotplug/acpiphp_glue.c +++ b/drivers/pci/hotplug/acpiphp_glue.c @@ -749,6 +749,24 @@ static int acpiphp_bus_trim(acpi_handle handle) return retval; } +static void acpiphp_set_acpi_region(struct acpiphp_slot *slot) +{ + struct acpiphp_func *func; + union acpi_object params[2]; + struct acpi_object_list arg_list; + + list_for_each_entry(func, &slot->funcs, sibling) { + arg_list.count = 2; + arg_list.pointer = params; + params[0].type = ACPI_TYPE_INTEGER; + params[0].integer.value = ACPI_ADR_SPACE_PCI_CONFIG; + params[1].type = ACPI_TYPE_INTEGER; + params[1].integer.value = 1; + /* _REG is optional, we don't care about if there is failure */ + acpi_evaluate_object(func->handle, "_REG", &arg_list, NULL); + } +} + /** * enable_device - enable, configure a slot * @slot: slot to be enabled @@ -805,6 +823,7 @@ static int __ref enable_device(struct acpiphp_slot *slot) pci_bus_assign_resources(bus); acpiphp_sanitize_bus(bus); acpiphp_set_hpp_values(bus); + acpiphp_set_acpi_region(slot); pci_enable_bridges(bus); pci_bus_add_devices(bus);