diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-05-01 21:54:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-19 17:13:22 -0400 |
commit | 7430e34c70106a9576fc61d77604d164b187a1b7 (patch) | |
tree | 4b9eeaaa3702c9be216f820e8eeaf11f93610d2c /drivers/pci/hotplug/acpi_pcihp.c | |
parent | 2433ee2654f0ac86f7886e5a8d01bee7f3c7c6db (diff) |
[PATCH] acpi_pcihp: Fix programming _HPP values
This patch fixes the problem that hotplug parameters are not programed
when PCI cards are hot-added by ACPIPHP, SHPCHP and PCIEHP driver. The
pci_dev structure being hot-added is not bound to ACPI handle, so we
need to trace PCI bus tree to find ACPI handle.
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: Kristen Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug/acpi_pcihp.c')
-rw-r--r-- | drivers/pci/hotplug/acpi_pcihp.c | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index 64cb30d7fc9a..9395fec73423 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c | |||
@@ -145,14 +145,27 @@ EXPORT_SYMBOL_GPL(acpi_run_oshp); | |||
145 | 145 | ||
146 | /* acpi_get_hp_params_from_firmware | 146 | /* acpi_get_hp_params_from_firmware |
147 | * | 147 | * |
148 | * @dev - the pci_dev of the newly added device | 148 | * @bus - the pci_bus of the bus on which the device is newly added |
149 | * @hpp - allocated by the caller | 149 | * @hpp - allocated by the caller |
150 | */ | 150 | */ |
151 | acpi_status acpi_get_hp_params_from_firmware(struct pci_dev *dev, | 151 | acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, |
152 | struct hotplug_params *hpp) | 152 | struct hotplug_params *hpp) |
153 | { | 153 | { |
154 | acpi_status status = AE_NOT_FOUND; | 154 | acpi_status status = AE_NOT_FOUND; |
155 | struct pci_dev *pdev = dev; | 155 | acpi_handle handle, phandle; |
156 | struct pci_bus *pbus = bus; | ||
157 | struct pci_dev *pdev; | ||
158 | |||
159 | do { | ||
160 | pdev = pbus->self; | ||
161 | if (!pdev) { | ||
162 | handle = acpi_get_pci_rootbridge_handle( | ||
163 | pci_domain_nr(pbus), pbus->number); | ||
164 | break; | ||
165 | } | ||
166 | handle = DEVICE_ACPI_HANDLE(&(pdev->dev)); | ||
167 | pbus = pbus->parent; | ||
168 | } while (!handle); | ||
156 | 169 | ||
157 | /* | 170 | /* |
158 | * _HPP settings apply to all child buses, until another _HPP is | 171 | * _HPP settings apply to all child buses, until another _HPP is |
@@ -160,15 +173,16 @@ acpi_status acpi_get_hp_params_from_firmware(struct pci_dev *dev, | |||
160 | * look for it in the parent device scope since that would apply to | 173 | * look for it in the parent device scope since that would apply to |
161 | * this pci dev. If we don't find any _HPP, use hardcoded defaults | 174 | * this pci dev. If we don't find any _HPP, use hardcoded defaults |
162 | */ | 175 | */ |
163 | while (pdev && (ACPI_FAILURE(status))) { | 176 | while (handle) { |
164 | acpi_handle handle = DEVICE_ACPI_HANDLE(&(pdev->dev)); | ||
165 | if (!handle) | ||
166 | break; | ||
167 | status = acpi_run_hpp(handle, hpp); | 177 | status = acpi_run_hpp(handle, hpp); |
168 | if (!(pdev->bus->parent)) | 178 | if (ACPI_SUCCESS(status)) |
179 | break; | ||
180 | if (acpi_root_bridge(handle)) | ||
181 | break; | ||
182 | status = acpi_get_parent(handle, &phandle); | ||
183 | if (ACPI_FAILURE(status)) | ||
169 | break; | 184 | break; |
170 | /* Check if a parent object supports _HPP */ | 185 | handle = phandle; |
171 | pdev = pdev->bus->parent->self; | ||
172 | } | 186 | } |
173 | return status; | 187 | return status; |
174 | } | 188 | } |