Commit 4c84515d authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

Merge branches 'pm-cpuidle' and 'acpi-pm'

* pm-cpuidle:
  cpuidle: Drop unnecessary type cast in cpuidle_poll_time()
  cpuidle: Fix cpuidle_driver_state_disabled()
  cpuidle: use first valid target residency as poll time

* acpi-pm:
  ACPI: PM: Avoid attaching ACPI PM domain to certain devices
...@@ -1314,9 +1314,19 @@ static void acpi_dev_pm_detach(struct device *dev, bool power_off) ...@@ -1314,9 +1314,19 @@ static void acpi_dev_pm_detach(struct device *dev, bool power_off)
*/ */
int acpi_dev_pm_attach(struct device *dev, bool power_on) int acpi_dev_pm_attach(struct device *dev, bool power_on)
{ {
/*
* Skip devices whose ACPI companions match the device IDs below,
* because they require special power management handling incompatible
* with the generic ACPI PM domain.
*/
static const struct acpi_device_id special_pm_ids[] = {
{"PNP0C0B", }, /* Generic ACPI fan */
{"INT3404", }, /* Fan */
{}
};
struct acpi_device *adev = ACPI_COMPANION(dev); struct acpi_device *adev = ACPI_COMPANION(dev);
if (!adev) if (!adev || !acpi_match_device_ids(adev, special_pm_ids))
return 0; return 0;
/* /*
......
...@@ -381,7 +381,8 @@ u64 cpuidle_poll_time(struct cpuidle_driver *drv, ...@@ -381,7 +381,8 @@ u64 cpuidle_poll_time(struct cpuidle_driver *drv,
if (dev->states_usage[i].disable) if (dev->states_usage[i].disable)
continue; continue;
limit_ns = (u64)drv->states[i].target_residency_ns; limit_ns = drv->states[i].target_residency_ns;
break;
} }
dev->poll_limit_ns = limit_ns; dev->poll_limit_ns = limit_ns;
......
...@@ -403,6 +403,13 @@ void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx, ...@@ -403,6 +403,13 @@ void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx,
mutex_lock(&cpuidle_lock); mutex_lock(&cpuidle_lock);
spin_lock(&cpuidle_driver_lock);
if (!drv->cpumask) {
drv->states[idx].flags |= CPUIDLE_FLAG_UNUSABLE;
goto unlock;
}
for_each_cpu(cpu, drv->cpumask) { for_each_cpu(cpu, drv->cpumask) {
struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu); struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu);
...@@ -415,5 +422,8 @@ void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx, ...@@ -415,5 +422,8 @@ void cpuidle_driver_state_disabled(struct cpuidle_driver *drv, int idx,
dev->states_usage[idx].disable &= ~CPUIDLE_STATE_DISABLED_BY_DRIVER; dev->states_usage[idx].disable &= ~CPUIDLE_STATE_DISABLED_BY_DRIVER;
} }
unlock:
spin_unlock(&cpuidle_driver_lock);
mutex_unlock(&cpuidle_lock); mutex_unlock(&cpuidle_lock);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment