public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fs corruption with swsusp in test4-mm6 ?
@ 2003-09-06  9:29 Mathieu LESNIAK
  2003-09-06 21:22 ` Pavel Machek
  2003-09-08 19:41 ` Patrick Mochel
  0 siblings, 2 replies; 7+ messages in thread
From: Mathieu LESNIAK @ 2003-09-06  9:29 UTC (permalink / raw)
  To: linux-kernel, mochel, pavel

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

Hi,

I've tested the latest -mm6 kernel on a Compaq Presario 2157EA laptop 
(Celeron Mobile 2GHz)
Everything worked fine until I tested suspend to disk. After resuming, 
I've got random messages about reiserfs problem on the console :

vs-4080: reiserfs_free_block: free_block (hda2:95121)[dev:blocknr]: bit 
already cleared
Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: 
free_block (hda2:95122)[dev:blocknr]: bit already cleared
Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
of object [689 645 0x0 SD] (nlink == 1) not found (pos 25)
Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
of object [689 652 0x0 SD] (nlink == 1) not found (pos 25)

Please find in attachement 1 syslog showing the suspend / resume cycle 
and the fs errors.

Thanks,

Mathieu LESNIAK

[-- Attachment #2: syslog-fs_corruption --]
[-- Type: text/plain, Size: 25060 bytes --]



Sep  6 10:29:16 herrbach syslogd 1.4.1#11: restart.
Sep  6 10:29:16 herrbach kernel: klogd 1.4.1#11, log source = /proc/kmsg started.
Sep  6 10:29:16 herrbach kernel: Inspecting /boot/System.map-2.6.0-test4-mm6
Sep  6 10:29:17 herrbach kernel: Loaded 26011 symbols from /boot/System.map-2.6.0-test4-mm6.
Sep  6 10:29:17 herrbach kernel: Symbols match kernel version 2.6.0.
Sep  6 10:29:17 herrbach kernel: No module symbols loaded - kernel modules not enabled. 
Sep  6 10:29:17 herrbach kernel: Linux version 2.6.0-test4-mm6 (root@athlon) (version gcc 3.3.2 20030831 (Debian prerelease)) #3 Sat Sep 6 10:17:01 CEST 2003
Sep  6 10:29:17 herrbach kernel: Video mode to be used for restore is 317
Sep  6 10:29:17 herrbach kernel: BIOS-provided physical RAM map:
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 0000000000000000 - 000000000009f800 (usable)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 0000000000100000 - 000000000bf70000 (usable)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 000000000bf70000 - 000000000bf7f000 (ACPI data)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 000000000bf7f000 - 000000000bf80000 (ACPI NVS)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 000000000bf80000 - 000000000c000000 (reserved)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 000000001bf80000 - 000000001c000000 (reserved)
Sep  6 10:29:17 herrbach kernel:  BIOS-e820: 00000000fff80000 - 0000000100000000 (reserved)
Sep  6 10:29:17 herrbach kernel: 191MB LOWMEM available.
Sep  6 10:29:17 herrbach kernel: On node 0 totalpages: 49008
Sep  6 10:29:17 herrbach kernel:   DMA zone: 4096 pages, LIFO batch:1
Sep  6 10:29:17 herrbach kernel:   Normal zone: 44912 pages, LIFO batch:10
Sep  6 10:29:17 herrbach kernel:   HighMem zone: 0 pages, LIFO batch:1
Sep  6 10:29:17 herrbach kernel: DMI 2.3 present.
Sep  6 10:29:17 herrbach kernel: ACPI: RSDP (v000 PTLTD                                     ) @ 0x000f6c90
Sep  6 10:29:17 herrbach kernel: ACPI: RSDT (v001 PTLTD    RSDT   0x06040000  LTP 0x00000000) @ 0x0bf78eb1
Sep  6 10:29:17 herrbach kernel: ACPI: FADT (v001 ATI    Salmon   0x06040000 ATI  0x000f4240) @ 0x0bf7ef64
Sep  6 10:29:17 herrbach kernel: ACPI: BOOT (v001 PTLTD  $SBFTBL$ 0x06040000  LTP 0x00000001) @ 0x0bf7efd8
Sep  6 10:29:17 herrbach kernel: ACPI: DSDT (v001    ATI MS2_1535 0x06040000 MSFT 0x0100000e) @ 0x00000000
Sep  6 10:29:17 herrbach kernel: Building zonelist for node : 0
Sep  6 10:29:17 herrbach kernel: Kernel command line: BOOT_IMAGE=Linux ro root=302 hdc=ide-scsi
Sep  6 10:29:17 herrbach kernel: ide_setup: hdc=ide-scsi
Sep  6 10:29:17 herrbach kernel: current: c03ba9c0
Sep  6 10:29:17 herrbach kernel: current->thread_info: c0436000
Sep  6 10:29:17 herrbach kernel: Initializing CPU#0
Sep  6 10:29:17 herrbach kernel: PID hash table entries: 1024 (order 10: 8192 bytes)
Sep  6 10:29:17 herrbach kernel: Detected 1993.827 MHz processor.
Sep  6 10:29:17 herrbach kernel: Console: colour dummy device 80x25
Sep  6 10:29:17 herrbach kernel: Memory: 189768k/196032k available (2382k kernel code, 5616k reserved, 905k data, 152k init, 0k highmem)
Sep  6 10:29:17 herrbach kernel: zapping low mappings.
Sep  6 10:29:17 herrbach kernel: Calibrating delay loop... 3932.16 BogoMIPS
Sep  6 10:29:17 herrbach kernel: Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Sep  6 10:29:17 herrbach kernel: Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Sep  6 10:29:17 herrbach kernel: Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Sep  6 10:29:17 herrbach kernel: -> /dev
Sep  6 10:29:17 herrbach kernel: -> /dev/console
Sep  6 10:29:17 herrbach kernel: -> /root
Sep  6 10:29:17 herrbach kernel: CPU:     After generic identify, caps: bfebf9ff 00000000 00000000 00000000
Sep  6 10:29:17 herrbach kernel: CPU:     After vendor identify, caps: bfebf9ff 00000000 00000000 00000000
Sep  6 10:29:17 herrbach kernel: CPU: Trace cache: 12K uops, L1 D cache: 8K
Sep  6 10:29:17 herrbach kernel: CPU: L2 cache: 256K
Sep  6 10:29:17 herrbach kernel: CPU:     After all inits, caps: bfebf9ff 00000000 00000000 00000080
Sep  6 10:29:17 herrbach kernel: Intel machine check architecture supported.
Sep  6 10:29:17 herrbach kernel: Intel machine check reporting enabled on CPU#0.
Sep  6 10:29:17 herrbach kernel: CPU#0: Intel P4/Xeon Extended MCE MSRs (12) available
Sep  6 10:29:17 herrbach kernel: CPU: Intel Mobile Intel(R) Celeron(R) CPU 2.00GHz stepping 07
Sep  6 10:29:17 herrbach kernel: Enabling fast FPU save and restore... done.
Sep  6 10:29:17 herrbach kernel: Enabling unmasked SIMD FPU exception support... done.
Sep  6 10:29:17 herrbach kernel: Checking 'hlt' instruction... OK.
Sep  6 10:29:17 herrbach kernel: POSIX conformance testing by UNIFIX
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:legacy
Sep  6 10:29:17 herrbach kernel: Initializing RT netlink socket
Sep  6 10:29:17 herrbach kernel: PCI: PCI BIOS revision 2.10 entry at 0xfd89b, last bus=2
Sep  6 10:29:17 herrbach kernel: PCI: Using configuration type 1
Sep  6 10:29:17 herrbach kernel: mtrr: v2.0 (20020519)
Sep  6 10:29:17 herrbach kernel: ACPI: Subsystem revision 20030813
Sep  6 10:29:17 herrbach kernel: ACPI: Interpreter enabled
Sep  6 10:29:17 herrbach kernel: ACPI: Using PIC for interrupt routing
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Root Bridge [PCI0] (00:00)
Sep  6 10:29:17 herrbach kernel: PCI: Probing PCI hardware (bus 00)
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:pci0000:00
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:00.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:01.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:02.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:06.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:07.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:08.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:0a.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:10.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:11.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:00:12.0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pci:0000:01:05.0
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGPB._PRT]
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK0] (IRQs 7 10)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK1] (IRQs 7 *10)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK2] (IRQs 10)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK3] (IRQs 10)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK4] (IRQs 10)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK5] (IRQs 7 *11)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK6] (IRQs 10)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK7] (IRQs *5)
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK8] (IRQs *10)
Sep  6 10:29:17 herrbach kernel: ACPI: Embedded Controller [EC0] (gpe 24)
Sep  6 10:29:17 herrbach kernel: Linux Plug and Play Support v0.97 (c) Adam Belay
Sep  6 10:29:17 herrbach kernel: PnPBIOS: Scanning system for PnP BIOS support...
Sep  6 10:29:17 herrbach kernel: PnPBIOS: Found PnP BIOS installation structure at 0xc00f6cc0
Sep  6 10:29:17 herrbach kernel: PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0xaff0, dseg 0x400
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:pnp0
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:00
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:01
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:02
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:03
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:04
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:05
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:06
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:07
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:08
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:09
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:0a
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:0b
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:0c
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:0d
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:0f
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:10
Sep  6 10:29:17 herrbach kernel: PM: Adding info for pnp:00:13
Sep  6 10:29:17 herrbach kernel: PnPBIOS: 17 nodes reported by PnP BIOS; 17 recorded by driver
Sep  6 10:29:17 herrbach kernel: SCSI subsystem initialized
Sep  6 10:29:17 herrbach kernel: drivers/usb/core/usb.c: registered new driver usbfs
Sep  6 10:29:17 herrbach kernel: drivers/usb/core/usb.c: registered new driver hub
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK8] enabled at IRQ 10
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK7] enabled at IRQ 5
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK6] enabled at IRQ 10
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK5] enabled at IRQ 11
Sep  6 10:29:17 herrbach kernel: ACPI: No IRQ known for interrupt pin A of device 0000:00:10.0
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK1] enabled at IRQ 10
Sep  6 10:29:17 herrbach kernel: ACPI: PCI Interrupt Link [LNK0] enabled at IRQ 10
Sep  6 10:29:17 herrbach kernel: PCI: Using ACPI for IRQ routing
Sep  6 10:29:17 herrbach kernel: PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off'
Sep  6 10:29:17 herrbach kernel: vesafb: framebuffer at 0xd8000000, mapped to 0xcc80c000, size 16384k
Sep  6 10:29:17 herrbach kernel: vesafb: mode is 1024x768x16, linelength=2048, pages=41
Sep  6 10:29:17 herrbach kernel: vesafb: protected mode interface info at c000:51bf
Sep  6 10:29:17 herrbach kernel: vesafb: scrolling: redraw
Sep  6 10:29:17 herrbach kernel: vesafb: directcolor: size=0:5:6:5, shift=0:11:5:0
Sep  6 10:29:17 herrbach kernel: fb0: VESA VGA frame buffer device
Sep  6 10:29:17 herrbach kernel: Console: switching to colour frame buffer device 128x48
Sep  6 10:29:17 herrbach kernel: pty: 256 Unix98 ptys configured
Sep  6 10:29:17 herrbach kernel: SBF: Simple Boot Flag extension found and enabled.
Sep  6 10:29:17 herrbach kernel: SBF: Setting boot flags 0x1
Sep  6 10:29:17 herrbach kernel: Machine check exception polling timer started.
Sep  6 10:29:17 herrbach kernel: powernow: AMD processor not detected.
Sep  6 10:29:17 herrbach kernel: cpufreq: P4/Xeon(TM) CPU On-Demand Clock Modulation available
Sep  6 10:29:17 herrbach kernel: cpufreq: Intel(R) SpeedStep(TM) for this chipset not (yet) available.
Sep  6 10:29:17 herrbach kernel: ikconfig 0.6 with /proc/config*
Sep  6 10:29:17 herrbach kernel: Initializing Cryptographic API
Sep  6 10:29:17 herrbach kernel: ACPI: AC Adapter [ACAD] (on-line)
Sep  6 10:29:17 herrbach kernel: ACPI: Battery Slot [BAT1] (battery absent)
Sep  6 10:29:17 herrbach kernel: ACPI: Power Button (FF) [PWRF]
Sep  6 10:29:17 herrbach kernel: ACPI: Lid Switch [LID]
Sep  6 10:29:17 herrbach kernel: ACPI: Processor [CPU0] (supports C1 C2, 8 throttling states)
Sep  6 10:29:17 herrbach kernel: ACPI: Thermal Zone [THRM] (38 C)
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:pnp1
Sep  6 10:29:17 herrbach kernel: isapnp: Scanning for PnP cards...
Sep  6 10:29:17 herrbach kernel: isapnp: No Plug & Play device found
Sep  6 10:29:17 herrbach kernel: Real Time Clock Driver v1.12
Sep  6 10:29:17 herrbach kernel: [drm] Initialized radeon 1.9.0 20020828 on minor 0
Sep  6 10:29:17 herrbach kernel: Serial: 8250/16550 driver $Revision: 1.90 $ IRQ sharing disabled
Sep  6 10:29:17 herrbach kernel: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
Sep  6 10:29:17 herrbach kernel: PCI: Enabling device 0000:00:08.0 (0000 -> 0003)
Sep  6 10:29:17 herrbach kernel: ttyS1 at I/O 0x1428 (irq = 10) is a 8250
Sep  6 10:29:17 herrbach kernel: ttyS2 at I/O 0x1440 (irq = 10) is a 8250
Sep  6 10:29:17 herrbach kernel: ttyS3 at I/O 0x1450 (irq = 10) is a 8250
Sep  6 10:29:17 herrbach kernel: Using anticipatory scheduling io scheduler
Sep  6 10:29:17 herrbach kernel: floppy0: no floppy controllers found
Sep  6 10:29:17 herrbach kernel: RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
Sep  6 10:29:17 herrbach kernel: loop: loaded (max 8 devices)
Sep  6 10:29:17 herrbach kernel: nbd: registered device at major 43
Sep  6 10:29:17 herrbach kernel: natsemi dp8381x driver, version 1.07+LK1.0.17, Sep 27, 2002
Sep  6 10:29:17 herrbach kernel:   originally by Donald Becker <becker@scyld.com>
Sep  6 10:29:17 herrbach kernel:   http://www.scyld.com/network/natsemi.html
Sep  6 10:29:17 herrbach kernel:   2.4.x kernel port by Jeff Garzik, Tjeerd Mulder
Sep  6 10:29:17 herrbach kernel: eth0: NatSemi DP8381[56] at 0xcd80f000, 00:0b:cd:a7:40:b4, IRQ 10.
Sep  6 10:29:17 herrbach kernel: Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
Sep  6 10:29:17 herrbach kernel: ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
Sep  6 10:29:17 herrbach kernel: ALI15X3: IDE controller at PCI slot 0000:00:10.0
Sep  6 10:29:17 herrbach kernel: ACPI: No IRQ known for interrupt pin A of device 0000:00:10.0
Sep  6 10:29:17 herrbach kernel: ALI15X3: chipset revision 196
Sep  6 10:29:17 herrbach kernel: ALI15X3: not 100%% native mode: will probe irqs later
Sep  6 10:29:17 herrbach kernel:     ide0: BM-DMA at 0x2000-0x2007, BIOS settings: hda:DMA, hdb:pio
Sep  6 10:29:17 herrbach kernel:     ide1: BM-DMA at 0x2008-0x200f, BIOS settings: hdc:pio, hdd:pio
Sep  6 10:29:17 herrbach kernel: hda: HITACHI_DK23EA-30, ATA DISK drive
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:ide0
Sep  6 10:29:17 herrbach kernel: ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Sep  6 10:29:17 herrbach kernel: PM: Adding info for ide:0.0
Sep  6 10:29:17 herrbach kernel: hdc: HL-DT-STCD-RW/DVD DRIVE GCC-4241N, ATAPI CD/DVD-ROM drive
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:ide1
Sep  6 10:29:17 herrbach kernel: ide1 at 0x170-0x177,0x376 on irq 15
Sep  6 10:29:17 herrbach kernel: PM: Adding info for ide:1.0
Sep  6 10:29:17 herrbach kernel: hda: max request size: 128KiB
Sep  6 10:29:17 herrbach kernel: hda: 58605120 sectors (30005 MB) w/2048KiB Cache, CHS=58140/16/63, UDMA(100)
Sep  6 10:29:17 herrbach kernel:  hda: hda1 hda2 hda3
Sep  6 10:29:17 herrbach kernel: Console: switching to colour frame buffer device 128x48
Sep  6 10:29:17 herrbach kernel: Initializing USB Mass Storage driver...
Sep  6 10:29:17 herrbach kernel: drivers/usb/core/usb.c: registered new driver usb-storage
Sep  6 10:29:17 herrbach kernel: USB Mass Storage support registered.
Sep  6 10:29:17 herrbach kernel: drivers/usb/core/usb.c: registered new driver hiddev
Sep  6 10:29:17 herrbach kernel: drivers/usb/core/usb.c: registered new driver hid
Sep  6 10:29:17 herrbach kernel: drivers/usb/input/hid-core.c: v2.0:USB HID core driver
Sep  6 10:29:17 herrbach kernel: mice: PS/2 mouse device common for all mice
Sep  6 10:29:17 herrbach kernel: Synaptics Touchpad, model: 1
Sep  6 10:29:17 herrbach kernel:  Firmware: 5.8
Sep  6 10:29:17 herrbach kernel:  Sensor: 35
Sep  6 10:29:17 herrbach kernel:  new absolute packet format
Sep  6 10:29:17 herrbach kernel:  Touchpad has extended capability bits
Sep  6 10:29:17 herrbach kernel:  -> multifinger detection
Sep  6 10:29:17 herrbach kernel:  -> palm detection
Sep  6 10:29:17 herrbach kernel: input: Synaptics Synaptics TouchPad on isa0060/serio1
Sep  6 10:29:17 herrbach kernel: serio: i8042 AUX port at 0x60,0x64 irq 12
Sep  6 10:29:17 herrbach kernel: input: AT Set 2 keyboard on isa0060/serio0
Sep  6 10:29:17 herrbach kernel: serio: i8042 KBD port at 0x60,0x64 irq 1
Sep  6 10:29:17 herrbach kernel: Advanced Linux Sound Architecture Driver Version 0.9.6 (Wed Aug 20 20:27:13 2003 UTC).
Sep  6 10:29:17 herrbach kernel: ALSA device list:
Sep  6 10:29:17 herrbach kernel:   No soundcards found.
Sep  6 10:29:17 herrbach kernel: NET4: Linux TCP/IP 1.0 for NET4.0
Sep  6 10:29:17 herrbach kernel: IP: routing cache hash table of 1024 buckets, 8Kbytes
Sep  6 10:29:17 herrbach kernel: TCP: Hash tables configured (established 16384 bind 32768)
Sep  6 10:29:17 herrbach kernel: Linux IP multicast router 0.06 plus PIM-SM
Sep  6 10:29:17 herrbach kernel: NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Sep  6 10:29:17 herrbach kernel: cpufreq: No CPUs supporting ACPI performance management found.
Sep  6 10:29:17 herrbach kernel: BIOS EDD facility v0.09 2003-Jan-22, 1 devices found
Sep  6 10:29:17 herrbach kernel: PM: Reading swsusp image.
Sep  6 10:29:17 herrbach kernel: PM: Resume from disk failed.
Sep  6 10:29:17 herrbach kernel: ACPI: (supports S0 S3 S4 S5)
Sep  6 10:29:17 herrbach kernel: found reiserfs format "3.6" with standard journal
Sep  6 10:29:17 herrbach kernel: Reiserfs journal params: device hda2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30
Sep  6 10:29:17 herrbach kernel: reiserfs: checking transaction log (hda2) for (hda2)
Sep  6 10:29:17 herrbach kernel: Using r5 hash to sort names
Sep  6 10:29:17 herrbach kernel: VFS: Mounted root (reiserfs filesystem) readonly.
Sep  6 10:29:17 herrbach kernel: Freeing unused kernel memory: 152k freed
Sep  6 10:29:17 herrbach kernel: Adding 200804k swap on /dev/hda3.  Priority:-1 extents:1
Sep  6 10:29:17 herrbach kernel: ohci-hcd: 2003 Feb 24 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
Sep  6 10:29:17 herrbach kernel: ohci-hcd: block sizes: ed 64 td 64
Sep  6 10:29:17 herrbach kernel: ohci-hcd 0000:00:02.0: OHCI Host Controller
Sep  6 10:29:17 herrbach kernel: ohci-hcd 0000:00:02.0: irq 10, pci mem cd8db000
Sep  6 10:29:17 herrbach kernel: ohci-hcd 0000:00:02.0: new USB bus registered, assigned bus number 1
Sep  6 10:29:17 herrbach kernel: PM: Adding info for usb:usb1
Sep  6 10:29:17 herrbach kernel: PM: Adding info for usb:1-0:0
Sep  6 10:29:17 herrbach kernel: hub 1-0:0: USB hub found
Sep  6 10:29:17 herrbach kernel: hub 1-0:0: 4 ports detected
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:ide-scsi
Sep  6 10:29:17 herrbach kernel: scsi0 : SCSI host adapter emulation for IDE ATAPI devices
Sep  6 10:29:17 herrbach kernel: PM: Adding info for No Bus:host0
Sep  6 10:29:17 herrbach kernel:   Vendor: HL-DT-ST  Model: RW/DVD GCC-4241N  Rev: 0C27
Sep  6 10:29:17 herrbach kernel:   Type:   CD-ROM                             ANSI SCSI revision: 02
Sep  6 10:29:17 herrbach kernel: PM: Adding info for scsi:0:0:0:0
Sep  6 10:29:17 herrbach kernel: PCI: Enabling device 0000:00:06.0 (0005 -> 0007)
Sep  6 10:29:17 herrbach modprobe: FATAL: Module snd_card_1 not found. 
Sep  6 10:29:17 herrbach modprobe: FATAL: Module snd_card_1 not found. 
Sep  6 10:29:17 herrbach modprobe: FATAL: Module snd_card_2 not found. 
Sep  6 10:29:17 herrbach modprobe: FATAL: Module snd_card_2 not found. 
Sep  6 10:29:17 herrbach modprobe: FATAL: Module snd_card_3 not found. 
Sep  6 10:29:17 herrbach modprobe: FATAL: Module snd_card_3 not found. 
Sep  6 10:29:18 herrbach kernel: eth0: link up.
Sep  6 10:29:18 herrbach kernel: eth0: Setting full-duplex based on negotiated link capability.
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: Using interface eth0/00:0B:CD:A7:40:B4 with driver <natsemi> (version: 1.07+LK1.0.17)
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: Using detection mode: SIOCETHTOOL
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: ifplugd 0.15 successfully initialized, link beat detected.
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: Executing '/etc/ifplugd/ifplugd.action eth0 up'.
Sep  6 10:29:18 herrbach dhclient: Internet Software Consortium DHCP Client 2.0pl5
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: client: Internet Software Consortium DHCP Client 2.0pl5
Sep  6 10:29:18 herrbach dhclient: Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: client: Copyright 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium.
Sep  6 10:29:18 herrbach dhclient: All rights reserved.
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: client: All rights reserved.
Sep  6 10:29:18 herrbach dhclient: 
Sep  6 10:29:18 herrbach dhclient: Please contribute if you find this software useful.
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: client: Please contribute if you find this software useful.
Sep  6 10:29:18 herrbach dhclient: For info, please visit http://www.isc.org/dhcp-contrib.html
Sep  6 10:29:18 herrbach ifplugd(eth0)[248]: client: For info, please visit http://www.isc.org/dhcp-contrib.html
Sep  6 10:29:18 herrbach dhclient: 
Sep  6 10:29:19 herrbach dhclient: Listening on LPF/eth0/00:0b:cd:a7:40:b4
Sep  6 10:29:19 herrbach dhclient: Sending on   LPF/eth0/00:0b:cd:a7:40:b4
Sep  6 10:29:19 herrbach dhclient: Sending on   Socket/fallback/fallback-net
Sep  6 10:29:19 herrbach dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Sep  6 10:29:19 herrbach ifplugd(eth0)[248]: client: Listening on LPF/eth0/00:0b:cd:a7:40:b4
Sep  6 10:29:19 herrbach ifplugd(eth0)[248]: client: Sending on   LPF/eth0/00:0b:cd:a7:40:b4
Sep  6 10:29:19 herrbach ifplugd(eth0)[248]: client: Sending on   Socket/fallback/fallback-net
Sep  6 10:29:19 herrbach ifplugd(eth0)[248]: client: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Sep  6 10:29:19 herrbach dhclient: DHCPACK from 192.168.100.1
Sep  6 10:29:19 herrbach ifplugd(eth0)[248]: client: DHCPACK from 192.168.100.1
Sep  6 10:29:19 herrbach dhclient: bound to 192.168.100.8 -- renewal in 900 seconds.
Sep  6 10:29:19 herrbach ifplugd(eth0)[248]: client: bound to 192.168.100.8 -- renewal in 900 seconds.
Sep  6 10:29:19 herrbach ifplugd(eth0)[248]: Program executed successfully.
Sep  6 10:29:20 herrbach /usr/sbin/cron[285]: (CRON) INFO (pidfile fd = 3)
Sep  6 10:29:20 herrbach /usr/sbin/cron[286]: (CRON) STARTUP (fork ok)
Sep  6 10:29:20 herrbach /usr/sbin/cron[286]: (CRON) INFO (Running @reboot jobs)
Sep  6 10:29:23 herrbach kernel: Losing too many ticks!
Sep  6 10:29:23 herrbach kernel: TSC cannot be used as a timesource. (Are you running with SpeedStep?)
Sep  6 10:29:23 herrbach kernel: Falling back to a sane timesource.
Sep  6 10:30:42 herrbach kernel: Stopping tasks: ====================|
Sep  6 10:30:43 herrbach kernel: Freeing memory: ....|
Sep  6 10:30:43 herrbach kernel: hdc: start_power_step(step: 0)
Sep  6 10:30:43 herrbach kernel: hdc: completing PM request, suspend
Sep  6 10:30:43 herrbach kernel: hda: start_power_step(step: 0)
Sep  6 10:30:43 herrbach kernel: hda: start_power_step(step: 1)
Sep  6 10:30:43 herrbach kernel: hda: complete_power_step(step: 1, stat: 50, err: 0)
Sep  6 10:30:43 herrbach kernel: hda: completing PM request, suspend
Sep  6 10:30:43 herrbach kernel: eth0: remaining active for wake-on-lan
Sep  6 10:30:43 herrbach kernel: PM: Attempting to suspend to disk.
Sep  6 10:30:43 herrbach kernel: PM: snapshotting memory.
Sep  6 10:30:43 herrbach kernel: resume= option should be used to set suspend device/critical section: Counting pages to copy[nosave c0434000] (pages needed: 3692+512=4204 free: 45315)
Sep  6 10:30:43 herrbach kernel: Alloc pagedir
Sep  6 10:30:43 herrbach kernel: [nosave c0434000]<7>PM: Image restored successfully.
Sep  6 10:30:43 herrbach kernel: Freeing prev allocated pagedir
Sep  6 10:30:43 herrbach kernel: PCI: Enabling device 0000:00:06.0 (0005 -> 0007)
Sep  6 10:30:43 herrbach kernel: eth0: Setting full-duplex based on negotiated link capability.
Sep  6 10:30:43 herrbach kernel: hda: Wakeup request inited, waiting for !BSY...
Sep  6 10:30:43 herrbach kernel: hda: start_power_step(step: 1000)
Sep  6 10:30:43 herrbach kernel: blk: queue c12d6c00, I/O limit 4095Mb (mask 0xffffffff)
Sep  6 10:30:43 herrbach kernel: hda: completing PM request, resume
Sep  6 10:30:43 herrbach kernel: hdc: Wakeup request inited, waiting for !BSY...
Sep  6 10:30:43 herrbach kernel: hdc: start_power_step(step: 1000)
Sep  6 10:30:43 herrbach kernel: hdc: completing PM request, resume
Sep  6 10:30:43 herrbach kernel: Restarting tasks... done
Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: free_block (hda2:95121)[dev:blocknr]: bit already cleared
Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: free_block (hda2:95122)[dev:blocknr]: bit already cleared
Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data of object [689 645 0x0 SD] (nlink == 1) not found (pos 25)
Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data of object [689 652 0x0 SD] (nlink == 1) not found (pos 25)
Sep  6 10:31:17 herrbach last message repeated 9 times
Sep  6 10:31:21 herrbach shutdown[337]: shutting down for sy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fs corruption with swsusp in test4-mm6 ?
  2003-09-06  9:29 Fs corruption with swsusp in test4-mm6 ? Mathieu LESNIAK
