Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242207
b: refs/heads/master
c: d4cc183
h: refs/heads/master
i:
  242205: ec98c6b
  242203: 578203e
  242199: 3876aa0
  242191: 3053d78
  242175: 039da57
v: v3
  • Loading branch information
Paul Mundt committed Mar 23, 2011
1 parent f5eaa2f commit 3fb2956
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a696b89c582e3201ef10bfb0d0b3594e29b75e0f
refs/heads/master: d4cc183f7b9f639a048291e9cd95f0c255664b98
43 changes: 14 additions & 29 deletions trunk/arch/sh/mm/pmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Privileged Space Mapping Buffer (PMB) Support.
*
* Copyright (C) 2005 - 2010 Paul Mundt
* Copyright (C) 2005 - 2011 Paul Mundt
* Copyright (C) 2010 Matt Fleming
*
* This file is subject to the terms and conditions of the GNU General Public
Expand All @@ -12,7 +12,7 @@
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sysdev.h>
#include <linux/syscore_ops.h>
#include <linux/cpu.h>
#include <linux/module.h>
#include <linux/bitops.h>
Expand Down Expand Up @@ -874,46 +874,31 @@ static int __init pmb_debugfs_init(void)
subsys_initcall(pmb_debugfs_init);

#ifdef CONFIG_PM
static int pmb_sysdev_suspend(struct sys_device *dev, pm_message_t state)
static void pmb_syscore_resume(void)
{
static pm_message_t prev_state;
struct pmb_entry *pmbe;
int i;

/* Restore the PMB after a resume from hibernation */
if (state.event == PM_EVENT_ON &&
prev_state.event == PM_EVENT_FREEZE) {
struct pmb_entry *pmbe;

read_lock(&pmb_rwlock);
read_lock(&pmb_rwlock);

for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
if (test_bit(i, pmb_map)) {
pmbe = &pmb_entry_list[i];
set_pmb_entry(pmbe);
}
for (i = 0; i < ARRAY_SIZE(pmb_entry_list); i++) {
if (test_bit(i, pmb_map)) {
pmbe = &pmb_entry_list[i];
set_pmb_entry(pmbe);
}

read_unlock(&pmb_rwlock);
}

prev_state = state;

return 0;
}

static int pmb_sysdev_resume(struct sys_device *dev)
{
return pmb_sysdev_suspend(dev, PMSG_ON);
read_unlock(&pmb_rwlock);
}

static struct sysdev_driver pmb_sysdev_driver = {
.suspend = pmb_sysdev_suspend,
.resume = pmb_sysdev_resume,
static struct syscore_ops pmb_syscore_ops = {
.resume = pmb_syscore_resume,
};

static int __init pmb_sysdev_init(void)
{
return sysdev_driver_register(&cpu_sysdev_class, &pmb_sysdev_driver);
register_syscore_ops(&pmb_syscore_ops);
return 0;
}
subsys_initcall(pmb_sysdev_init);
#endif

0 comments on commit 3fb2956

Please sign in to comment.