From: Pavel Machek <pavel@ucw.cz>
To: hugang@soulinfo.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATH] swsusp update 3/3
Date: Tue, 23 Nov 2004 23:29:08 +0100 [thread overview]
Message-ID: <20041123222908.GK25926@elf.ucw.cz> (raw)
In-Reply-To: <20041122165858.GC10609@hugang.soulinfo.com>
Hi!
Can you start pushing this through maintainers?
LINUX FOR POWERPC
P: Paul Mackerras
M: paulus@samba.org
W: http://www.penguinppc.org/
L: linuxppc-dev@lists.linuxppc.org
S: Supported
LINUX FOR POWER MACINTOSH
P: Benjamin Herrenschmidt
M: benh@kernel.crashing.org
W: http://www.penguinppc.org/
L: linuxppc-dev@lists.linuxppc.org
S: Maintained
> --- linux-2.6.9-ppc-g4-peval/arch/ppc/Kconfig 2004-10-20 15:58:39.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/arch/ppc/Kconfig 2004-11-22 17:16:58.000000000 +0800
> @@ -983,6 +983,8 @@
>
> source "drivers/zorro/Kconfig"
>
> +source kernel/power/Kconfig
> +
> endmenu
>
> menu "Bus options"
> --- linux-2.6.9-ppc-g4-peval/arch/ppc/kernel/Makefile 2004-10-20 15:58:40.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/arch/ppc/kernel/Makefile 2004-11-22 17:16:58.000000000 +0800
> @@ -16,6 +16,7 @@
> semaphore.o syscalls.o setup.o \
> cputable.o ppc_htab.o
> obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
> +obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
> obj-$(CONFIG_POWER4) += cpu_setup_power4.o
> obj-$(CONFIG_MODULES) += module.o ppc_ksyms.o
> obj-$(CONFIG_NOT_COHERENT_CACHE) += dma-mapping.o
Ok. Or perhaps you want Kconfig part to go in last...
> --- /dev/null 2004-06-07 18:45:47.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/arch/ppc/kernel/swsusp.S 1904-01-01 08:47:25.000000000 +0706
...
> + mfibatu r4,3
> + stw r4,SL_IBAT3(r11)
> + mfibatl r4,3
> + stw r4,SL_IBAT3+4(r11)
> +
> +#if 0
> + /* Backup various CPU config stuffs */
> + bl __save_cpu_setup
> +#endif
> + /* Call the low level suspend stuff (we should probably have made
> + * a stackframe...
> + */
> + bl swsusp_save
I can't really check ppc assembly, but you probably want to kill that
#if 0s.
> --- linux-2.6.9-ppc-g4-peval/arch/ppc/kernel/signal.c 2004-10-20 15:58:41.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/arch/ppc/kernel/signal.c 2004-11-22 17:16:58.000000000 +0800
> @@ -28,6 +28,7 @@
> #include <linux/elf.h>
> #include <linux/tty.h>
> #include <linux/binfmts.h>
> +#include <linux/suspend.h>
> #include <asm/ucontext.h>
> #include <asm/uaccess.h>
> #include <asm/pgtable.h>
> @@ -604,6 +605,14 @@
> unsigned long frame, newsp;
> int signr, ret;
>
> + if (current->flags & PF_FREEZE) {
> + refrigerator(PF_FREEZE);
> + signr = 0;
> + ret = regs->gpr[3];
> + if (!signal_pending(current))
> + goto no_signal;
> + }
> +
> if (!oldset)
> oldset = ¤t->blocked;
>
> @@ -626,6 +635,7 @@
> regs->gpr[3] = EINTR;
> /* note that the cr0.SO bit is already set */
> } else {
> +no_signal:
> regs->nip -= 4; /* Back up & retry system call */
> regs->result = 0;
> regs->trap = 0;
Ok.
> --- linux-2.6.9-ppc-g4-peval/arch/ppc/kernel/vmlinux.lds.S 2004-10-20 15:58:41.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/arch/ppc/kernel/vmlinux.lds.S 2004-11-22 17:16:58.000000000 +0800
> @@ -74,6 +74,12 @@
> CONSTRUCTORS
> }
>
> + . = ALIGN(4096);
> + __nosave_begin = .;
> + .data_nosave : { *(.data.nosave) }
> + . = ALIGN(4096);
> + __nosave_end = .;
> +
> . = ALIGN(32);
> .data.cacheline_aligned : { *(.data.cacheline_aligned) }
>
Ok.
> --- linux-2.6.9-ppc-g4-peval/arch/ppc/syslib/open_pic.c 2004-10-20 15:58:42.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/arch/ppc/syslib/open_pic.c 2004-11-22 17:16:58.000000000 +0800
> @@ -776,7 +776,8 @@
> if (ISR[irq] == 0)
> return;
> if (!cpus_empty(keepmask)) {
> - cpumask_t irqdest = { .bits[0] = openpic_read(&ISR[irq]->Destination) };
> + cpumask_t irqdest;
> + irqdest.bits[0] = openpic_read(&ISR[irq]->Destination);
> cpus_and(irqdest, irqdest, keepmask);
> cpus_or(physmask, physmask, irqdest);
> }
Why this?
> --- linux-2.6.9-ppc-g4-peval/drivers/ide/ppc/pmac.c 2004-10-20 15:59:12.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/drivers/ide/ppc/pmac.c 2004-11-22 17:16:58.000000000 +0800
> @@ -32,6 +32,7 @@
> #include <linux/notifier.h>
> #include <linux/reboot.h>
> #include <linux/pci.h>
> +#include <linux/pm.h>
> #include <linux/adb.h>
> #include <linux/pmu.h>
>
> @@ -1364,7 +1365,7 @@
> ide_hwif_t *hwif = (ide_hwif_t *)dev_get_drvdata(&mdev->ofdev.dev);
> int rc = 0;
>
> - if (state != mdev->ofdev.dev.power_state && state >= 2) {
> + if (state != mdev->ofdev.dev.power_state && state == PM_SUSPEND_MEM) {
> rc = pmac_ide_do_suspend(hwif);
> if (rc == 0)
> mdev->ofdev.dev.power_state = state;
> @@ -1472,7 +1473,7 @@
> ide_hwif_t *hwif = (ide_hwif_t *)pci_get_drvdata(pdev);
> int rc = 0;
>
> - if (state != pdev->dev.power_state && state >= 2) {
> + if (state != pdev->dev.power_state && state == PM_SUSPEND_MEM ) {
> rc = pmac_ide_do_suspend(hwif);
> if (rc == 0)
> pdev->dev.power_state = state;
Don't do this just yet. Big changes in this area are pending.
> --- linux-2.6.9-ppc-g4-peval/drivers/macintosh/mediabay.c 2004-10-20 15:53:32.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/drivers/macintosh/mediabay.c 2004-11-22 17:16:58.000000000 +0800
> @@ -713,7 +713,7 @@
> {
> struct media_bay_info *bay = macio_get_drvdata(mdev);
>
> - if (state != mdev->ofdev.dev.power_state && state >= 2) {
> + if (state != mdev->ofdev.dev.power_state && state == PM_SUSPEND_MEM) {
> down(&bay->lock);
> bay->sleeping = 1;
> set_mb_power(bay, 0);
Wait with this one, too.
> --- linux-2.6.9-ppc-g4-peval/drivers/macintosh/therm_adt746x.c 2004-10-20 15:59:24.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/drivers/macintosh/therm_adt746x.c 2004-11-22 17:16:58.000000000 +0800
> @@ -22,6 +22,7 @@
> #include <linux/spinlock.h>
> #include <linux/smp_lock.h>
> #include <linux/wait.h>
> +#include <linux/suspend.h>
> #include <asm/prom.h>
> #include <asm/machdep.h>
> #include <asm/io.h>
> @@ -238,6 +239,11 @@
> #endif
> while(!kthread_should_stop())
> {
> + if (current->flags & PF_FREEZE) {
> + printk(KERN_INFO "therm_adt746x: freezing thermostat\n");
> + refrigerator(PF_FREEZE);
> + }
> +
> msleep_interruptible(2000);
>
> /* Check status */
You probably want to avoid that printk. (And similar for
therm_pm72). Otherwise good.
> --- linux-2.6.9-ppc-g4-peval/drivers/macintosh/via-pmu.c 2004-10-20 15:59:24.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/drivers/macintosh/via-pmu.c 2004-11-22 17:16:58.000000000 +0800
> @@ -43,6 +43,7 @@
> #include <linux/init.h>
> #include <linux/interrupt.h>
> #include <linux/device.h>
> +#include <linux/sysdev.h>
> #include <linux/suspend.h>
> #include <linux/syscalls.h>
> #include <asm/prom.h>
> @@ -2326,7 +2327,7 @@
> /* Sync the disks. */
> /* XXX It would be nice to have some way to ensure that
> * nobody is dirtying any new buffers while we wait. That
> - * could be acheived using the refrigerator for processes
> + * could be achieved using the refrigerator for processes
> * that swsusp uses
> */
> sys_sync();
> @@ -2379,7 +2380,6 @@
>
> /* Wait for completion of async backlight requests */
> while (!bright_req_1.complete || !bright_req_2.complete ||
> -
> !batt_req.complete)
> pmu_poll();
>
Ok.
> --- linux-2.6.9-ppc-g4-peval/drivers/video/aty/radeon_pm.c 2004-10-20 15:55:34.000000000 +0800
> +++ linux-2.6.9-ppc-g4-peval-hg/drivers/video/aty/radeon_pm.c 2004-11-22 17:16:58.000000000 +0800
> @@ -859,6 +859,10 @@
> * know we'll be rebooted, ...
> */
>
> +#if 0 /* this breaks suspend to ram until the dust settles... */
> + if (state != PM_SUSPEND_MEM)
> +#endif
> + return 0;
> printk(KERN_DEBUG "radeonfb: suspending to state: %d...\n", state);
>
> acquire_console_sem();
Wait with this one. (And notice that this is not ppc-specific and
could do some damage...)
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
next prev parent reply other threads:[~2004-11-23 22:33 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-19 19:40 [PATCH] Software Suspend split to two stage V2 hugang
2004-11-20 0:15 ` Pavel Machek
2004-11-20 0:30 ` swsusp bigdiff [was Re: [PATCH] Software Suspend split to two stage V2.] Pavel Machek
2004-11-20 3:03 ` hugang
2004-11-20 10:15 ` Pavel Machek
2004-11-20 8:12 ` hugang
2004-11-20 21:22 ` Pavel Machek
2004-11-20 21:41 ` Pavel Machek
2004-11-20 22:35 ` Pavel Machek
2004-11-20 22:49 ` Pavel Machek
2004-11-21 7:48 ` hugang
2004-11-22 7:22 ` hugang
2004-11-22 10:26 ` Pavel Machek
2004-11-22 10:32 ` hugang
2004-11-22 11:02 ` Pavel Machek
2004-11-22 11:54 ` Rafael J. Wysocki
2004-11-22 21:50 ` Nigel Cunningham
2004-11-23 21:54 ` Pavel Machek
2004-11-23 21:57 ` Nigel Cunningham
2004-11-24 8:03 ` [PATH] 11-24 swsusp update 2/3 hugang
2004-11-24 8:04 ` [PATH] 11-24 swsusp update 3/3 hugang
2004-11-24 9:13 ` hugang
2004-11-24 14:05 ` Colin Leroy
2004-11-22 16:58 ` [PATH] swsusp update 1/3 hugang
2004-11-23 22:14 ` Pavel Machek
2004-11-24 8:02 ` [PATH] 11-24 " hugang
2004-11-24 10:56 ` Pavel Machek
2004-11-24 11:28 ` [PATH] " Pavel Machek
2004-11-24 18:30 ` hugang
2004-12-20 21:45 ` Nishanth Aravamudan
2004-12-20 22:41 ` Pavel Machek
2004-11-22 16:58 ` [PATH] swsusp update 2/3 hugang
2004-11-23 22:23 ` Pavel Machek
2004-11-22 16:58 ` [PATH] swsusp update 3/3 hugang
2004-11-23 22:29 ` Pavel Machek [this message]
2004-11-24 10:21 ` Guido Guenther
2004-11-20 9:27 ` swsusp bigdiff [was Re: [PATCH] Software Suspend split to two stage V2.] hugang
2004-12-20 21:44 ` Nishanth Aravamudan
2004-12-20 22:40 ` Pavel Machek
2004-12-20 23:06 ` Zwane Mwaikambo
2004-12-20 23:28 ` Nigel Cunningham
2004-12-22 20:28 ` Pavel Machek
2004-12-22 21:21 ` Nigel Cunningham
2004-12-22 21:32 ` Pavel Machek
2004-12-23 0:52 ` Nigel Cunningham
2004-12-21 13:15 ` Paulo Marques
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20041123222908.GK25926@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=hugang@soulinfo.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®