@ 2003-09-06 21:22 ` Pavel Machek
  2003-09-07  8:06   ` Mathieu LESNIAK
  2003-09-08 19:41 ` Patrick Mochel
  1 sibling, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2003-09-06 21:22 UTC (permalink / raw)
  To: Mathieu LESNIAK; +Cc: linux-kernel, mochel, pavel

Hi!


> I've tested the latest -mm6 kernel on a Compaq Presario 2157EA laptop 
> (Celeron Mobile 2GHz)
> Everything worked fine until I tested suspend to disk. After resuming, 
> I've got random messages about reiserfs problem on the console :
> 
> vs-4080: reiserfs_free_block: free_block (hda2:95121)[dev:blocknr]: bit 
> already cleared
> Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: 
> free_block (hda2:95122)[dev:blocknr]: bit already cleared
> Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
> of object [689 645 0x0 SD] (nlink == 1) not found (pos 25)
> Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
> of object [689 652 0x0 SD] (nlink == 1) not found (pos 25)
> 
> Please find in attachement 1 syslog showing the suspend / resume cycle 
> and the fs errors.

Be sure to reboot then run reiserfsck.

OHCI lacks suspend/resume support. Turn it off. ... ... but it should
not do this kind of corruption. Can you reproduce this without OHCI?
Can you try -test3?
								Pavel

-- 
Horseback riding is like software...
...vgf orggre jura vgf serr.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fs corruption with swsusp in test4-mm6 ?
  2003-09-06 21:22 ` Pavel Machek
