PCI/ACPI: Remove unnecessary osc_lock
9778c14b4ca2 ("ACPI/PCI: Fix possible race condition on _OSC evaluation") added locking around _OSC calls to protect the acpi_osc_data_list that stored the results. 63f10f0f6df4 ("PCI/ACPI: move _OSC code to pci_root.c") moved the results from acpi_osc_data_list to the struct acpi_pci_root, where it no longer needs locking, but did not remove the lock. Remove the unnecessary locking around _OSC calls. Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
1423de718e
commit
866e61fc40
@ -56,8 +56,6 @@ static struct acpi_scan_handler pci_root_handler = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static DEFINE_MUTEX(osc_lock);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
|
* acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
|
||||||
* @handle: the ACPI CA node in question.
|
* @handle: the ACPI CA node in question.
|
||||||
@ -223,12 +221,7 @@ static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root,
|
|||||||
|
|
||||||
static acpi_status acpi_pci_osc_support(struct acpi_pci_root *root, u32 flags)
|
static acpi_status acpi_pci_osc_support(struct acpi_pci_root *root, u32 flags)
|
||||||
{
|
{
|
||||||
acpi_status status;
|
return acpi_pci_query_osc(root, flags, NULL);
|
||||||
|
|
||||||
mutex_lock(&osc_lock);
|
|
||||||
status = acpi_pci_query_osc(root, flags, NULL);
|
|
||||||
mutex_unlock(&osc_lock);
|
|
||||||
return status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle)
|
struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle)
|
||||||
@ -356,7 +349,7 @@ EXPORT_SYMBOL_GPL(acpi_get_pci_dev);
|
|||||||
static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req)
|
static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req)
|
||||||
{
|
{
|
||||||
struct acpi_pci_root *root;
|
struct acpi_pci_root *root;
|
||||||
acpi_status status = AE_OK;
|
acpi_status status;
|
||||||
u32 ctrl, capbuf[3];
|
u32 ctrl, capbuf[3];
|
||||||
|
|
||||||
if (!mask)
|
if (!mask)
|
||||||
@ -370,18 +363,16 @@ static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 r
|
|||||||
if (!root)
|
if (!root)
|
||||||
return AE_NOT_EXIST;
|
return AE_NOT_EXIST;
|
||||||
|
|
||||||
mutex_lock(&osc_lock);
|
|
||||||
|
|
||||||
*mask = ctrl | root->osc_control_set;
|
*mask = ctrl | root->osc_control_set;
|
||||||
/* No need to evaluate _OSC if the control was already granted. */
|
/* No need to evaluate _OSC if the control was already granted. */
|
||||||
if ((root->osc_control_set & ctrl) == ctrl)
|
if ((root->osc_control_set & ctrl) == ctrl)
|
||||||
goto out;
|
return AE_OK;
|
||||||
|
|
||||||
/* Need to check the available controls bits before requesting them. */
|
/* Need to check the available controls bits before requesting them. */
|
||||||
while (*mask) {
|
while (*mask) {
|
||||||
status = acpi_pci_query_osc(root, root->osc_support_set, mask);
|
status = acpi_pci_query_osc(root, root->osc_support_set, mask);
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
goto out;
|
return status;
|
||||||
if (ctrl == *mask)
|
if (ctrl == *mask)
|
||||||
break;
|
break;
|
||||||
decode_osc_control(root, "platform does not support",
|
decode_osc_control(root, "platform does not support",
|
||||||
@ -392,19 +383,18 @@ static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 r
|
|||||||
if ((ctrl & req) != req) {
|
if ((ctrl & req) != req) {
|
||||||
decode_osc_control(root, "not requesting control; platform does not support",
|
decode_osc_control(root, "not requesting control; platform does not support",
|
||||||
req & ~(ctrl));
|
req & ~(ctrl));
|
||||||
status = AE_SUPPORT;
|
return AE_SUPPORT;
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
capbuf[OSC_QUERY_DWORD] = 0;
|
capbuf[OSC_QUERY_DWORD] = 0;
|
||||||
capbuf[OSC_SUPPORT_DWORD] = root->osc_support_set;
|
capbuf[OSC_SUPPORT_DWORD] = root->osc_support_set;
|
||||||
capbuf[OSC_CONTROL_DWORD] = ctrl;
|
capbuf[OSC_CONTROL_DWORD] = ctrl;
|
||||||
status = acpi_pci_run_osc(handle, capbuf, mask);
|
status = acpi_pci_run_osc(handle, capbuf, mask);
|
||||||
if (ACPI_SUCCESS(status))
|
if (ACPI_FAILURE(status))
|
||||||
root->osc_control_set = *mask;
|
|
||||||
out:
|
|
||||||
mutex_unlock(&osc_lock);
|
|
||||||
return status;
|
return status;
|
||||||
|
|
||||||
|
root->osc_control_set = *mask;
|
||||||
|
return AE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
|
static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user