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
d16675e1
Commit
d16675e1
authored
Jan 12, 2011
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'suspend-ioremap-cache' into release
parents
fb4af417
6d5bbf00
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
43 additions
and
36 deletions
+43
-36
arch/ia64/include/asm/io.h
arch/ia64/include/asm/io.h
+5
-0
arch/x86/kernel/e820.c
arch/x86/kernel/e820.c
+1
-0
drivers/acpi/Makefile
drivers/acpi/Makefile
+1
-1
drivers/acpi/internal.h
drivers/acpi/internal.h
+8
-0
drivers/acpi/nvs.c
drivers/acpi/nvs.c
+14
-6
drivers/acpi/osl.c
drivers/acpi/osl.c
+3
-3
drivers/acpi/sleep.c
drivers/acpi/sleep.c
+2
-3
include/linux/acpi.h
include/linux/acpi.h
+9
-0
include/linux/suspend.h
include/linux/suspend.h
+0
-17
kernel/power/Kconfig
kernel/power/Kconfig
+0
-5
kernel/power/Makefile
kernel/power/Makefile
+0
-1
No files found.
arch/ia64/include/asm/io.h
View file @
d16675e1
...
...
@@ -426,6 +426,11 @@ extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size)
extern
void
iounmap
(
volatile
void
__iomem
*
addr
);
extern
void
__iomem
*
early_ioremap
(
unsigned
long
phys_addr
,
unsigned
long
size
);
extern
void
early_iounmap
(
volatile
void
__iomem
*
addr
,
unsigned
long
size
);
static
inline
void
__iomem
*
ioremap_cache
(
unsigned
long
phys_addr
,
unsigned
long
size
)
{
return
ioremap
(
phys_addr
,
size
);
}
/*
* String version of IO memory access ops:
...
...
arch/x86/kernel/e820.c
View file @
d16675e1
...
...
@@ -14,6 +14,7 @@
#include <linux/bootmem.h>
#include <linux/pfn.h>
#include <linux/suspend.h>
#include <linux/acpi.h>
#include <linux/firmware-map.h>
#include <linux/memblock.h>
...
...
drivers/acpi/Makefile
View file @
d16675e1
...
...
@@ -24,7 +24,7 @@ acpi-y += atomicio.o
# sleep related files
acpi-y
+=
wakeup.o
acpi-y
+=
sleep.o
acpi-$(CONFIG_ACPI_SLEEP)
+=
proc.o
acpi-$(CONFIG_ACPI_SLEEP)
+=
proc.o
nvs.o
#
...
...
drivers/acpi/internal.h
View file @
d16675e1
...
...
@@ -83,8 +83,16 @@ extern int acpi_sleep_init(void);
#ifdef CONFIG_ACPI_SLEEP
int
acpi_sleep_proc_init
(
void
);
int
suspend_nvs_alloc
(
void
);
void
suspend_nvs_free
(
void
);
int
suspend_nvs_save
(
void
);
void
suspend_nvs_restore
(
void
);
#else
static
inline
int
acpi_sleep_proc_init
(
void
)
{
return
0
;
}
static
inline
int
suspend_nvs_alloc
(
void
)
{
return
0
;
}
static
inline
void
suspend_nvs_free
(
void
)
{}
static
inline
int
suspend_nvs_save
(
void
)
{}
static
inline
void
suspend_nvs_restore
(
void
)
{}
#endif
#endif
/* _ACPI_INTERNAL_H_ */
kernel/power
/nvs.c
→
drivers/acpi
/nvs.c
View file @
d16675e1
/*
*
linux/kernel/power/hibernate_nvs.c - Routines for handling NVS memory
*
nvs.c - Routines for saving and restoring ACPI NVS memory region
*
* Copyright (C) 2008
,2009
Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
* Copyright (C) 2008
-2011
Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc.
*
* This file is released under the GPLv2.
*/
...
...
@@ -11,7 +11,8 @@
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/suspend.h>
#include <linux/acpi.h>
#include <acpi/acpiosxf.h>
/*
* Platforms, like ACPI, may want us to save some memory used by them during
...
...
@@ -79,7 +80,7 @@ void suspend_nvs_free(void)
free_page
((
unsigned
long
)
entry
->
data
);
entry
->
data
=
NULL
;
if
(
entry
->
kaddr
)
{
iounmap
(
entry
->
kaddr
);
acpi_os_unmap_memory
(
entry
->
kaddr
,
entry
->
size
);
entry
->
kaddr
=
NULL
;
}
}
...
...
@@ -105,7 +106,7 @@ int suspend_nvs_alloc(void)
/**
* suspend_nvs_save - save NVS memory regions
*/
void
suspend_nvs_save
(
void
)
int
suspend_nvs_save
(
void
)
{
struct
nvs_page
*
entry
;
...
...
@@ -113,9 +114,16 @@ void suspend_nvs_save(void)
list_for_each_entry
(
entry
,
&
nvs_list
,
node
)
if
(
entry
->
data
)
{
entry
->
kaddr
=
ioremap
(
entry
->
phys_start
,
entry
->
size
);
entry
->
kaddr
=
acpi_os_map_memory
(
entry
->
phys_start
,
entry
->
size
);
if
(
!
entry
->
kaddr
)
{
suspend_nvs_free
();
return
-
ENOMEM
;
}
memcpy
(
entry
->
data
,
entry
->
kaddr
,
entry
->
size
);
}
return
0
;
}
/**
...
...
drivers/acpi/osl.c
View file @
d16675e1
...
...
@@ -320,7 +320,7 @@ acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
pg_off
=
round_down
(
phys
,
PAGE_SIZE
);
pg_sz
=
round_up
(
phys
+
size
,
PAGE_SIZE
)
-
pg_off
;
virt
=
ioremap
(
pg_off
,
pg_sz
);
virt
=
ioremap
_cache
(
pg_off
,
pg_sz
);
if
(
!
virt
)
{
kfree
(
map
);
return
NULL
;
...
...
@@ -642,7 +642,7 @@ acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width)
virt_addr
=
acpi_map_vaddr_lookup
(
phys_addr
,
size
);
rcu_read_unlock
();
if
(
!
virt_addr
)
{
virt_addr
=
ioremap
(
phys_addr
,
size
);
virt_addr
=
ioremap
_cache
(
phys_addr
,
size
);
unmap
=
1
;
}
if
(
!
value
)
...
...
@@ -678,7 +678,7 @@ acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width)
virt_addr
=
acpi_map_vaddr_lookup
(
phys_addr
,
size
);
rcu_read_unlock
();
if
(
!
virt_addr
)
{
virt_addr
=
ioremap
(
phys_addr
,
size
);
virt_addr
=
ioremap
_cache
(
phys_addr
,
size
);
unmap
=
1
;
}
...
...
drivers/acpi/sleep.c
View file @
d16675e1
...
...
@@ -124,8 +124,7 @@ static int acpi_pm_freeze(void)
static
int
acpi_pm_pre_suspend
(
void
)
{
acpi_pm_freeze
();
suspend_nvs_save
();
return
0
;
return
suspend_nvs_save
();
}
/**
...
...
@@ -151,7 +150,7 @@ static int acpi_pm_prepare(void)
{
int
error
=
__acpi_pm_prepare
();
if
(
!
error
)
acpi_pm_pre_suspend
();
error
=
acpi_pm_pre_suspend
();
return
error
;
}
...
...
include/linux/acpi.h
View file @
d16675e1
...
...
@@ -254,6 +254,15 @@ void __init acpi_old_suspend_ordering(void);
void
__init
acpi_nvs_nosave
(
void
);
#endif
/* CONFIG_PM_SLEEP */
#ifdef CONFIG_ACPI_SLEEP
int
suspend_nvs_register
(
unsigned
long
start
,
unsigned
long
size
);
#else
static
inline
int
suspend_nvs_register
(
unsigned
long
a
,
unsigned
long
b
)
{
return
0
;
}
#endif
struct
acpi_osc_context
{
char
*
uuid_str
;
/* uuid string */
int
rev
;
...
...
include/linux/suspend.h
View file @
d16675e1
...
...
@@ -258,23 +258,6 @@ static inline int hibernate(void) { return -ENOSYS; }
static
inline
bool
system_entering_hibernation
(
void
)
{
return
false
;
}
#endif
/* CONFIG_HIBERNATION */
#ifdef CONFIG_SUSPEND_NVS
extern
int
suspend_nvs_register
(
unsigned
long
start
,
unsigned
long
size
);
extern
int
suspend_nvs_alloc
(
void
);
extern
void
suspend_nvs_free
(
void
);
extern
void
suspend_nvs_save
(
void
);
extern
void
suspend_nvs_restore
(
void
);
#else
/* CONFIG_SUSPEND_NVS */
static
inline
int
suspend_nvs_register
(
unsigned
long
a
,
unsigned
long
b
)
{
return
0
;
}
static
inline
int
suspend_nvs_alloc
(
void
)
{
return
0
;
}
static
inline
void
suspend_nvs_free
(
void
)
{}
static
inline
void
suspend_nvs_save
(
void
)
{}
static
inline
void
suspend_nvs_restore
(
void
)
{}
#endif
/* CONFIG_SUSPEND_NVS */
#ifdef CONFIG_PM_SLEEP
void
save_processor_state
(
void
);
void
restore_processor_state
(
void
);
...
...
kernel/power/Kconfig
View file @
d16675e1
...
...
@@ -100,13 +100,9 @@ config PM_SLEEP_ADVANCED_DEBUG
depends on PM_ADVANCED_DEBUG
default n
config SUSPEND_NVS
bool
config SUSPEND
bool "Suspend to RAM and standby"
depends on PM && ARCH_SUSPEND_POSSIBLE
select SUSPEND_NVS if HAS_IOMEM
default y
---help---
Allow the system to enter sleep states in which main memory is
...
...
@@ -140,7 +136,6 @@ config HIBERNATION
depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
select LZO_COMPRESS
select LZO_DECOMPRESS
select SUSPEND_NVS if HAS_IOMEM
---help---
Enable the suspend to disk (STD) functionality, which is usually
called "hibernation" in user interfaces. STD checkpoints the
...
...
kernel/power/Makefile
View file @
d16675e1
...
...
@@ -10,6 +10,5 @@ obj-$(CONFIG_SUSPEND) += suspend.o
obj-$(CONFIG_PM_TEST_SUSPEND)
+=
suspend_test.o
obj-$(CONFIG_HIBERNATION)
+=
hibernate.o snapshot.o swap.o user.o
\
block_io.o
obj-$(CONFIG_SUSPEND_NVS)
+=
nvs.o
obj-$(CONFIG_MAGIC_SYSRQ)
+=
poweroff.o
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