@ 2003-09-07  8:06   ` Mathieu LESNIAK
  2003-09-07 13:32     ` Pavel Machek
  0 siblings, 1 reply; 7+ messages in thread
From: Mathieu LESNIAK @ 2003-09-07  8:06 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel, mochel

Hi,

Pavel Machek wrote:
> Hi!
> 
> 
> 
>>I've tested the latest -mm6 kernel on a Compaq Presario 2157EA laptop 
>>(Celeron Mobile 2GHz)
>>Everything worked fine until I tested suspend to disk. After resuming, 
>>I've got random messages about reiserfs problem on the console :
>>
>>vs-4080: reiserfs_free_block: free_block (hda2:95121)[dev:blocknr]: bit 
>>already cleared
>>Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: 
>>free_block (hda2:95122)[dev:blocknr]: bit already cleared
>>Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
>>of object [689 645 0x0 SD] (nlink == 1) not found (pos 25)
>>Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
>>of object [689 652 0x0 SD] (nlink == 1) not found (pos 25)
>>
>>Please find in attachement 1 syslog showing the suspend / resume cycle 
>>and the fs errors.
> 
> 
> Be sure to reboot then run reiserfsck.
> 
> OHCI lacks suspend/resume support. Turn it off. ... ... but it should
> not do this kind of corruption. Can you reproduce this without OHCI?
> Can you try -test3?
> 								Pavel
> 


When I tested -test3 a few week ago, I hadn't got this problem.

Mathieu LESNIAK


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fs corruption with swsusp in test4-mm6 ?
  2003-09-07  8:06   ` Mathieu LESNIAK
@ 2003-09-07 13:32     ` Pavel Machek
  0 siblings, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2003-09-07 13:32 UTC (permalink / raw)
  To: Mathieu LESNIAK; +Cc: linux-kernel, mochel

Hi!

> >>I've tested the latest -mm6 kernel on a Compaq Presario 2157EA laptop 
> >>(Celeron Mobile 2GHz)
> >>Everything worked fine until I tested suspend to disk. After resuming, 
> >>I've got random messages about reiserfs problem on the console :
> >>
> >>vs-4080: reiserfs_free_block: free_block (hda2:95121)[dev:blocknr]: bit 
> >>already cleared
> >>Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: 
> >>free_block (hda2:95122)[dev:blocknr]: bit already cleared
> >>Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
> >>of object [689 645 0x0 SD] (nlink == 1) not found (pos 25)
> >>Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
> >>of object [689 652 0x0 SD] (nlink == 1) not found (pos 25)
> >>
> >>Please find in attachement 1 syslog showing the suspend / resume cycle 
> >>and the fs errors.
> >
> >
> >Be sure to reboot then run reiserfsck.
> >
> >OHCI lacks suspend/resume support. Turn it off. ... ... but it should
> >not do this kind of corruption. Can you reproduce this without OHCI?
> >Can you try -test3?
> 
> When I tested -test3 a few week ago, I hadn't got this problem.

Okay, try this patch, then invoke swsusp with this:

root@bug:~# cat swsusp.c
void
main(void)
{
  reboot(0xD000FCE2, 0);
}
root@bug:~#

If it helps, it is patrick's swsusp changes, else it is patrick's
driver model changes or some driver bug.
								Pavel

--- clean/kernel/power/main.c	2003-08-27 12:00:53.000000000 +0200
+++ linux/kernel/power/main.c	2003-09-04 13:48:08.000000000 +0200
@@ -172,31 +172,10 @@
 
 static int pm_suspend_disk(void)
 {
-	int error;
-
 	pr_debug("PM: Attempting to suspend to disk.\n");
 	if (pm_disk_mode == PM_DISK_FIRMWARE)
 		return pm_ops->enter(PM_SUSPEND_DISK);
-
-	if (!have_swsusp)
-		return -EPERM;
-
-	pr_debug("PM: snapshotting memory.\n");
-	in_suspend = 1;
-	if ((error = swsusp_save()))
-		goto Done;
-
-	if (in_suspend) {
-		pr_debug("PM: writing image.\n");
-		error = swsusp_write();
-		if (!error)
-			error = power_down(pm_disk_mode);
-		pr_debug("PM: Power down failed.\n");
-	} else
-		pr_debug("PM: Image restored successfully.\n");
-	swsusp_free();
- Done:
-	return error;
+	return 0;
 }
 
 
@@ -329,59 +308,17 @@
 
 int pm_suspend(u32 state)
 {
+	if ((state == PM_SUSPEND_DISK) && (pm_disk_mode != PM_DISK_FIRMWARE)) {
+		software_suspend();
+		return 0;
+	}
 	if (state > PM_SUSPEND_ON && state < PM_SUSPEND_MAX)
 		return enter_state(state);
 	return -EINVAL;
 }
 
-
-/**
- *	pm_resume - Resume from a saved image.
- *
- *	Called as a late_initcall (so all devices are discovered and 
- *	initialized), we call swsusp to see if we have a saved image or not.
- *	If so, we quiesce devices, the restore the saved image. We will 
- *	return above (in pm_suspend_disk() ) if everything goes well. 
- *	Otherwise, we fail gracefully and return to the normally 
- *	scheduled program.
- *
- */
-
-static int pm_resume(void)
-{
-	int error;
-
-	if (!have_swsusp)
-		return 0;
-
-	pr_debug("PM: Reading swsusp image.\n");
-
-	if ((error = swsusp_read()))
-		goto Done;
-
-	pr_debug("PM: Preparing system for restore.\n");
-
-	if ((error = suspend_prepare(PM_SUSPEND_DISK)))
-		goto Free;
-
-	pr_debug("PM: Restoring saved image.\n");
-	swsusp_restore();
-
-	pr_debug("PM: Restore failed, recovering.n");
-	suspend_finish(PM_SUSPEND_DISK);
- Free:
-	swsusp_free();
- Done:
-	pr_debug("PM: Resume from disk failed.\n");
-	return 0;
-}
-
-late_initcall(pm_resume);
-
-
 decl_subsys(power,NULL,NULL);
 
-
 #define power_attr(_name) \
 static struct subsys_attribute _name##_attr = {	\
 	.attr	= {				\
--- clean/kernel/power/swsusp.c	2003-08-27 12:00:53.000000000 +0200
+++ linux/kernel/power/swsusp.c	2003-09-05 11:41:20.000000000 +0200
@@ -5,7 +5,8 @@
  * machine suspend feature using pretty near only high-level routines
  *
  * Copyright (C) 1998-2001 Gabor Kuti <seasons@fornax.hu>
- * Copyright (C) 1998,2001,2002 Pavel Machek <pavel@suse.cz>
+ * Copyright (C) 1998,2001-2003 Pavel Machek <pavel@suse.cz>
+ * Copyright (C) 2003 Patrick Mochel <mochel@osdl.org>
  *
  * I'd like to thank the following people for their work:
  * 
@@ -65,7 +66,9 @@
 
 #include "power.h"
 
-unsigned char software_suspend_enabled = 1;
+extern long sys_sync(void);
+
+unsigned char software_suspend_enabled = 0;
 
 #define __ADDRESS(x)  ((unsigned long) phys_to_virt(x))
 #define ADDRESS(x) __ADDRESS((x) << PAGE_SHIFT)
@@ -83,11 +86,14 @@
 static int pagedir_order_check;
 static int nr_copy_pages_check;
 
-static char resume_file[256];			/* For resume= kernel option */
+static int resume_status;
+static char resume_file[256] = "";			/* For resume= kernel option */
 static dev_t resume_device;
 /* Local variables that should not be affected by save */
 unsigned int nr_copy_pages __nosavedata = 0;
 
+static int pm_suspend_state;
+
 /* Suspend pagedir is allocated before final copy, therefore it
    must be freed after resume 
 
@@ -347,10 +353,15 @@
 	int pfn;
 	struct page *page;
 	
+#ifdef CONFIG_DISCONTIGMEM
+	panic("Discontingmem not supported");
+#else
 	BUG_ON (max_pfn != num_physpages);
-
+#endif
 	for (pfn = 0; pfn < max_pfn; pfn++) {
 		page = pfn_to_page(pfn);
+		if (PageHighMem(page))
+			panic("Swsusp not supported on highmem boxes. Send 1GB of RAM to <pavel@ucw.cz> and try again ;-).");
 
 		if (!PageReserved(page)) {
 			if (PageNosave(page))
@@ -435,6 +446,74 @@
 	return pagedir;
 }
 
+static int prepare_suspend_processes(void)
+{
+	sys_sync();	/* Syncing needs pdflushd, so do it before stopping processes */
+	if (freeze_processes()) {
+		printk( KERN_ERR "Suspend failed: Not all processes stopped!\n" );
+		thaw_processes();
+		return 1;
+	}
+	return 0;
+}
+
+/*
+ * Try to free as much memory as possible, but do not OOM-kill anyone
+ *
+ * Notice: all userland should be stopped at this point, or livelock is possible.
+ */
+static void free_some_memory(void)
+{
+	printk("Freeing memory: ");
+	while (shrink_all_memory(10000))
+		printk(".");
+	printk("|\n");
+}
+
+/* Make disk drivers accept operations, again */
+static void drivers_unsuspend(void)
+{
+	device_resume();
+}
+
+/* Called from process context */
+static int drivers_suspend(void)
+{
+	device_suspend(4);
+	if(!pm_suspend_state) {
+		if(pm_send_all(PM_SUSPEND,(void *)3)) {
+			printk(KERN_WARNING "Problem while sending suspend event\n");
+			return(1);
+		}
+		pm_suspend_state=1;
+	} else
+		printk(KERN_WARNING "PM suspend state already raised\n");
+	device_power_down(4);
+	return(0);
+}
+
+#define RESUME_PHASE1 1 /* Called from interrupts disabled */
+#define RESUME_PHASE2 2 /* Called with interrupts enabled */
+#define RESUME_ALL_PHASES (RESUME_PHASE1 | RESUME_PHASE2)
+static void drivers_resume(int flags)
+{
+	if (flags & RESUME_PHASE1) {
+		dpm_power_up();
+	}
+  	if (flags & RESUME_PHASE2) {
+		device_resume();
+		if(pm_suspend_state) {
+			if(pm_send_all(PM_RESUME,(void *)0))
+				printk(KERN_WARNING "Problem while sending resume event\n");
+			pm_suspend_state=0;
+		} else
+			printk(KERN_WARNING "PM suspend state wasn't raised\n");
+
+#ifdef SUSPEND_CONSOLE
+		update_screen(fg_console);	/* Hmm, is this the problem? */
+#endif
+	}
+}
 
 static int suspend_prepare_image(void)
 {
@@ -488,14 +567,12 @@
 	return 0;
 }
 
