Re: swsusp2 on ppc [Re: Software Suspend 2.0]

Hugang
2004-02-03T01:40:39Z

[-- Attachment #1: Type: text/plain, Size: 1324 bytes --]

On Mon, 2 Feb 2004 18:01:25 +0100
Marco Giordani <marco@bononia.it> wrote:

> On Sun, Feb 01, 2004 at 03:08:27PM +0800, Hugang wrote:
> > Here is the ppc swsusp2 update patch for 2.6.1 + rc6 + 2.0, please
> > apply.
>
> It doesn't work for me. During "write cache" phase, at 75% of the
> progress bar, my powerbook powers off the LCD backlight and it seems
> locked... at this point I can only power off the system... Any idea?
Show us the detail.

>
> BTW, I cannot compile your patch with highmem support. It will be very
> useful for me...
Attached file is fix highmem problem, I'm can't sure that not mistake,
can some ppc guys with double check.:) But you can try.

>
> I've also tried the benh's pmdisk patch and it works fine but it lacks
> highmem support too.

I have some advice:
1: Be sure before suspend have not unused device to used.
I'm make all the possible device into module, before suspend rmmod
it as possible, after it reload it.
2: You can enable swsusp2, that's useful debug.
before suspend do
echo 6 > /proc/swsusp/default_console_level
3: shared you kernel information.
dmesg >> /tmp/bug.log
cat /proc/swsusp/debug_info >> /tmp/bug.log
send /tmp/bug.log to LKML.
--
Hu Gang / Steve
Linux Registered User 204016
GPG Public Key: http://soulinfo.com/~hugang/HuGang.asc

[-- Attachment #2: highmem.h.patch --]
[-- Type: application/octet-stream, Size: 234 bytes --]

--- orig/include/asm-ppc/highmem.h
+++ mod/include/asm-ppc/highmem.h
@@ -30,6 +30,7 @@

/* undef for production */
#define HIGHMEM_DEBUG 1
+extern unsigned long highstart_pfn;

extern pte_t *kmap_pte;
extern pgprot_t kmap_prot;

[-- Attachment #3: init.c.patch --]
[-- Type: application/octet-stream, Size: 835 bytes --]

--- orig/arch/ppc/mm/init.c
+++ mod/arch/ppc/mm/init.c
@@ -388,6 +388,10 @@
free_area_init(zones_size);
}

+#ifdef CONFIG_HIGHMEM
+unsigned long highstart_pfn;
+#endif
+
void __init mem_init(void)
{
unsigned long addr;
@@ -395,10 +399,9 @@
int datapages = 0;
int initpages = 0;
#ifdef CONFIG_HIGHMEM
- unsigned long highmem_mapnr;

- highmem_mapnr = total_lowmem >> PAGE_SHIFT;
- highmem_start_page = mem_map + highmem_mapnr;
+ highstart_pfn = total_lowmem >> PAGE_SHIFT;
+ highmem_start_page = mem_map + highstart_pfn;
#endif /* CONFIG_HIGHMEM */
max_mapnr = total_memory >> PAGE_SHIFT;

@@ -451,7 +454,7 @@
{
unsigned long pfn;

- for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
+ for (pfn = highstart_pfn; pfn < max_mapnr; ++pfn) {
struct page *page = mem_map + pfn;

ClearPageReserved(page);