Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commitbcaea46

Browse files
committed
Merge branches 'acpi-pm' and 'pm-sleep'
* acpi-pm: platform/x86: surfacepro3: Support for wakeup from suspend-to-idle ACPI / PM: Use Low Power S0 Idle on more systems ACPI / PM: Make it possible to ignore the system sleep blacklist* pm-sleep: PM / hibernate: Drop unused parameter of enough_swap block, scsi: Fix race between SPI domain validation and system suspend PM / sleep: Make lock/unlock_system_sleep() available to kernel modules PM: hibernate: Do not subtract NR_FILE_MAPPED in minimum_image_size()
3 parents4b67157 +19351f3 +8ffdfe3 commitbcaea46

File tree

10 files changed

+73
-38
lines changed

10 files changed

+73
-38
lines changed

‎Documentation/admin-guide/kernel-parameters.txt‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223

224224
acpi_sleep=[HW,ACPI] Sleep options
225225
Format: { s3_bios, s3_mode, s3_beep, s4_nohwsig,
226-
old_ordering, nonvs, sci_force_enable }
226+
old_ordering, nonvs, sci_force_enable, nobl }
227227
See Documentation/power/video.txt for information on
228228
s3_bios and s3_mode.
229229
s3_beep is for debugging; it makes the PC's speaker beep
@@ -239,6 +239,9 @@
239239
sci_force_enable causes the kernel to set SCI_EN directly
240240
on resume from S1/S3 (which is against the ACPI spec,
241241
but some broken systems don't work without it).
242+
nobl causes the internal blacklist of systems known to
243+
behave incorrectly in some ways with respect to system
244+
suspend and resume to be ignored (use wisely).
242245

243246
acpi_use_timer_override [HW,ACPI]
244247
Use timer override. For some broken Nvidia NF5 boards

‎arch/x86/kernel/acpi/sleep.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ static int __init acpi_sleep_setup(char *str)
138138
acpi_nvs_nosave_s3();
139139
if (strncmp(str,"old_ordering",12)==0)
140140
acpi_old_suspend_ordering();
141+
if (strncmp(str,"nobl",4)==0)
142+
acpi_sleep_no_blacklist();
141143
str=strchr(str,',');
142144
if (str!=NULL)
143145
str+=strspn(str,", \t");

‎drivers/acpi/sleep.c‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,20 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = {
367367
{},
368368
};
369369

370+
staticboolignore_blacklist;
371+
372+
void__initacpi_sleep_no_blacklist(void)
373+
{
374+
ignore_blacklist= true;
375+
}
376+
370377
staticvoid__initacpi_sleep_dmi_check(void)
371378
{
372379
intyear;
373380

381+
if (ignore_blacklist)
382+
return;
383+
374384
if (dmi_get_date(DMI_BIOS_DATE,&year,NULL,NULL)&&year >=2012)
375385
acpi_nvs_nosave_s3();
376386

@@ -697,7 +707,8 @@ static const struct acpi_device_id lps0_device_ids[] = {
697707
#defineACPI_LPS0_ENTRY5
698708
#defineACPI_LPS0_EXIT6
699709

700-
#defineACPI_S2IDLE_FUNC_MASK((1 << ACPI_LPS0_ENTRY) | (1 << ACPI_LPS0_EXIT))
710+
#defineACPI_LPS0_SCREEN_MASK((1 << ACPI_LPS0_SCREEN_OFF) | (1 << ACPI_LPS0_SCREEN_ON))
711+
#defineACPI_LPS0_PLATFORM_MASK((1 << ACPI_LPS0_ENTRY) | (1 << ACPI_LPS0_EXIT))
701712

702713
staticacpi_handlelps0_device_handle;
703714
staticguid_tlps0_dsm_guid;
@@ -900,7 +911,8 @@ static int lps0_device_attach(struct acpi_device *adev,
900911
if (out_obj&&out_obj->type==ACPI_TYPE_BUFFER) {
901912
charbitmask=*(char*)out_obj->buffer.pointer;
902913

903-
if ((bitmask&ACPI_S2IDLE_FUNC_MASK)==ACPI_S2IDLE_FUNC_MASK) {
914+
if ((bitmask&ACPI_LPS0_PLATFORM_MASK)==ACPI_LPS0_PLATFORM_MASK||
915+
(bitmask&ACPI_LPS0_SCREEN_MASK)==ACPI_LPS0_SCREEN_MASK) {
904916
lps0_dsm_func_mask=bitmask;
905917
lps0_device_handle=adev->handle;
906918
/*

‎drivers/platform/x86/surfacepro3_button.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static void surface_button_notify(struct acpi_device *device, u32 event)
119119
if (key_code==KEY_RESERVED)
120120
return;
121121
if (pressed)
122-
pm_wakeup_event(&device->dev,0);
122+
pm_wakeup_dev_event(&device->dev,0,button->suspended);
123123
if (button->suspended)
124124
return;
125125
input_report_key(input,key_code,pressed?1:0);
@@ -185,6 +185,8 @@ static int surface_button_add(struct acpi_device *device)
185185
error=input_register_device(input);
186186
if (error)
187187
gotoerr_free_input;
188+
189+
device_init_wakeup(&device->dev, true);
188190
dev_info(&device->dev,
189191
"%s [%s]\n",name,acpi_device_bid(device));
190192
return0;

‎drivers/scsi/scsi_transport_spi.c‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include<linux/mutex.h>
2727
#include<linux/sysfs.h>
2828
#include<linux/slab.h>
29+
#include<linux/suspend.h>
2930
#include<scsi/scsi.h>
3031
#include"scsi_priv.h"
3132
#include<scsi/scsi_device.h>
@@ -1009,11 +1010,20 @@ spi_dv_device(struct scsi_device *sdev)
10091010
u8*buffer;
10101011
constintlen=SPI_MAX_ECHO_BUFFER_SIZE*2;
10111012

1013+
/*
1014+
* Because this function and the power management code both call
1015+
* scsi_device_quiesce(), it is not safe to perform domain validation
1016+
* while suspend or resume is in progress. Hence the
1017+
* lock/unlock_system_sleep() calls.
1018+
*/
1019+
lock_system_sleep();
1020+
10121021
if (unlikely(spi_dv_in_progress(starget)))
1013-
return;
1022+
gotounlock;
10141023

10151024
if (unlikely(scsi_device_get(sdev)))
1016-
return;
1025+
gotounlock;
1026+
10171027
spi_dv_in_progress(starget)=1;
10181028

10191029
buffer=kzalloc(len,GFP_KERNEL);
@@ -1049,6 +1059,8 @@ spi_dv_device(struct scsi_device *sdev)
10491059
out_put:
10501060
spi_dv_in_progress(starget)=0;
10511061
scsi_device_put(sdev);
1062+
unlock:
1063+
unlock_system_sleep();
10521064
}
10531065
EXPORT_SYMBOL(spi_dv_device);
10541066

‎include/linux/acpi.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ void __init acpi_no_s4_hw_signature(void);
451451
void__initacpi_old_suspend_ordering(void);
452452
void__initacpi_nvs_nosave(void);
453453
void__initacpi_nvs_nosave_s3(void);
454+
void__initacpi_sleep_no_blacklist(void);
454455
#endif/* CONFIG_PM_SLEEP */
455456

456457
structacpi_osc_context {

‎include/linux/suspend.h‎

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -443,32 +443,8 @@ extern bool pm_save_wakeup_count(unsigned int count);
443443
externvoidpm_wakep_autosleep_enabled(boolset);
444444
externvoidpm_print_active_wakeup_sources(void);
445445

446-
staticinlinevoidlock_system_sleep(void)
447-
{
448-
current->flags |=PF_FREEZER_SKIP;
449-
mutex_lock(&pm_mutex);
450-
}
451-
452-
staticinlinevoidunlock_system_sleep(void)
453-
{
454-
/*
455-
* Don't use freezer_count() because we don't want the call to
456-
* try_to_freeze() here.
457-
*
458-
* Reason:
459-
* Fundamentally, we just don't need it, because freezing condition
460-
* doesn't come into effect until we release the pm_mutex lock,
461-
* since the freezer always works with pm_mutex held.
462-
*
463-
* More importantly, in the case of hibernation,
464-
* unlock_system_sleep() gets called in snapshot_read() and
465-
* snapshot_write() when the freezing condition is still in effect.
466-
* Which means, if we use try_to_freeze() here, it would make them
467-
* enter the refrigerator, thus causing hibernation to lockup.
468-
*/
469-
current->flags &= ~PF_FREEZER_SKIP;
470-
mutex_unlock(&pm_mutex);
471-
}
446+
externvoidlock_system_sleep(void);
447+
externvoidunlock_system_sleep(void);
472448

473449
#else/* !CONFIG_PM_SLEEP */
474450

‎kernel/power/main.c‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,35 @@ DEFINE_MUTEX(pm_mutex);
2222

2323
#ifdefCONFIG_PM_SLEEP
2424

25+
voidlock_system_sleep(void)
26+
{
27+
current->flags |=PF_FREEZER_SKIP;
28+
mutex_lock(&pm_mutex);
29+
}
30+
EXPORT_SYMBOL_GPL(lock_system_sleep);
31+
32+
voidunlock_system_sleep(void)
33+
{
34+
/*
35+
* Don't use freezer_count() because we don't want the call to
36+
* try_to_freeze() here.
37+
*
38+
* Reason:
39+
* Fundamentally, we just don't need it, because freezing condition
40+
* doesn't come into effect until we release the pm_mutex lock,
41+
* since the freezer always works with pm_mutex held.
42+
*
43+
* More importantly, in the case of hibernation,
44+
* unlock_system_sleep() gets called in snapshot_read() and
45+
* snapshot_write() when the freezing condition is still in effect.
46+
* Which means, if we use try_to_freeze() here, it would make them
47+
* enter the refrigerator, thus causing hibernation to lockup.
48+
*/
49+
current->flags &= ~PF_FREEZER_SKIP;
50+
mutex_unlock(&pm_mutex);
51+
}
52+
EXPORT_SYMBOL_GPL(unlock_system_sleep);
53+
2554
/* Routines for PM-transition notifications */
2655

2756
staticBLOCKING_NOTIFIER_HEAD(pm_chain_head);

‎kernel/power/snapshot.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,8 +1645,7 @@ static unsigned long free_unnecessary_pages(void)
16451645
* [number of saveable pages] - [number of pages that can be freed in theory]
16461646
*
16471647
* where the second term is the sum of (1) reclaimable slab pages, (2) active
1648-
* and (3) inactive anonymous pages, (4) active and (5) inactive file pages,
1649-
* minus mapped file pages.
1648+
* and (3) inactive anonymous pages, (4) active and (5) inactive file pages.
16501649
*/
16511650
staticunsigned longminimum_image_size(unsigned longsaveable)
16521651
{
@@ -1656,8 +1655,7 @@ static unsigned long minimum_image_size(unsigned long saveable)
16561655
+global_node_page_state(NR_ACTIVE_ANON)
16571656
+global_node_page_state(NR_INACTIVE_ANON)
16581657
+global_node_page_state(NR_ACTIVE_FILE)
1659-
+global_node_page_state(NR_INACTIVE_FILE)
1660-
-global_node_page_state(NR_FILE_MAPPED);
1658+
+global_node_page_state(NR_INACTIVE_FILE);
16611659

16621660
returnsaveable <=size ?0 :saveable-size;
16631661
}

‎kernel/power/swap.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ static int save_image_lzo(struct swap_map_handle *handle,
879879
*space avaiable from the resume partition.
880880
*/
881881

882-
staticintenough_swap(unsignedintnr_pages,unsignedintflags)
882+
staticintenough_swap(unsignedintnr_pages)
883883
{
884884
unsignedintfree_swap=count_swap_pages(root_swap,1);
885885
unsignedintrequired;
@@ -915,7 +915,7 @@ int swsusp_write(unsigned int flags)
915915
returnerror;
916916
}
917917
if (flags&SF_NOCOMPRESS_MODE) {
918-
if (!enough_swap(pages,flags)) {
918+
if (!enough_swap(pages)) {
919919
pr_err("Not enough free swap\n");
920920
error=-ENOSPC;
921921
gotoout_finish;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp