Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a5e22db2
Commit
a5e22db2
authored
Oct 12, 2015
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge back earlier 'pm-sleep' material for v4.4.
parents
2cef548a
7236214c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
3 deletions
+47
-3
Documentation/ABI/testing/sysfs-power
Documentation/ABI/testing/sysfs-power
+12
-0
drivers/base/power/wakeup.c
drivers/base/power/wakeup.c
+14
-2
include/linux/suspend.h
include/linux/suspend.h
+3
-0
kernel/irq/pm.c
kernel/irq/pm.c
+1
-1
kernel/power/main.c
kernel/power/main.c
+17
-0
No files found.
Documentation/ABI/testing/sysfs-power
View file @
a5e22db2
...
...
@@ -256,3 +256,15 @@ Description:
Writing a "1" enables this printing while writing a "0"
disables it. The default value is "0". Reading from this file
will display the current value.
What: /sys/power/pm_wakeup_irq
Date: April 2015
Contact: Alexandra Yates <alexandra.yates@linux.intel.org>
Description:
The /sys/power/pm_wakeup_irq file reports to user space the IRQ
number of the first wakeup interrupt (that is, the first
interrupt from an IRQ line armed for system wakeup) seen by the
kernel during the most recent system suspend/resume cycle.
This output is useful for system wakeup diagnostics of spurious
wakeup interrupts.
drivers/base/power/wakeup.c
View file @
a5e22db2
...
...
@@ -25,6 +25,9 @@
*/
bool
events_check_enabled
__read_mostly
;
/* First wakeup IRQ seen by the kernel in the last cycle. */
unsigned
int
pm_wakeup_irq
__read_mostly
;
/* If set and the system is suspending, terminate the suspend. */
static
bool
pm_abort_suspend
__read_mostly
;
...
...
@@ -91,7 +94,7 @@ struct wakeup_source *wakeup_source_create(const char *name)
if
(
!
ws
)
return
NULL
;
wakeup_source_prepare
(
ws
,
name
?
kstrdup
(
name
,
GFP_KERNEL
)
:
NULL
);
wakeup_source_prepare
(
ws
,
name
?
kstrdup
_const
(
name
,
GFP_KERNEL
)
:
NULL
);
return
ws
;
}
EXPORT_SYMBOL_GPL
(
wakeup_source_create
);
...
...
@@ -154,7 +157,7 @@ void wakeup_source_destroy(struct wakeup_source *ws)
wakeup_source_drop
(
ws
);
wakeup_source_record
(
ws
);
kfree
(
ws
->
name
);
kfree
_const
(
ws
->
name
);
kfree
(
ws
);
}
EXPORT_SYMBOL_GPL
(
wakeup_source_destroy
);
...
...
@@ -868,6 +871,15 @@ EXPORT_SYMBOL_GPL(pm_system_wakeup);
void
pm_wakeup_clear
(
void
)
{
pm_abort_suspend
=
false
;
pm_wakeup_irq
=
0
;
}
void
pm_system_irq_wakeup
(
unsigned
int
irq_number
)
{
if
(
pm_wakeup_irq
==
0
)
{
pm_wakeup_irq
=
irq_number
;
pm_system_wakeup
();
}
}
/**
...
...
include/linux/suspend.h
View file @
a5e22db2
...
...
@@ -387,10 +387,12 @@ extern int unregister_pm_notifier(struct notifier_block *nb);
/* drivers/base/power/wakeup.c */
extern
bool
events_check_enabled
;
extern
unsigned
int
pm_wakeup_irq
;
extern
bool
pm_wakeup_pending
(
void
);
extern
void
pm_system_wakeup
(
void
);
extern
void
pm_wakeup_clear
(
void
);
extern
void
pm_system_irq_wakeup
(
unsigned
int
irq_number
);
extern
bool
pm_get_wakeup_count
(
unsigned
int
*
count
,
bool
block
);
extern
bool
pm_save_wakeup_count
(
unsigned
int
count
);
extern
void
pm_wakep_autosleep_enabled
(
bool
set
);
...
...
@@ -440,6 +442,7 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)
static
inline
bool
pm_wakeup_pending
(
void
)
{
return
false
;
}
static
inline
void
pm_system_wakeup
(
void
)
{}
static
inline
void
pm_wakeup_clear
(
void
)
{}
static
inline
void
pm_system_irq_wakeup
(
unsigned
int
irq_number
)
{}
static
inline
void
lock_system_sleep
(
void
)
{}
static
inline
void
unlock_system_sleep
(
void
)
{}
...
...
kernel/irq/pm.c
View file @
a5e22db2
...
...
@@ -21,7 +21,7 @@ bool irq_pm_check_wakeup(struct irq_desc *desc)
desc
->
istate
|=
IRQS_SUSPENDED
|
IRQS_PENDING
;
desc
->
depth
++
;
irq_disable
(
desc
);
pm_system_
wakeup
(
);
pm_system_
irq_wakeup
(
irq_desc_get_irq
(
desc
)
);
return
true
;
}
return
false
;
...
...
kernel/power/main.c
View file @
a5e22db2
...
...
@@ -272,6 +272,22 @@ static inline void pm_print_times_init(void)
{
pm_print_times_enabled
=
!!
initcall_debug
;
}
static
ssize_t
pm_wakeup_irq_show
(
struct
kobject
*
kobj
,
struct
kobj_attribute
*
attr
,
char
*
buf
)
{
return
pm_wakeup_irq
?
sprintf
(
buf
,
"%u
\n
"
,
pm_wakeup_irq
)
:
-
ENODATA
;
}
static
ssize_t
pm_wakeup_irq_store
(
struct
kobject
*
kobj
,
struct
kobj_attribute
*
attr
,
const
char
*
buf
,
size_t
n
)
{
return
-
EINVAL
;
}
power_attr
(
pm_wakeup_irq
);
#else
/* !CONFIG_PM_SLEEP_DEBUG */
static
inline
void
pm_print_times_init
(
void
)
{}
#endif
/* CONFIG_PM_SLEEP_DEBUG */
...
...
@@ -604,6 +620,7 @@ static struct attribute * g[] = {
#endif
#ifdef CONFIG_PM_SLEEP_DEBUG
&
pm_print_times_attr
.
attr
,
&
pm_wakeup_irq_attr
.
attr
,
#endif
#endif
#ifdef CONFIG_FREEZER
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment