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
0528415e
Commit
0528415e
authored
Sep 03, 2003
by
Patrick Mochel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[power] Whitespace fixes.
From the -test4-mm5 tree.
parent
d168c5dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
28 deletions
+28
-28
kernel/power/disk.c
kernel/power/disk.c
+17
-17
kernel/power/swsusp.c
kernel/power/swsusp.c
+11
-11
No files found.
kernel/power/disk.c
View file @
0528415e
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
*
*
* Copyright (c) 2003 Patrick Mochel
* Copyright (c) 2003 Patrick Mochel
* Copyright (c) 2003 Open Source Development Lab
* Copyright (c) 2003 Open Source Development Lab
*
*
* This file is release under the GPLv2
* This file is release under the GPLv2
*
*
*/
*/
...
@@ -36,7 +36,7 @@ extern long sys_sync(void);
...
@@ -36,7 +36,7 @@ extern long sys_sync(void);
* @mode: Suspend-to-disk mode
* @mode: Suspend-to-disk mode
*
*
* Use the platform driver, if configured so, and return gracefully if it
* Use the platform driver, if configured so, and return gracefully if it
* fails.
* fails.
* Otherwise, try to power off and reboot. If they fail, halt the machine,
* Otherwise, try to power off and reboot. If they fail, halt the machine,
* there ain't no turning back.
* there ain't no turning back.
*/
*/
...
@@ -75,7 +75,7 @@ static int in_suspend __nosavedata = 0;
...
@@ -75,7 +75,7 @@ static int in_suspend __nosavedata = 0;
*
*
* ... but do not OOM-kill anyone
* ... but do not OOM-kill anyone
*
*
* Notice: all userland should be stopped at this point, or
* Notice: all userland should be stopped at this point, or
* livelock is possible.
* livelock is possible.
*/
*/
...
@@ -143,7 +143,7 @@ static int prepare(void)
...
@@ -143,7 +143,7 @@ static int prepare(void)
/**
/**
* pm_suspend_disk - The granpappy of power management.
* pm_suspend_disk - The granpappy of power management.
*
*
* If we're going through the firmware, then get it over with quickly.
* If we're going through the firmware, then get it over with quickly.
*
*
* If not, then call swsusp to do it's thing, then figure out how
* If not, then call swsusp to do it's thing, then figure out how
...
@@ -169,8 +169,8 @@ int pm_suspend_disk(void)
...
@@ -169,8 +169,8 @@ int pm_suspend_disk(void)
pr_debug
(
"PM: writing image.
\n
"
);
pr_debug
(
"PM: writing image.
\n
"
);
/*
/*
* FIXME: Leftover from swsusp. Are they necessary?
* FIXME: Leftover from swsusp. Are they necessary?
*/
*/
mb
();
mb
();
barrier
();
barrier
();
...
@@ -192,11 +192,11 @@ int pm_suspend_disk(void)
...
@@ -192,11 +192,11 @@ int pm_suspend_disk(void)
/**
/**
* pm_resume - Resume from a saved image.
* pm_resume - Resume from a saved image.
*
*
* Called as a late_initcall (so all devices are discovered and
* Called as a late_initcall (so all devices are discovered and
* initialized), we call swsusp to see if we have a saved image or not.
* initialized), we call swsusp to see if we have a saved image or not.
* If so, we quiesce devices, the restore the saved image. We will
* If so, we quiesce devices, the restore the saved image. We will
* return above (in pm_suspend_disk() ) if everything goes well.
* return above (in pm_suspend_disk() ) if everything goes well.
* Otherwise, we fail gracefully and return to the normally
* Otherwise, we fail gracefully and return to the normally
* scheduled program.
* scheduled program.
*
*
*/
*/
...
@@ -219,8 +219,8 @@ static int pm_resume(void)
...
@@ -219,8 +219,8 @@ static int pm_resume(void)
mb
();
mb
();
local_irq_disable
();
local_irq_disable
();
/* FIXME: The following (comment and mdelay()) are from swsusp.
/* FIXME: The following (comment and mdelay()) are from swsusp.
* Are they really necessary?
* Are they really necessary?
*
*
* We do not want some readahead with DMA to corrupt our memory, right?
* We do not want some readahead with DMA to corrupt our memory, right?
* Do it with disabled interrupts for best effect. That way, if some
* Do it with disabled interrupts for best effect. That way, if some
...
@@ -254,19 +254,19 @@ static char * pm_disk_modes[] = {
...
@@ -254,19 +254,19 @@ static char * pm_disk_modes[] = {
/**
/**
* disk - Control suspend-to-disk mode
* disk - Control suspend-to-disk mode
*
*
* Suspend-to-disk can be handled in several ways. The greatest
* Suspend-to-disk can be handled in several ways. The greatest
* distinction is who writes memory to disk - the firmware or the OS.
* distinction is who writes memory to disk - the firmware or the OS.
* If the firmware does it, we assume that it also handles suspending
* If the firmware does it, we assume that it also handles suspending
* the system.
* the system.
* If the OS does it, then we have three options for putting the system
* If the OS does it, then we have three options for putting the system
* to sleep - using the platform driver (e.g. ACPI or other PM registers),
* to sleep - using the platform driver (e.g. ACPI or other PM registers),
* powering off the system or rebooting the system (for testing).
* powering off the system or rebooting the system (for testing).
*
*
* The system will support either 'firmware' or 'platform', and that is
* The system will support either 'firmware' or 'platform', and that is
* known a priori (and encoded in pm_ops). But, the user may choose
* known a priori (and encoded in pm_ops). But, the user may choose
* 'shutdown' or 'reboot' as alternatives.
* 'shutdown' or 'reboot' as alternatives.
*
*
* show() will display what the mode is currently set to.
* show() will display what the mode is currently set to.
* store() will accept one of
* store() will accept one of
*
*
* 'firmware'
* 'firmware'
...
@@ -301,7 +301,7 @@ static ssize_t disk_store(struct subsystem * s, const char * buf, size_t n)
...
@@ -301,7 +301,7 @@ static ssize_t disk_store(struct subsystem * s, const char * buf, size_t n)
if
(
mode
==
PM_DISK_SHUTDOWN
||
mode
==
PM_DISK_REBOOT
)
if
(
mode
==
PM_DISK_SHUTDOWN
||
mode
==
PM_DISK_REBOOT
)
pm_disk_mode
=
mode
;
pm_disk_mode
=
mode
;
else
{
else
{
if
(
pm_ops
&&
pm_ops
->
enter
&&
if
(
pm_ops
&&
pm_ops
->
enter
&&
(
mode
==
pm_ops
->
pm_disk_mode
))
(
mode
==
pm_ops
->
pm_disk_mode
))
pm_disk_mode
=
mode
;
pm_disk_mode
=
mode
;
else
else
...
...
kernel/power/swsusp.c
View file @
0528415e
...
@@ -472,7 +472,7 @@ static int suspend_prepare_image(void)
...
@@ -472,7 +472,7 @@ static int suspend_prepare_image(void)
/**
/**
* suspend_save_image - Prepare and write saved image to swap.
* suspend_save_image - Prepare and write saved image to swap.
*
*
* IRQs are re-enabled here so we can resume devices and safely write
* IRQs are re-enabled here so we can resume devices and safely write
* to the swap devices. We disable them again before we leave.
* to the swap devices. We disable them again before we leave.
*
*
* The second lock_swapdevices() will unlock ignored swap devices since
* The second lock_swapdevices() will unlock ignored swap devices since
...
@@ -509,7 +509,7 @@ int swsusp_resume(void)
...
@@ -509,7 +509,7 @@ int swsusp_resume(void)
return
0
;
return
0
;
}
}
/* swsusp_arch_suspend() is implemented in arch/?/power/swsusp.S,
/* swsusp_arch_suspend() is implemented in arch/?/power/swsusp.S,
and basically does:
and basically does:
if (!resume) {
if (!resume) {
...
@@ -535,7 +535,7 @@ int swsusp_suspend(void)
...
@@ -535,7 +535,7 @@ int swsusp_suspend(void)
if
(
!
error
)
if
(
!
error
)
error
=
suspend_save_image
();
error
=
suspend_save_image
();
if
(
error
)
{
if
(
error
)
{
printk
(
KERN_EMERG
"%sSuspend failed, trying to recover...
\n
"
,
printk
(
KERN_EMERG
"%sSuspend failed, trying to recover...
\n
"
,
name_suspend
);
name_suspend
);
barrier
();
barrier
();
mb
();
mb
();
...
@@ -677,10 +677,10 @@ static struct block_device * resume_bdev;
...
@@ -677,10 +677,10 @@ static struct block_device * resume_bdev;
/**
/**
* Using bio to read from swap.
* Using bio to read from swap.
* This code requires a bit more work than just using buffer heads
* This code requires a bit more work than just using buffer heads
* but, it is the recommended way for 2.5/2.6.
* but, it is the recommended way for 2.5/2.6.
* The following are to signal the beginning and end of I/O. Bios
* The following are to signal the beginning and end of I/O. Bios
* finish asynchronously, while we want them to happen synchronously.
* finish asynchronously, while we want them to happen synchronously.
* A simple atomic_t, and a wait loop take care of this problem.
* A simple atomic_t, and a wait loop take care of this problem.
*/
*/
...
@@ -713,8 +713,8 @@ static void wait_io(void)
...
@@ -713,8 +713,8 @@ static void wait_io(void)
* @page: page we're reading or writing.
* @page: page we're reading or writing.
*
*
* Straight from the textbook - allocate and initialize the bio.
* Straight from the textbook - allocate and initialize the bio.
* If we're writing, make sure the page is marked as dirty.
* If we're writing, make sure the page is marked as dirty.
* Then submit it and wait.
* Then submit it and wait.
*/
*/
static
int
submit
(
int
rw
,
pgoff_t
page_off
,
void
*
page
)
static
int
submit
(
int
rw
,
pgoff_t
page_off
,
void
*
page
)
...
@@ -778,8 +778,8 @@ static int __init read_suspend_image(void)
...
@@ -778,8 +778,8 @@ static int __init read_suspend_image(void)
if
((
error
=
read_page
(
0
,
cur
)))
if
((
error
=
read_page
(
0
,
cur
)))
goto
Done
;
goto
Done
;
/*
/*
* We have to read next position before we overwrite it
* We have to read next position before we overwrite it
*/
*/
next
=
next_entry
(
cur
);
next
=
next_entry
(
cur
);
...
@@ -883,7 +883,7 @@ int swsusp_save(void)
...
@@ -883,7 +883,7 @@ int swsusp_save(void)
*
*
* swsusp_arch_suspend(0) returns after system is resumed.
* swsusp_arch_suspend(0) returns after system is resumed.
*
*
* swsusp_arch_suspend() copies all "used" memory to "free" memory,
* swsusp_arch_suspend() copies all "used" memory to "free" memory,
* then unsuspends all device drivers, and writes memory to disk
* then unsuspends all device drivers, and writes memory to disk
* using normal kernel mechanism.
* using normal kernel mechanism.
*/
*/
...
...
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