-static int suspend_save_image(void)
+static void suspend_save_image(void)
 {
-	int error;
-
-	device_resume();
+	drivers_unsuspend();
 
 	lock_swapdevices();
-	error = write_suspend_image();
+	write_suspend_image();
 	lock_swapdevices();	/* This will unlock ignored swap devices since writing is finished */
 
 	/* It is important _NOT_ to umount filesystems at this point. We want
@@ -503,7 +580,29 @@
 	 * filesystem clean: it is not. (And it does not matter, if we resume
 	 * correctly, we'll mark system clean, anyway.)
 	 */
-	return error;
+}
+
+static void suspend_power_down(void)
+{
+	extern int C_A_D;
+	C_A_D = 0;
+	printk(KERN_EMERG "%s%s Trying to power down.\n", name_suspend, TEST_SWSUSP ? "Disable TEST_SWSUSP. NOT ": "");
+#ifdef CONFIG_VT
+	PRINTK(KERN_EMERG "shift_state: %04x\n", shift_state);
+	mdelay(1000);
+	if (TEST_SWSUSP ^ (!!(shift_state & (1 << KG_CTRL))))
+		machine_restart(NULL);
+	else
+#endif
+	{
+		device_shutdown();
+		machine_power_off();
+	}
+
+	printk(KERN_EMERG "%sProbably not capable for powerdown. System halted.\n", name_suspend);
+	machine_halt();
+	while (1);
+	/* NOTREACHED */
 }
 
 /*
@@ -515,21 +614,32 @@
 	barrier();
 	mb();
 	spin_lock_irq(&suspend_pagedir_lock);	/* Done to disable interrupts */ 
+
 	PRINTK( "Waiting for DMAs to settle down...\n");
-	/* We do not want some readahead with DMA to corrupt our memory, right?
-	   Do it with disabled interrupts for best effect. That way, if some
-	   driver scheduled DMA, we have good chance for DMA to finish ;-). */
-	mdelay(1000);
+	mdelay(1000);	/* We do not want some readahead with DMA to corrupt our memory, right?
+			   Do it with disabled interrupts for best effect. That way, if some
+			   driver scheduled DMA, we have good chance for DMA to finish ;-). */
 }
 
 void do_magic_resume_2(void)
 {
 	BUG_ON (nr_copy_pages_check != nr_copy_pages);
 	BUG_ON (pagedir_order_check != pagedir_order);
-	
-	/* Even mappings of "global" things (vmalloc) need to be fixed */
-	__flush_tlb_global();
+
+	__flush_tlb_global();		/* Even mappings of "global" things (vmalloc) need to be fixed */
+
+	PRINTK( "Freeing prev allocated pagedir\n" );
+	free_suspend_pagedir((unsigned long) pagedir_save);
 	spin_unlock_irq(&suspend_pagedir_lock);
+	drivers_resume(RESUME_ALL_PHASES);
+
+	PRINTK( "Fixing swap signatures... " );
+	mark_swapfiles(((swp_entry_t) {0}), MARK_SWAP_RESUME);
+	PRINTK( "ok\n" );
+
+#ifdef SUSPEND_CONSOLE
+	update_screen(fg_console);	/* Hmm, is this the problem? */
+#endif
 }
 
 /* do_magic() is implemented in arch/?/kernel/suspend_asm.S, and basically does:
@@ -554,28 +664,92 @@
 {
 	mb();
 	barrier();
+	BUG_ON(in_atomic());
 	spin_lock_irq(&suspend_pagedir_lock);
 }
 
-int do_magic_suspend_2(void)
+void do_magic_suspend_2(void)
 {
 	int is_problem;
 	read_swapfiles();
 	is_problem = suspend_prepare_image();
 	spin_unlock_irq(&suspend_pagedir_lock);
-	if (!is_problem)
-		return suspend_save_image();
+	if (!is_problem) {
+		kernel_fpu_end();	/* save_processor_state() does kernel_fpu_begin, and we need to revert it in order to pass in_atomic() checks */
+		BUG_ON(in_atomic());
+		suspend_save_image();
+		suspend_power_down();	/* FIXME: if suspend_power_down is commented out, console is lost after few suspends ?! */
+	}
+
 	printk(KERN_EMERG "%sSuspend failed, trying to recover...\n", name_suspend);
+	MDELAY(1000); /* So user can wait and report us messages if armageddon comes :-) */
+
 	barrier();
 	mb();
+	spin_lock_irq(&suspend_pagedir_lock);	/* Done to disable interrupts */ 
 	mdelay(1000);
-	return -EFAULT;
+
+	free_pages((unsigned long) pagedir_nosave, pagedir_order);
+	spin_unlock_irq(&suspend_pagedir_lock);
+	mark_swapfiles(((swp_entry_t) {0}), MARK_SWAP_RESUME);
+}
+
+static void do_software_suspend(void)
+{
+	printk("Doing software_suspend()\n");
+	arch_prepare_suspend();
+	if (pm_prepare_console())
+		printk( "%sCan't allocate a console... proceeding\n", name_suspend);
+	if (!prepare_suspend_processes()) {
+
+		/* At this point, all user processes and "dangerous"
+                   kernel threads are stopped. Free some memory, as we
+                   need half of memory free. */
+
+		free_some_memory();
+		
+		/* No need to invalidate any vfsmnt list -- 
+		 * they will be valid after resume, anyway.
+		 */
+		blk_run_queues();
+
+		/* Save state of all device drivers, and stop them. */		   
+		if(drivers_suspend()==0)
+			/* If stopping device drivers worked, we proceed basically into
+			 * suspend_save_image.
+			 *
+			 * do_magic(0) returns after system is resumed.
+			 *
+			 * do_magic() copies all "used" memory to "free" memory, then
+			 * unsuspends all device drivers, and writes memory to disk
+			 * using normal kernel mechanism.
+			 */
+			do_magic(0);
+		thaw_processes();
+	}
+	software_suspend_enabled = 1;
+	MDELAY(1000);
+	pm_restore_console();
+}
+
+/*
+ * This is main interface to the outside world. It needs to be
+ * called from process context.
+ */
+void software_suspend(void)
+{
+	if(!software_suspend_enabled)
+		return;
+
+	software_suspend_enabled = 0;
+	might_sleep();
+	do_software_suspend();
 }
 
 /* More restore stuff */
 
 /* FIXME: Why not memcpy(to, from, 1<<pagedir_order*PAGE_SIZE)? */
