Skip to content

Commit b7356ab

Browse files
committed
Merge tag 'pm+acpi-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management and ACPI fixes from Rafael Wysocki: "These are fixes collected over the last week, most importnatly two cpufreq reverts fixing regressions introduced in 3.10, an autoseelp fix preventing systems using it from crashing during shutdown and two ACPI scan fixes related to hotplug. Specifics: - Two cpufreq commits from the 3.10 cycle introduced regressions. The first of them was buggy (it did way much more than it needed to do) and the second one attempted to fix an issue introduced by the first one. Fixes from Srivatsa S Bhat revert both. - If autosleep triggers during system shutdown and the shutdown callbacks of some device drivers have been called already, it may crash the system. Fix from Liu Shuo prevents that from happening by making try_to_suspend() check system_state. - The ACPI memory hotplug driver doesn't clear its driver_data on errors which may cause a NULL poiter dereference to happen later. Fix from Toshi Kani. - The ACPI namespace scanning code should not try to attach scan handlers to device objects that have them already, which may confuse things quite a bit, and it should rescan the whole namespace branch starting at the given node after receiving a bus check notify event even if the device at that particular node has been discovered already. Fixes from Rafael J Wysocki. - New ACPI video blacklist entry for a system whose initial backlight setting from the BIOS doesn't make sense. From Lan Tianyu. - Garbage string output avoindance for ACPI PNP from Liu Shuo. - Two Kconfig fixes for issues introduced recently in the s3c24xx cpufreq driver (when moving the driver to drivers/cpufreq) from Paul Bolle. - Trivial comment fix in pm_wakeup.h from Chanwoo Choi" * tag 'pm+acpi-3.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPI / video: ignore BIOS initial backlight value for Fujitsu E753 PNP / ACPI: avoid garbage in resource name cpufreq: Revert commit 2f7021a to fix CPU hotplug regression cpufreq: s3c24xx: fix "depends on ARM_S3C24XX" in Kconfig cpufreq: s3c24xx: rename CONFIG_CPU_FREQ_S3C24XX_DEBUGFS PM / Sleep: Fix comment typo in pm_wakeup.h PM / Sleep: avoid 'autosleep' in shutdown progress cpufreq: Revert commit a66b2e to fix suspend/resume regression ACPI / memhotplug: Fix a stale pointer in error path ACPI / scan: Always call acpi_bus_scan() for bus check notifications ACPI / scan: Do not try to attach scan handlers to devices having them
2 parents ecb2cf1 + 5a8d281 commit b7356ab

File tree

12 files changed

+32
-19
lines changed

12 files changed

+32
-19
lines changed

arch/arm/mach-s3c24xx/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ config S3C24XX_GPIO_EXTRA128
208208

209209
config S3C24XX_PLL
210210
bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
211-
depends on ARM_S3C24XX
211+
depends on ARM_S3C24XX_CPUFREQ
212212
help
213213
Compile in support for changing the PLL frequency from the
214214
S3C24XX series CPUfreq driver. The PLL takes time to settle

