From e0fa3b43df0b57967857b2c83bad9a5193fbddf5 Mon Sep 17 00:00:00 2001 From: Taku Izumi Date: Thu, 20 Nov 2008 15:22:37 +0900 Subject: [PATCH] PCI/ACPI: Remove unnecessary _OSC evaluation for control request If a control had already been granted, we don't need to re-evaluate _OSC for it because firmware may not reject control of any feature it has previously granted control to. Reviewed-by: Andrew Patterson Tested-by: Andrew Patterson Signed-off-by: Kenji Kaneshige Signed-off-by: Taku Izumi Signed-off-by: Jesse Barnes --- drivers/pci/pci-acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index c580a525d9ce..736bb248008e 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -210,6 +210,10 @@ acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) goto out; } + /* No need to evaluate _OSC if the control was already granted. */ + if ((osc_data->control_set & ctrlset) == ctrlset) + goto out; + if (!osc_data->is_queried) { status = __acpi_query_osc(osc_data->support_set, osc_data); if (ACPI_FAILURE(status)) -- 2.20.1