Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
e5c86131
Commit
e5c86131
authored
Sep 15, 2009
by
Stephen Rothwell
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'suspend/linux-next'
parents
e15e3b5e
33f82d14
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
456 additions
and
207 deletions
+456
-207
drivers/base/power/main.c
drivers/base/power/main.c
+85
-86
drivers/block/floppy.c
drivers/block/floppy.c
+7
-2
drivers/dma/at_hdmac.c
drivers/dma/at_hdmac.c
+12
-7
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/hp-wmi.c
+10
-5
include/linux/pm.h
include/linux/pm.h
+14
-0
kernel/power/hibernate.c
kernel/power/hibernate.c
+14
-7
kernel/power/power.h
kernel/power/power.h
+1
-1
kernel/power/snapshot.c
kernel/power/snapshot.c
+313
-99
No files found.
drivers/base/power/main.c
View file @
e5c86131
This diff is collapsed.
Click to expand it.
drivers/block/floppy.c
View file @
e5c86131
...
@@ -4151,7 +4151,7 @@ static void floppy_device_release(struct device *dev)
...
@@ -4151,7 +4151,7 @@ static void floppy_device_release(struct device *dev)
{
{
}
}
static
int
floppy_resume
(
struct
platform_
device
*
dev
)
static
int
floppy_resume
(
struct
device
*
dev
)
{
{
int
fdc
;
int
fdc
;
...
@@ -4162,10 +4162,15 @@ static int floppy_resume(struct platform_device *dev)
...
@@ -4162,10 +4162,15 @@ static int floppy_resume(struct platform_device *dev)
return
0
;
return
0
;
}
}
static
struct
platform_driver
floppy_driver
=
{
static
struct
dev_pm_ops
floppy_pm_ops
=
{
.
resume
=
floppy_resume
,
.
resume
=
floppy_resume
,
.
restore
=
floppy_resume
,
};
static
struct
platform_driver
floppy_driver
=
{
.
driver
=
{
.
driver
=
{
.
name
=
"floppy"
,
.
name
=
"floppy"
,
.
pm
=
&
floppy_pm_ops
,
},
},
};
};
...
...
drivers/dma/at_hdmac.c
View file @
e5c86131
...
@@ -1168,32 +1168,37 @@ static void at_dma_shutdown(struct platform_device *pdev)
...
@@ -1168,32 +1168,37 @@ static void at_dma_shutdown(struct platform_device *pdev)
clk_disable
(
atdma
->
clk
);
clk_disable
(
atdma
->
clk
);
}
}
static
int
at_dma_suspend_
late
(
struct
platform_device
*
pdev
,
pm_message_t
mesg
)
static
int
at_dma_suspend_
noirq
(
struct
device
*
dev
)
{
{
struct
at_dma
*
atdma
=
platform_get_drvdata
(
pdev
);
struct
platform_device
*
pdev
=
to_platform_device
(
dev
);
struct
at_dma
*
atdma
=
platform_get_drvdata
(
pdev
);
at_dma_off
(
platform_get_drvdata
(
pdev
));
at_dma_off
(
platform_get_drvdata
(
pdev
));
clk_disable
(
atdma
->
clk
);
clk_disable
(
atdma
->
clk
);
return
0
;
return
0
;
}
}
static
int
at_dma_resume_
early
(
struct
platform_device
*
p
dev
)
static
int
at_dma_resume_
noirq
(
struct
device
*
dev
)
{
{
struct
at_dma
*
atdma
=
platform_get_drvdata
(
pdev
);
struct
platform_device
*
pdev
=
to_platform_device
(
dev
);
struct
at_dma
*
atdma
=
platform_get_drvdata
(
pdev
);
clk_enable
(
atdma
->
clk
);
clk_enable
(
atdma
->
clk
);
dma_writel
(
atdma
,
EN
,
AT_DMA_ENABLE
);
dma_writel
(
atdma
,
EN
,
AT_DMA_ENABLE
);
return
0
;
return
0
;
}
}
static
struct
dev_pm_ops
at_dma_dev_pm_ops
=
{
.
suspend_noirq
=
at_dma_suspend_noirq
,
.
resume_noirq
=
at_dma_resume_noirq
,
};
static
struct
platform_driver
at_dma_driver
=
{
static
struct
platform_driver
at_dma_driver
=
{
.
remove
=
__exit_p
(
at_dma_remove
),
.
remove
=
__exit_p
(
at_dma_remove
),
.
shutdown
=
at_dma_shutdown
,
.
shutdown
=
at_dma_shutdown
,
.
suspend_late
=
at_dma_suspend_late
,
.
resume_early
=
at_dma_resume_early
,
.
driver
=
{
.
driver
=
{
.
name
=
"at_hdmac"
,
.
name
=
"at_hdmac"
,
.
pm
=
&
at_dma_dev_pm_ops
,
},
},
};
};
...
...
drivers/platform/x86/hp-wmi.c
View file @
e5c86131
...
@@ -53,7 +53,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
...
@@ -53,7 +53,7 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
static
int
__init
hp_wmi_bios_setup
(
struct
platform_device
*
device
);
static
int
__init
hp_wmi_bios_setup
(
struct
platform_device
*
device
);
static
int
__exit
hp_wmi_bios_remove
(
struct
platform_device
*
device
);
static
int
__exit
hp_wmi_bios_remove
(
struct
platform_device
*
device
);
static
int
hp_wmi_resume_handler
(
struct
platform_
device
*
device
);
static
int
hp_wmi_resume_handler
(
struct
device
*
device
);
struct
bios_args
{
struct
bios_args
{
u32
signature
;
u32
signature
;
...
@@ -94,14 +94,19 @@ static struct rfkill *wifi_rfkill;
...
@@ -94,14 +94,19 @@ static struct rfkill *wifi_rfkill;
static
struct
rfkill
*
bluetooth_rfkill
;
static
struct
rfkill
*
bluetooth_rfkill
;
static
struct
rfkill
*
wwan_rfkill
;
static
struct
rfkill
*
wwan_rfkill
;
static
struct
dev_pm_ops
hp_wmi_pm_ops
=
{
.
resume
=
hp_wmi_resume_handler
,
.
restore
=
hp_wmi_resume_handler
,
};
static
struct
platform_driver
hp_wmi_driver
=
{
static
struct
platform_driver
hp_wmi_driver
=
{
.
driver
=
{
.
driver
=
{
.
name
=
"hp-wmi"
,
.
name
=
"hp-wmi"
,
.
owner
=
THIS_MODULE
,
.
owner
=
THIS_MODULE
,
.
pm
=
&
hp_wmi_pm_ops
,
},
},
.
probe
=
hp_wmi_bios_setup
,
.
probe
=
hp_wmi_bios_setup
,
.
remove
=
hp_wmi_bios_remove
,
.
remove
=
hp_wmi_bios_remove
,
.
resume
=
hp_wmi_resume_handler
,
};
};
static
int
hp_wmi_perform_query
(
int
query
,
int
write
,
int
value
)
static
int
hp_wmi_perform_query
(
int
query
,
int
write
,
int
value
)
...
@@ -512,7 +517,7 @@ static int __exit hp_wmi_bios_remove(struct platform_device *device)
...
@@ -512,7 +517,7 @@ static int __exit hp_wmi_bios_remove(struct platform_device *device)
return
0
;
return
0
;
}
}
static
int
hp_wmi_resume_handler
(
struct
platform_
device
*
device
)
static
int
hp_wmi_resume_handler
(
struct
device
*
device
)
{
{
/*
/*
* Hardware state may have changed while suspended, so trigger
* Hardware state may have changed while suspended, so trigger
...
...
include/linux/pm.h
View file @
e5c86131
...
@@ -213,6 +213,20 @@ struct dev_pm_ops {
...
@@ -213,6 +213,20 @@ struct dev_pm_ops {
int
(
*
runtime_idle
)(
struct
device
*
dev
);
int
(
*
runtime_idle
)(
struct
device
*
dev
);
};
};
/*
* Use this if you want to use the same suspend and resume callbacks for suspend
* to RAM and hibernation.
*/
#define SIMPLE_DEV_PM_OPS(name, suspend_fn, resume_fn) \
struct dev_pm_ops name = { \
.suspend = suspend_fn, \
.resume = resume_fn, \
.freeze = suspend_fn, \
.thaw = resume_fn, \
.poweroff = suspend_fn, \
.restore = resume_fn, \
}
/**
/**
* PM_EVENT_ messages
* PM_EVENT_ messages
*
*
...
...
kernel/power/hibernate.c
View file @
e5c86131
...
@@ -298,8 +298,8 @@ int hibernation_snapshot(int platform_mode)
...
@@ -298,8 +298,8 @@ int hibernation_snapshot(int platform_mode)
if
(
error
)
if
(
error
)
return
error
;
return
error
;
/*
Fre
e memory before shutting down devices. */
/*
Preallocate imag
e memory before shutting down devices. */
error
=
swsusp_shrink
_memory
();
error
=
hibernate_preallocate
_memory
();
if
(
error
)
if
(
error
)
goto
Close
;
goto
Close
;
...
@@ -315,6 +315,10 @@ int hibernation_snapshot(int platform_mode)
...
@@ -315,6 +315,10 @@ int hibernation_snapshot(int platform_mode)
/* Control returns here after successful restore */
/* Control returns here after successful restore */
Resume_devices:
Resume_devices:
/* We may need to release the preallocated image pages here. */
if
(
error
||
!
in_suspend
)
swsusp_free
();
dpm_resume_end
(
in_suspend
?
dpm_resume_end
(
in_suspend
?
(
error
?
PMSG_RECOVER
:
PMSG_THAW
)
:
PMSG_RESTORE
);
(
error
?
PMSG_RECOVER
:
PMSG_THAW
)
:
PMSG_RESTORE
);
resume_console
();
resume_console
();
...
@@ -460,11 +464,11 @@ int hibernation_platform_enter(void)
...
@@ -460,11 +464,11 @@ int hibernation_platform_enter(void)
error
=
hibernation_ops
->
prepare
();
error
=
hibernation_ops
->
prepare
();
if
(
error
)
if
(
error
)
goto
Plat
of
rm_finish
;
goto
Plat
fo
rm_finish
;
error
=
disable_nonboot_cpus
();
error
=
disable_nonboot_cpus
();
if
(
error
)
if
(
error
)
goto
Plat
of
rm_finish
;
goto
Plat
fo
rm_finish
;
local_irq_disable
();
local_irq_disable
();
sysdev_suspend
(
PMSG_HIBERNATE
);
sysdev_suspend
(
PMSG_HIBERNATE
);
...
@@ -476,7 +480,7 @@ int hibernation_platform_enter(void)
...
@@ -476,7 +480,7 @@ int hibernation_platform_enter(void)
* We don't need to reenable the nonboot CPUs or resume consoles, since
* We don't need to reenable the nonboot CPUs or resume consoles, since
* the system is going to be halted anyway.
* the system is going to be halted anyway.
*/
*/
Plat
of
rm_finish:
Plat
fo
rm_finish:
hibernation_ops
->
finish
();
hibernation_ops
->
finish
();
dpm_suspend_noirq
(
PMSG_RESTORE
);
dpm_suspend_noirq
(
PMSG_RESTORE
);
...
@@ -578,7 +582,10 @@ int hibernate(void)
...
@@ -578,7 +582,10 @@ int hibernate(void)
goto
Thaw
;
goto
Thaw
;
error
=
hibernation_snapshot
(
hibernation_mode
==
HIBERNATION_PLATFORM
);
error
=
hibernation_snapshot
(
hibernation_mode
==
HIBERNATION_PLATFORM
);
if
(
in_suspend
&&
!
error
)
{
if
(
error
)
goto
Thaw
;
if
(
in_suspend
)
{
unsigned
int
flags
=
0
;
unsigned
int
flags
=
0
;
if
(
hibernation_mode
==
HIBERNATION_PLATFORM
)
if
(
hibernation_mode
==
HIBERNATION_PLATFORM
)
...
@@ -590,8 +597,8 @@ int hibernate(void)
...
@@ -590,8 +597,8 @@ int hibernate(void)
power_down
();
power_down
();
}
else
{
}
else
{
pr_debug
(
"PM: Image restored successfully.
\n
"
);
pr_debug
(
"PM: Image restored successfully.
\n
"
);
swsusp_free
();
}
}
Thaw:
Thaw:
thaw_processes
();
thaw_processes
();
Finish:
Finish:
...
...
kernel/power/power.h
View file @
e5c86131
...
@@ -74,7 +74,7 @@ extern asmlinkage int swsusp_arch_resume(void);
...
@@ -74,7 +74,7 @@ extern asmlinkage int swsusp_arch_resume(void);
extern
int
create_basic_memory_bitmaps
(
void
);
extern
int
create_basic_memory_bitmaps
(
void
);
extern
void
free_basic_memory_bitmaps
(
void
);
extern
void
free_basic_memory_bitmaps
(
void
);
extern
int
swsusp_shrink
_memory
(
void
);
extern
int
hibernate_preallocate
_memory
(
void
);
/**
/**
* Auxiliary structure used for reading the snapshot image data and
* Auxiliary structure used for reading the snapshot image data and
...
...
kernel/power/snapshot.c
View file @
e5c86131
This diff is collapsed.
Click to expand it.
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