drivers/acpi/acpi_memhotplug.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ static int acpi_memory_device_add(struct acpi_device *device,
323323
/* Get the range from the _CRS */
324324
result = acpi_memory_get_device_resources(mem_device);
325325
if (result) {
326+
device->driver_data = NULL;
326327
kfree(mem_device);
327328
return result;
328329
}

drivers/acpi/scan.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,12 @@ static void acpi_scan_bus_device_check(acpi_handle handle, u32 ost_source)
352352
mutex_lock(&acpi_scan_lock);
353353
lock_device_hotplug();
354354

355-
acpi_bus_get_device(handle, &device);
356-
if (device) {
357-
dev_warn(&device->dev, "Attempt to re-insert\n");
358-
goto out;
355+
if (ost_source != ACPI_NOTIFY_BUS_CHECK) {
356+
acpi_bus_get_device(handle, &device);
357+
if (device) {
358+
dev_warn(&device->dev, "Attempt to re-insert\n");
359+
goto out;
360+
}
359361
}
360362
acpi_evaluate_hotplug_ost(handle, ost_source,
361363
ACPI_OST_SC_INSERT_IN_PROGRESS, NULL);
@@ -1981,6 +1983,9 @@ static acpi_status acpi_bus_device_attach(acpi_handle handle, u32 lvl_not_used,
19811983
if (acpi_bus_get_device(handle, &device))
19821984
return AE_CTRL_DEPTH;
19831985

1986+
if (device->handler)
1987+
return AE_OK;
1988+
19841989
ret = acpi_scan_attach_handler(device);
19851990
if (ret)
19861991
return ret > 0 ? AE_OK : AE_CTRL_DEPTH;

drivers/acpi/video.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
448448
DMI_MATCH(DMI_PRODUCT_NAME, "HP Folio 13 - 2000 Notebook PC"),
449449
},
450450
},
451+
{
452+
.callback = video_ignore_initial_backlight,
453+
.ident = "Fujitsu E753",
454+
.matches = {
455+
DMI_MATCH(DMI_BOARD_VENDOR, "FUJITSU"),
456+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E753"),
457+
},
458+
},
451459
{
452460
.callback = video_ignore_initial_backlight,
453461
.ident = "HP Pavilion dm4",

drivers/cpufreq/cpufreq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1942,13 +1942,15 @@ static int cpufreq_cpu_callback(struct notifier_block *nfb,
19421942
if (dev) {
19431943
switch (action) {
19441944
case CPU_ONLINE:
1945+
case CPU_ONLINE_FROZEN:
19451946
cpufreq_add_dev(dev, NULL);
19461947
break;
19471948
case CPU_DOWN_PREPARE:
1948-
case CPU_UP_CANCELED_FROZEN:
1949+
case CPU_DOWN_PREPARE_FROZEN:
19491950
__cpufreq_remove_dev(dev, NULL);
19501951
break;
19511952
case CPU_DOWN_FAILED:
1953+
case CPU_DOWN_FAILED_FROZEN:
19521954
cpufreq_add_dev(dev, NULL);
19531955
break;
19541956
}

drivers/cpufreq/cpufreq_governor.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <linux/slab.h>
2626
#include <linux/types.h>
2727
#include <linux/workqueue.h>
28-
#include <linux/cpu.h>
2928

3029
#include "cpufreq_governor.h"
3130

@@ -137,10 +136,8 @@ void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy,
137136
if (!all_cpus) {
138137
__gov_queue_work(smp_processor_id(), dbs_data, delay);
139138
} else {
140-
get_online_cpus();
141139
for_each_cpu(i, policy->cpus)
142140
__gov_queue_work(i, dbs_data, delay);
143-
put_online_cpus();
144141
}
145142
}
146143
EXPORT_SYMBOL_GPL(gov_queue_work);

drivers/cpufreq/cpufreq_stats.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,13 +353,11 @@ static int cpufreq_stat_cpu_callback(struct notifier_block *nfb,
353353
cpufreq_update_policy(cpu);
354354
break;
355355
case CPU_DOWN_PREPARE:
356+
case CPU_DOWN_PREPARE_FROZEN:
356357
cpufreq_stats_free_sysfs(cpu);
357358
break;
358359
case CPU_DEAD:
359-
cpufreq_stats_free_table(cpu);
360-
break;
361-
case CPU_UP_CANCELED_FROZEN:
362-
cpufreq_stats_free_sysfs(cpu);
360+
case CPU_DEAD_FROZEN:
363361
cpufreq_stats_free_table(cpu);
364362
break;
365363
}

drivers/cpufreq/s3c24xx-cpufreq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ static struct clk *clk_hclk;
4949
static struct clk *clk_pclk;
5050
static struct clk *clk_arm;
5151

52-
#ifdef CONFIG_CPU_FREQ_S3C24XX_DEBUGFS
52+
#ifdef CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS
5353
struct s3c_cpufreq_config *s3c_cpufreq_getconfig(void)
5454
{
5555
return &cpu_cur;
@@ -59,7 +59,7 @@ struct s3c_iotimings *s3c_cpufreq_getiotimings(void)
5959
{
6060
return &s3c24xx_iotiming;
6161
}
62-
#endif /* CONFIG_CPU_FREQ_S3C24XX_DEBUGFS */
62+
#endif /* CONFIG_ARM_S3C24XX_CPUFREQ_DEBUGFS */
6363

6464
static void s3c_cpufreq_getcur(struct s3c_cpufreq_config *cfg)
6565
{

drivers/pnp/pnpacpi/rsparser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res,
180180
struct pnp_dev *dev = data;
181181
struct acpi_resource_dma *dma;
182182
struct acpi_resource_vendor_typed *vendor_typed;
183-
struct resource r;
183+
struct resource r = {0};
184184
int i, flags;
185185

186186
if (acpi_dev_resource_memory(res, &r)

drivers/pnp/resource.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ struct pnp_resource *pnp_add_resource(struct pnp_dev *dev,
515515
}
516516

517517
pnp_res->res = *res;
518+
pnp_res->res.name = dev->name;
518519
dev_dbg(&dev->dev, "%pR\n", res);
519520
return pnp_res;
520521
}

include/linux/pm_wakeup.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
* @last_time: Monotonic clock when the wakeup source's was touched last time.
3737
* @prevent_sleep_time: Total time this source has been preventing autosleep.
3838
* @event_count: Number of signaled wakeup events.
39-
* @active_count: Number of times the wakeup sorce was activated.
40-
* @relax_count: Number of times the wakeup sorce was deactivated.
39+
* @active_count: Number of times the wakeup source was activated.
40+
* @relax_count: Number of times the wakeup source was deactivated.
4141
* @expire_count: Number of times the wakeup source's timeout has expired.
4242
* @wakeup_count: Number of times the wakeup source might abort suspend.
4343
* @active: Status of the wakeup source.

kernel/power/autosleep.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ static void try_to_suspend(struct work_struct *work)
3232

3333
mutex_lock(&autosleep_lock);
3434

35-
if (!pm_save_wakeup_count(initial_count)) {
35+
if (!pm_save_wakeup_count(initial_count) ||
36+
system_state != SYSTEM_RUNNING) {
3637
mutex_unlock(&autosleep_lock);
3738
goto out;
3839
}

0 commit comments

Comments
 (0)