diff mbox

[7/10] PCI / Hot-plug: Query _OSC before requesting controls

Message ID 201008060311.33359.rjw@sisk.pl (mailing list archive)
State New, archived
Headers show

Commit Message

Rafael Wysocki Aug. 6, 2010, 1:11 a.m. UTC
None
diff mbox

Patch

Index: linux-2.6/drivers/pci/hotplug/acpi_pcihp.c
===================================================================
--- linux-2.6.orig/drivers/pci/hotplug/acpi_pcihp.c
+++ linux-2.6/drivers/pci/hotplug/acpi_pcihp.c
@@ -358,11 +358,13 @@  int acpi_get_hp_hw_control_from_firmware
 		acpi_get_name(handle, ACPI_FULL_PATHNAME, &string);
 		dbg("Trying to get hotplug control for %s\n",
 				(char *)string.pointer);
+		status = acpi_pci_osc_control_query(handle, &flags);
+		if (ACPI_FAILURE(status)
+		    || !(flags & OSC_SHPC_NATIVE_HP_CONTROL))
+			goto no_control;
 		status = acpi_pci_osc_control_set(handle, flags);
 		if (ACPI_SUCCESS(status))
 			goto got_one;
-		if (status == AE_SUPPORT)
-			goto no_control;
 		kfree(string.pointer);
 		string = (struct acpi_buffer){ ACPI_ALLOCATE_BUFFER, NULL };
 	}