[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: Arm linux software suspend
From:       junjie cai <junjiec () gmail ! com>
Date:       2005-08-09 3:06:21
Message-ID: ca992f110508082006654cf7e () mail ! gmail ! com
[Download RAW message or body]

sorry for not reading your patches carefully,
i think you have done that.
please just ignore my last message.

but could you please provide more details about the oops?
for example where this oops came from ,etc.

thanks.

On 8/9/05, junjie cai <junjiec@gmail.com> wrote:
> hello,
> i think you have to save & restore pagetable pointer in
> save_processor_state & restore_processor_state respectively.
> the context is different between suspend & resume.
> 
> below is our local patch to software suspend.
> could you please give it a try?
> 
> diff -uNr -x CVS alp-linux.org/arch/arm/power/cpu.c
> alp-linux/arch/arm/power/cpu.c
> --- alp-linux.org/arch/arm/power/cpu.c  1970-01-01 09:00:00.000000000 +0900
> +++ alp-linux/arch/arm/power/cpu.c      2005-04-27 14:24:41.000000000 +0900
> @@ -0,0 +1,53 @@
> +/*
> + * base on arch/i386/power/cpu.c
> + * junjie.cai@jp.sony.com
> + */
> +
> +#include <linux/config.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/types.h>
> +#include <linux/spinlock.h>
> +#include <linux/poll.h>
> +#include <linux/delay.h>
> +#include <linux/sysrq.h>
> +#include <linux/proc_fs.h>
> +#include <linux/pm.h>
> +#include <linux/device.h>
> +#include <linux/suspend.h>
> +#include <asm/suspend.h>
> +
> +static struct saved_context saved_context;
> +
> +unsigned long saved_context_sp;
> +
> +void save_processor_state(void)
> +{
> +       pr_debug("<");
> +       asm volatile ("mrc p15, 0, %0, c3, c0, 0": "=r"(saved_context.domain_id));
> +       asm volatile ("mrc p15, 0, %0, c2, c0, 0": "=r"(saved_context.pgd));
> +       asm volatile ("mrc p15, 0, %0, c13, c0, 0": "=r"(saved_context.pid));
> +       asm volatile ("mrc p15, 0, %0, c1, c0, 0": "=r"(saved_context.ctrl));
> +
> +       asm volatile ("mrs %0, CPSR": "=r"(saved_context.cpsr));
> +       asm volatile ("mrs %0, SPSR": "=r"(saved_context.spsr));
> +       pr_debug("%x>\n",saved_context.pgd);
> +}
> +
> +void restore_processor_state(void)
> +{
> +       pr_debug("<:%x",saved_context.pgd);
> +       asm volatile ("mcr p15, 0, %0, c3, c0, 0": : "r"(saved_context.domain_id));
> +       asm volatile ("mcr p15, 0, %0, c2, c0, 0": : "r"(saved_context.pgd));
> +       asm volatile ("mcr p15, 0, %0, c13, c0, 0": : "r"(saved_context.pid));
> +       asm volatile ("mcr p15, 0, %0, c1, c0, 0": : "r"(saved_context.ctrl));
> +
> +       asm volatile ("msr CPSR_cxsf, %0": : "r"(saved_context.cpsr));
> +       asm volatile ("msr SPSR_cxsf, %0": : "r"(saved_context.spsr));
> +       pr_debug(">\n");
> +}
> +
> +/* Needed by apm.c */
> +EXPORT_SYMBOL(save_processor_state);
> +EXPORT_SYMBOL(restore_processor_state);
> 
> On 8/9/05, Hiroki Kaminaga <kaminaga@sm.sony.co.jp> wrote:
> > From: Paul Schulz <pschulz01@gmail.com>
> > Subject: Re: Arm linux software suspend
> > Date: Mon, 8 Aug 2005 23:19:59 +0930
> >
> > > Hi Abhijit,
> > >
> > > I have a similar issue, on a PXA255. I would like
> > > to suspend to NAND flash. The reason?
> > >
> > > The device is to be part of a machine, and
> > > as well as the restore-from-disk (hopefully) being
> > > faster that a cold-start, all settings and
> > > configurations will be (trivially) maintained
> > > between 'sessions.
> > >
> > > (There is also going to be a power fail detect to
> > > trigger the suspend-to-disk.)
> > >
> > > So, I'm keen to hear how you get on.
> >
> >
> > Hi.
> >
> > I've posted software suspend (hibernate) to flash patch for ARM at:
> >
> > http://lists.osdl.org/pipermail/linux-pm/2005-July/001077.html
> >
> > It is still omap_osk5912 specific, and some more work is needed.
> > Perpaps we can work togather for enhancement?!
> >
> > In my target (2.6.11 + patch), I did hibernate while running
> > `find /usr/include', and in next bootup, it did resume find command.
> >
> > However, when hibernated while running mplayer, I have kernel panic
> > on wakeup. The reason is (I guess) due to different page table before
> > and after software suspend.
> >
> > Currently, I'm trying to turn off MMU to solve problem.
> >
> >
> > HK.
> > --
> >
> > -------------------------------------------------------------------
> > List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
> > FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
> > Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
> >
>

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic