linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linuxppc-dev@ozlabs.org, Torrance <torrance123@gmail.com>,
	Michael Buesch <mb@bu3sch.de>,
	linux-pm@lists.osdl.org
Subject: Re: [linux-pm] [RFC 3/3] suspend to disk on powermac G5
Date: Tue, 12 Dec 2006 13:20:24 +0000	[thread overview]
Message-ID: <20061212132023.GD5190@ucw.cz> (raw)
In-Reply-To: <20061211230754.979775000@sipsolutions.net>

Hi!

> This patch implements a very hacky suspend to disk for powermac G5 machines. I
> know it's broken in many places.
> 
> Built and tested against the tree after commit
> 620034c84d1d939717bdfbe02c51a3fee43541c3.
> 
> For some reason usb doesn't survive suspend even if I try to restore
> interrupts now... I use this script:
...
> Oh and did I say this is hacky? MMIO save/restore, the need to hook many
> places, no proper MPIC suspend/resume functionality, snd-aoa doesn't work
> after resume (it plays but no sound comes out, interrupts are coming in
> though... go figure, eh wait, since I wrote it I guess I'll check it too).

Does aoa module load/unload help? Does making it build-in help? Also
try playing with aumix after resume.

> I also ifdef'ed out
> 
> 	set_context(current->active_mm->context.id, current->active_mm->pgd);
> 
> because I didn't know what it is doing and it works without :)
> 
> I've suspended and resumed a few times in a row with this now, with and
> without longer breaks with the machine up and with the machine off.
> 
> Ah who am I kidding... This is pretty much guaranteed to break. Parts of the
> assembly code are quite old (written like half a year ago) so I don't
> remember some things... Why, for example, the save area has holes. I shall
> fix these some time I guess.
> 


> +	/* phew. suckers. this 16MB area is left unmapped
> +	 * at another place but they don't bother to mark it so */
> +	for (i = 0; i < (1<<24); i+= PAGE_SIZE)
> +		SetPageNosave(virt_to_page((void*)((unsigned long)dart_tablebase + i)));
> +

Can you move that marking where it belongs?

> +	if (dart_tablebase == 0 || dart_tablesize == 0)
> +		return;
> +
> +	p = alloc_pages(GFP_KERNEL, 9);
> +	BUG_ON(!p);
> +	dart_copy = page_address(p);
> +}

Not sure how likely is 2MB allocation to succeed. You may need to
prealocate it... And you definitely will need to handle error here.


> --- linux-2.6-git.orig/kernel/power/snapshot.c	2006-12-11 23:34:46.718716759 +0100
> +++ linux-2.6-git/kernel/power/snapshot.c	2006-12-11 23:38:00.152716759 +0100
> @@ -707,6 +707,8 @@ static struct page *saveable_page(unsign
>  		return NULL;
>  	if (PageNosaveFree(page))
>  		return NULL;
> +	if (!page_is_ram(pfn))
> +		return NULL;
>  
>  	return page;
>  }

Could this get some testing in -mm?

Overall, it looks pretty much okay. Thanks...

							Pavel
-- 
Thanks for all the (sleeping) penguins.

  reply	other threads:[~2006-12-12 13:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 23:02 [RFC 0/3] experimental G5 powermac suspend implementation Johannes Berg
2006-12-11 23:02 ` [RFC 1/3] support powermac G5 CPU hotplug Johannes Berg
2006-12-12 13:09   ` [linux-pm] " Pavel Machek
2006-12-12 13:18     ` Johannes Berg
2006-12-12 13:47       ` Johannes Berg
2006-12-13 13:20     ` Johannes Berg
2006-12-11 23:02 ` [RFC 2/3] windfarm: dont die on suspend thread signal Johannes Berg
2006-12-12 13:10   ` [linux-pm] " Pavel Machek
2007-01-24  6:32   ` Benjamin Herrenschmidt
2006-12-11 23:02 ` [RFC 3/3] suspend to disk on powermac G5 Johannes Berg
2006-12-12 13:20   ` Pavel Machek [this message]
2006-12-12 13:33     ` [linux-pm] " Johannes Berg
2006-12-12 12:21 ` [RFC 0/3] experimental G5 powermac suspend implementation Johannes Berg
2006-12-12 13:22   ` [linux-pm] " Pavel Machek
2006-12-12 13:36     ` Johannes Berg
2006-12-12 14:07       ` Johannes Berg
2006-12-12 17:34         ` Gabriel Paubert
2006-12-13 12:37           ` Johannes Berg

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=20061212132023.GD5190@ucw.cz \
    --to=pavel@suse.cz \
    --cc=johannes@sipsolutions.net \
    --cc=linux-pm@lists.osdl.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mb@bu3sch.de \
    --cc=torrance123@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).