mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 08:15:07 -04:00
Merge branch 'acpi-scan'
Merge core ACPI device enumeration code changes for 7.3-rc1: - Prevent the core ACPI enumeration code from combining device resources that overlap completely in order to avoid resource conflicts during platform device registration because there are drivers that expect such resources to be present (Rafael Wysocki) - Defer device power initialization during ACPI-based device enumeration to the point when the given device is known to be present and functional and all of its dependencies have been met (Peixin Xie) - Fix bus ID cleanup on device_add() failures during ACPI device object registration (Hongyan Xu) * acpi-scan: ACPI: scan: Do not combine resources that overlap completely ACPI: scan: Defer device power initialization ACPI: scan: fix bus ID cleanup on device_add() failures
This commit is contained in:
@@ -85,7 +85,13 @@ static unsigned int acpi_platform_adjust_resources(struct acpi_device *adev,
|
||||
for (i = 0; i < count; ) {
|
||||
struct resource *res = &resources[i];
|
||||
|
||||
if (resource_type(new_res) != resource_type(res) ||
|
||||
/*
|
||||
* Look for overlaps of resources of the same type that would
|
||||
* cause resource insertion to fail down the road.
|
||||
*/
|
||||
if (__resource_contains_unbound(res, new_res) ||
|
||||
__resource_contains_unbound(new_res, res) ||
|
||||
resource_type(new_res) != resource_type(res) ||
|
||||
!resource_union(new_res, res, new_res)) {
|
||||
i++;
|
||||
continue;
|
||||
|
||||
@@ -954,6 +954,7 @@ struct acpi_device *acpi_add_power_resource(acpi_handle handle)
|
||||
INIT_LIST_HEAD(&resource->list_node);
|
||||
INIT_LIST_HEAD(&resource->dependents);
|
||||
device->power.state = ACPI_STATE_UNKNOWN;
|
||||
device->flags.initialized = true;
|
||||
|
||||
/* Evaluate the object to get the system level and resource order. */
|
||||
status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
|
||||
|
||||
@@ -520,12 +520,10 @@ static void acpi_device_release(struct device *dev)
|
||||
kfree(acpi_dev);
|
||||
}
|
||||
|
||||
static void acpi_device_del(struct acpi_device *device)
|
||||
static void acpi_device_cleanup(struct acpi_device *device)
|
||||
{
|
||||
struct acpi_device_bus_id *acpi_device_bus_id;
|
||||
|
||||
mutex_lock(&acpi_device_lock);
|
||||
|
||||
list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node)
|
||||
if (!strcmp(acpi_device_bus_id->bus_id,
|
||||
acpi_device_hid(device))) {
|
||||
@@ -540,6 +538,13 @@ static void acpi_device_del(struct acpi_device *device)
|
||||
}
|
||||
|
||||
list_del(&device->wakeup_list);
|
||||
}
|
||||
|
||||
static void acpi_device_del(struct acpi_device *device)
|
||||
{
|
||||
mutex_lock(&acpi_device_lock);
|
||||
|
||||
acpi_device_cleanup(device);
|
||||
|
||||
mutex_unlock(&acpi_device_lock);
|
||||
|
||||
@@ -799,7 +804,7 @@ int acpi_device_add(struct acpi_device *device)
|
||||
err:
|
||||
mutex_lock(&acpi_device_lock);
|
||||
|
||||
list_del(&device->wakeup_list);
|
||||
acpi_device_cleanup(device);
|
||||
|
||||
err_unlock:
|
||||
mutex_unlock(&acpi_device_lock);
|
||||
@@ -1138,9 +1143,6 @@ static void acpi_bus_get_power_flags(struct acpi_device *device)
|
||||
if (!list_empty(&device->power.states[ACPI_STATE_D3_HOT].resources))
|
||||
device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
|
||||
}
|
||||
|
||||
if (acpi_bus_init_power(device))
|
||||
device->flags.power_manageable = 0;
|
||||
}
|
||||
|
||||
static void acpi_bus_get_flags(struct acpi_device *device)
|
||||
@@ -1821,7 +1823,6 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
|
||||
acpi_set_pnp_ids(handle, &device->pnp, type);
|
||||
acpi_init_properties(device);
|
||||
acpi_bus_get_flags(device);
|
||||
device->flags.initialized = true;
|
||||
device->flags.enumeration_by_parent =
|
||||
acpi_device_enumeration_by_parent(device);
|
||||
acpi_device_clear_enumerated(device);
|
||||
|
||||
Reference in New Issue
Block a user