-static void __init copy_pagedir(suspend_pagedir_t *to, suspend_pagedir_t *from)
+static void copy_pagedir(suspend_pagedir_t *to, suspend_pagedir_t *from)
 {
 	int i;
 	char *topointer=(char *)to, *frompointer=(char *)from;
@@ -592,8 +766,8 @@
 /*
  * Returns true if given address/order collides with any orig_address 
  */
-static int __init does_collide_order(suspend_pagedir_t *pagedir, 
-				     unsigned long addr, int order)
+static int does_collide_order(suspend_pagedir_t *pagedir, unsigned long addr,
+		int order)
 {
 	int i;
 	unsigned long addre = addr + (PAGE_SIZE<<order);
@@ -610,7 +784,7 @@
  * We check here that pagedir & pages it points to won't collide with pages
  * where we're going to restore from the loaded pages later
  */
-static int __init check_pagedir(void)
+static int check_pagedir(void)
 {
 	int i;
 
@@ -628,7 +802,7 @@
 	return 0;
 }
 
-static int __init relocate_pagedir(void)
+static int relocate_pagedir(void)
 {
 	/*
 	 * We have to avoid recursion (not to overflow kernel stack),
@@ -678,13 +852,13 @@
  * I really don't think that it's foolproof but more than nothing..
  */
 
-static int __init sanity_check_failed(char *reason)
+static int sanity_check_failed(char *reason)
 {
 	printk(KERN_ERR "%s%s\n",name_resume,reason);
 	return -EPERM;
 }
 
-static int __init sanity_check(struct suspend_header *sh)
+static int sanity_check(struct suspend_header *sh)
 {
 	if(sh->version_code != LINUX_VERSION_CODE)
 		return sanity_check_failed("Incorrect kernel version");
@@ -701,8 +875,7 @@
 	return 0;
 }
 
-static int __init bdev_read_page(struct block_device *bdev, 
-				 long pos, void *buf)
+static int bdev_read_page(struct block_device *bdev, long pos, void *buf)
 {
 	struct buffer_head *bh;
 	BUG_ON (pos%PAGE_SIZE);
@@ -716,10 +889,31 @@
 	return 0;
 } 
 
+static int bdev_write_page(struct block_device *bdev, long pos, void *buf)
+{
+#if 0
+	struct buffer_head *bh;
+	BUG_ON (pos%PAGE_SIZE);
+	bh = __bread(bdev, pos/PAGE_SIZE, PAGE_SIZE);
+	if (!bh || (!bh->b_data)) {
+		return -1;
+	}
+	memcpy(bh->b_data, buf, PAGE_SIZE);	/* FIXME: may need kmap() */
+	BUG_ON(!buffer_uptodate(bh));
+	generic_make_request(WRITE, bh);
+	if (!buffer_uptodate(bh))
+		printk(KERN_CRIT "%sWarning %s: Fixing swap signatures unsuccessful...\n", name_resume, resume_file);
+	wait_on_buffer(bh);
+	brelse(bh);
+	return 0;
+#endif
+	printk(KERN_CRIT "%sWarning %s: Fixing swap signatures unimplemented...\n", name_resume, resume_file);
+	return 0;
+}
+
 extern dev_t __init name_to_dev_t(const char *line);
 
-static int __init read_suspend_image(struct block_device *bdev, 
-				     union diskpage *cur)
+static int __read_suspend_image(struct block_device *bdev, union diskpage *cur, int noresume)
 {
 	swp_entry_t next;
 	int i, nr_pgdir_pages;
@@ -744,9 +938,18 @@
 	else if (!memcmp("S2",cur->swh.magic.magic,2))
 		memcpy(cur->swh.magic.magic,"SWAPSPACE2",10);
 	else {
-		printk("swsusp: %s: Unable to find suspended-data signature (%.10s - misspelled?\n", 
+		if (noresume)
+			return -EINVAL;
+		panic("%sUnable to find suspended-data signature (%.10s - misspelled?\n", 
 			name_resume, cur->swh.magic.magic);
-		return -EFAULT;
+	}
+	if (noresume) {
+		/* We don't do a sanity check here: we want to restore the swap
+		   whatever version of kernel made the suspend image;
+		   We need to write swap, but swap is *not* enabled so
+		   we must write the device directly */
+		printk("%s: Fixing swap signatures %s...\n", name_resume, resume_file);
+		bdev_write_page(bdev, 0, cur);
 	}
 
 	printk( "%sSignature found, resuming\n", name_resume );
@@ -796,115 +999,125 @@
 	return 0;
 }
 
-/**
- *	swsusp_save - Snapshot memory
- */
-
-int swsusp_save(void) 
-{
-#if defined (CONFIG_HIGHMEM) || defined (COFNIG_DISCONTIGMEM)
-	printk("swsusp is not supported with high- or discontig-mem.\n");
-	return -EPERM;
-#endif
-	return 0;
-}
-
-
-/**
- *	swsusp_write - Write saved memory image to swap.
- *
- *	do_magic(0) returns after system is resumed.
- *
- *	do_magic() copies all "used" memory to "free" memory, then
- *	unsuspends all device drivers, and writes memory to disk
- *	using normal kernel mechanism.
- */
-
-int swsusp_write(void)
-{
-	arch_prepare_suspend();
-	return do_magic(0);
-}
-
-
-/**
- *	swsusp_read - Read saved image from swap.
- */
-
-int __init swsusp_read(void)
+static int read_suspend_image(const char * specialfile, int noresume)
 {
 	union diskpage *cur;
+	unsigned long scratch_page = 0;
 	int error;
 	char b[BDEVNAME_SIZE];
 
-	if (!strlen(resume_file))
-		return -ENOENT;
-
-	resume_device = name_to_dev_t(resume_file);
-	printk("swsusp: Resume From Partition: %s, Device: %s\n", 
-	       resume_file, __bdevname(resume_device, b));
-
-	cur = (union diskpage *)get_zeroed_page(GFP_ATOMIC);
+	resume_device = name_to_dev_t(specialfile);
+	scratch_page = get_zeroed_page(GFP_ATOMIC);
+	cur = (void *) scratch_page;
 	if (cur) {
 		struct block_device *bdev;
+		printk("Resuming from device %s\n",
+				__bdevname(resume_device, b));
 		bdev = open_by_devnum(resume_device, FMODE_READ, BDEV_RAW);
-		if (!IS_ERR(bdev)) {
+		if (IS_ERR(bdev)) {
+			error = PTR_ERR(bdev);
+		} else {
 			set_blocksize(bdev, PAGE_SIZE);
-			error = read_suspend_image(bdev, cur);
+			error = __read_suspend_image(bdev, cur, noresume);
 			blkdev_put(bdev, BDEV_RAW);
-		} else
-			error = PTR_ERR(bdev);
-		free_page((unsigned long)cur);
-	} else
-		error = -ENOMEM;
+		}
+	} else error = -ENOMEM;
 
-	if (!error)
-		PRINTK("Reading resume file was successful\n");
-	else
-		printk( "%sError %d resuming\n", name_resume, error );
+	if (scratch_page)
+		free_page(scratch_page);
+	switch (error) {
+		case 0:
+			PRINTK("Reading resume file was successful\n");
+			break;
+		case -EINVAL:
+			break;
+		case -EIO:
+			printk( "%sI/O error\n", name_resume);
+			break;
+		case -ENOENT:
+			printk( "%s%s: No such file or directory\n", name_resume, specialfile);
+			break;
+		case -ENOMEM:
+			printk( "%sNot enough memory\n", name_resume);
+			break;
+		default:
+			printk( "%sError %d resuming\n", name_resume, error );
+	}
 	MDELAY(1000);
 	return error;
 }
 
-
 /**
- *	swsusp_restore - Replace running kernel with saved image.
+ *	software_resume - Resume from a saved image.
+ *
+ *	Called as a late_initcall (so all devices are discovered and 
+ *	initialized), we call swsusp to see if we have a saved image or not.
+ *	If so, we quiesce devices, the restore the saved image. We will 
+ *	return above (in pm_suspend_disk() ) if everything goes well. 
+ *	Otherwise, we fail gracefully and return to the normally 
+ *	scheduled program.
+ *
  */
-
-int __init swsusp_restore(void)
+static void software_resume(void)
 {
-	return do_magic(1);
-}
+	if (num_online_cpus() > 1) {
+		printk(KERN_WARNING "Software Suspend has malfunctioning SMP support. Disabled :(\n");	
+		return;
+	}
+	/* We enable the possibility of machine suspend */
+	software_suspend_enabled = 1;
+	if (!resume_status)
+		return;
 
+	printk( "%s", name_resume );
+	if (resume_status == NORESUME) {
+		if(resume_file[0])
+			read_suspend_image(resume_file, 1);
+		printk( "disabled\n" );
+		return;
+	}
+	MDELAY(1000);
 
-/**
- *	swsusp_free - Free memory allocated to hold snapshot.
- */
+	if (pm_prepare_console())
+		printk("swsusp: Can't allocate a console... proceeding\n");
 
-int swsusp_free(void)
-{
-	PRINTK( "Freeing prev allocated pagedir\n" );
-	free_suspend_pagedir((unsigned long) pagedir_save);
+	if (!resume_file[0] && resume_status == RESUME_SPECIFIED) {
+		printk( "suspension device unspecified\n" );
+		return;
+	}
 
-	PRINTK( "Fixing swap signatures... " );
-	mark_swapfiles(((swp_entry_t) {0}), MARK_SWAP_RESUME);
-	PRINTK( "ok\n" );
-	return 0;
+	printk( "resuming from %s\n", resume_file);
+	if (read_suspend_image(resume_file, 0))
+		goto read_failure;
+	do_magic(1);
+	panic("This never returns");
+
+read_failure:
+	pm_restore_console();
+	return;
 }
 
+late_initcall(software_resume);
+
 static int __init resume_setup(char *str)
 {
-	if (strlen(str))
-		strncpy(resume_file, str, 255);
+	if (resume_status == NORESUME)
+		return 1;
+
+	strncpy( resume_file, str, 255 );
+	resume_status = RESUME_SPECIFIED;
+
 	return 1;
 }
 
 static int __init noresume_setup(char *str)
 {
-	resume_file[0] = '\0';
+	resume_status = NORESUME;
 	return 1;
 }
 
 __setup("noresume", noresume_setup);
 __setup("resume=", resume_setup);
 
+EXPORT_SYMBOL(software_suspend);
+EXPORT_SYMBOL(software_suspend_enabled);
--- clean/include/linux/suspend.h	2003-08-27 12:00:50.000000000 +0200
+++ linux/include/linux/suspend.h	2003-09-03 21:00:56.000000000 +0200
@@ -8,7 +8,11 @@
 #include <linux/notifier.h>
 #include <linux/config.h>
 #include <linux/init.h>
-#include <linux/pm.h>
+
+extern unsigned char software_suspend_enabled;
+
+#define NORESUME	 1
+#define RESUME_SPECIFIED 2
 
 #ifdef CONFIG_SOFTWARE_SUSPEND
 /* page backup entry */
@@ -45,30 +49,61 @@
 /* mm/page_alloc.c */
 extern void drain_local_pages(void);
 
+/* kernel/suspend.c */
+extern void software_suspend(void);
+extern void software_resume(void);
+
+extern int register_suspend_notifier(struct notifier_block *);
+extern int unregister_suspend_notifier(struct notifier_block *);
+
 extern unsigned int nr_copy_pages __nosavedata;
 extern suspend_pagedir_t *pagedir_nosave __nosavedata;
 
+/* Communication between kernel/suspend.c and arch/i386/suspend.c */
+
+extern void do_magic_resume_1(void);
+extern void do_magic_resume_2(void);
+extern void do_magic_suspend_1(void);
+extern void do_magic_suspend_2(void);
+
 /* Communication between acpi and arch/i386/suspend.c */
 
 extern void do_suspend_lowlevel(int resume);
 extern void do_suspend_lowlevel_s4bios(int resume);
 
 #else	/* CONFIG_SOFTWARE_SUSPEND */
-static inline int software_suspend(void)
+static inline void software_suspend(void)
 {
+	printk("Warning: fake suspend called\n");
 	return -EPERM;
 }
+#define software_resume()		do { } while(0)
+#define register_suspend_notifier(a)	do { } while(0)
+#define unregister_suspend_notifier(a)	do { } while(0)
 #endif	/* CONFIG_SOFTWARE_SUSPEND */
 
 
 #ifdef CONFIG_PM
 extern void refrigerator(unsigned long);
+extern int freeze_processes(void);
+extern void thaw_processes(void);
+
+extern int pm_prepare_console(void);
+extern void pm_restore_console(void);
 
 #else
 static inline void refrigerator(unsigned long flag)
 {
 
 }
+static inline int freeze_processes(void)
+{
+	return 0;
+}
+static inline void thaw_processes(void)
+{
+
+}
 #endif	/* CONFIG_PM */
 
 #endif /* _LINUX_SWSUSP_H */
--- clean/kernel/sys.c	2003-08-27 12:00:53.000000000 +0200
+++ linux/kernel/sys.c	2003-09-05 11:43:30.000000000 +0200
@@ -456,8 +456,11 @@
 
 #ifdef CONFIG_SOFTWARE_SUSPEND
 	case LINUX_REBOOT_CMD_SW_SUSPEND:
-		if (!pm_suspend(PM_SUSPEND_DISK))
-			break;
+		if (!software_suspend_enabled) {
+			unlock_kernel();
+			return -EAGAIN;
+		}
+		software_suspend();
 		do_exit(0);
 		break;
 #endif


-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fs corruption with swsusp in test4-mm6 ?
  2003-09-06  9:29 Fs corruption with swsusp in test4-mm6 ? Mathieu LESNIAK
  2003-09-06 21:22 ` Pavel Machek
@ 2003-09-08 19:41 ` Patrick Mochel
  2003-09-08 20:11   ` Mathieu LESNIAK
  1 sibling, 1 reply; 7+ messages in thread
From: Patrick Mochel @ 2003-09-08 19:41 UTC (permalink / raw)
  To: Mathieu LESNIAK; +Cc: linux-kernel, pavel


> I've tested the latest -mm6 kernel on a Compaq Presario 2157EA laptop 
> (Celeron Mobile 2GHz)
> Everything worked fine until I tested suspend to disk. After resuming, 
> I've got random messages about reiserfs problem on the console :

Definitely not good. 

> vs-4080: reiserfs_free_block: free_block (hda2:95121)[dev:blocknr]: bit 
> already cleared
> Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: 
> free_block (hda2:95122)[dev:blocknr]: bit already cleared
> Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
> of object [689 645 0x0 SD] (nlink == 1) not found (pos 25)
> Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
> of object [689 652 0x0 SD] (nlink == 1) not found (pos 25)

Could someone that is familar with reiserfs comment as to what exactly is 
happening? 

Mathieu, did you notice this with any of the earlier -test4-mm6 kernels, 
or just -mm6? 

Thanks,


	Pat


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fs corruption with swsusp in test4-mm6 ?
  2003-09-08 19:41 ` Patrick Mochel
@ 2003-09-08 20:11   ` Mathieu LESNIAK
  2003-09-08 20:11     ` Patrick Mochel
  0 siblings, 1 reply; 7+ messages in thread
From: Mathieu LESNIAK @ 2003-09-08 20:11 UTC (permalink / raw)
  To: Patrick Mochel; +Cc: linux-kernel, pavel

Patrick Mochel wrote:
>>vs-4080: reiserfs_free_block: free_block (hda2:95121)[dev:blocknr]: bit 
>>already cleared
>>Sep  6 10:30:51 herrbach kernel: vs-4080: reiserfs_free_block: 
>>free_block (hda2:95122)[dev:blocknr]: bit already cleared
>>Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
>>of object [689 645 0x0 SD] (nlink == 1) not found (pos 25)
>>Sep  6 10:30:58 herrbach kernel: vs-13060: reiserfs_update_sd: stat data 
>>of object [689 652 0x0 SD] (nlink == 1) not found (pos 25)
> 
> 
> Could someone that is familar with reiserfs comment as to what exactly is 
> happening? 
> 
> Mathieu, did you notice this with any of the earlier -test4-mm6 kernels, 
> or just -mm6? 
> 
> Thanks,
> 
> 
> 	Pat
> 

Hi,

I haven't tested previous -test4-mm patches before this one, so I 
couldn't tell you :(
In addition, as I said to Pavel in private mail, this laptop is not 
mine, and I won't be able to execute more tests on it.

Mathieu LESNIAK


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Fs corruption with swsusp in test4-mm6 ?
  2003-09-08 20:11   ` Mathieu LESNIAK
@ 2003-09-08 20:11     ` Patrick Mochel
  0 siblings, 0 replies; 7+ messages in thread
From: Patrick Mochel @ 2003-09-08 20:11 UTC (permalink / raw)
  To: Mathieu LESNIAK; +Cc: linux-kernel, pavel


> I haven't tested previous -test4-mm patches before this one, so I 
> couldn't tell you :(
> In addition, as I said to Pavel in private mail, this laptop is not 
> mine, and I won't be able to execute more tests on it.

Ah. I'm sorry to hear that. Thanks for testing anyway. 

If someone has tested suspend-to-disk while using reiserfs, I would be 
very interested to hear if they have or have not had success.. (For the 
record, I use ext3 and have not seen any comparable problems).

Thanks,


	Pat


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-09-08 20:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-06  9:29 Fs corruption with swsusp in test4-mm6 ? Mathieu LESNIAK
2003-09-06 21:22 ` Pavel Machek
2003-09-07  8:06   ` Mathieu LESNIAK
2003-09-07 13:32     ` Pavel Machek
2003-09-08 19:41 ` Patrick Mochel
2003-09-08 20:11   ` Mathieu LESNIAK
2003-09-08 20:11     ` Patrick Mochel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox