Bug 4869 - Screen stays blank upon resume (APM suspend-to-RAM)
Screen stays blank upon resume (APM suspend-to-RAM)
Status: REJECTED UNREPRODUCIBLE
Product: Drivers
Classification: Unclassified
Component: Console/Framebuffers
i386 Linux
: P2 normal
Assigned To: Pavel Machek
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-10 22:08 UTC by russell bell
Modified: 2007-04-28 12:49 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.16.16
Tree: Mainline
Regression: ---


Attachments
Add suspend/resume for neofb pci_driver (1.76 KB, patch)
2005-08-02 06:26 UTC, Antonino Daplas
Details | Diff
Add suspend/resume for neofb pci_driver (2) (1.79 KB, patch)
2005-08-02 06:37 UTC, Antonino Daplas
Details | Diff
fix-console-blanking.patch (2.89 KB, patch)
2005-11-08 21:22 UTC, Andrew Morton
Details | Diff
Convert to platform device, add suspend/resume hooks (1.92 KB, patch)
2005-11-25 17:27 UTC, Antonino Daplas
Details | Diff
Dummy con on startup (2.12 KB, patch)
2005-11-29 13:18 UTC, Antonino Daplas
Details | Diff
Add suspend/resume for vgacon (2.56 KB, patch)
2005-11-29 23:07 UTC, Antonino Daplas
Details | Diff

Description russell bell 2005-07-10 22:08:35 UTC
Distribution:slackware
Hardware Environment:  ibm thinkpad 390x
Software Environment: just the kernel, apm, and the neomagic fb driver
Problem Description:  upon resume the screen flashes on for a fraction of a 
second, then blanks and won't unblank.
Steps to reproduce:  suspend (Fn-F4), then resume.  This did not happen with
kernel 2.6.11.  I have commented out the blanking routines in apm.c, neofb.c,
and vt.c, and it still happens.  I booted in 2.6.11 and it does not happen.
I have inspected the patch file and can't find anything likely I have not tried
to roll back.
Comment 1 Andrew Morton 2005-07-29 00:00:10 UTC
Is this still happening in 2.6.13-rc4?

Thanks.
Comment 2 Andrew Morton 2005-08-01 21:21:24 UTC
Russell confirms that this is still happening in 2.6.13-rc4.
Comment 3 Antonino Daplas 2005-08-02 01:29:48 UTC
Not many changes in neofb, actually, just cleanups and addition of support for a
few chipsets, nothing radical.

The one change that may affect framebuffers is the disappearance of the
pm_register(pm_con,...) in vt.c.  Basically, consoles blank/unblank hooks are
also called on PM requests.

This change also got in in 2.6.12:

http://marc.theaimsgroup.com/?l=linux-kernel&m=111052009232499&w=2

Also, does the fact that neofb not have any suspend/resume hook matter with this
bug?

I'm currently working on a framebuffer driver that also fails on resume. Even
launching X failed to reinitialize the card.
Comment 4 Pavel Machek 2005-08-02 03:02:28 UTC
apm, ouch.

Try commenting out device_suspend() and device_resume() calls from apm.c to see
if they are causing the problem

And also try to get ACPI suspend working...
Comment 5 Antonino Daplas 2005-08-02 05:57:53 UTC
I fixed the suspend/resume hooks of savagefb, and I was able to resume
successfully from standy and mem. I still can't resume from disk, but it's not
fb related because I tried it with vgacon also.

Anyway, I'll try to concoct a patch that adds suspend and resume for neofb.  I
don't have this hardware so let's see. 
Comment 6 Antonino Daplas 2005-08-02 06:26:40 UTC
Created attachment 5476 [details]
Add suspend/resume for neofb pci_driver

Can you try this patch?  It's a quick hack, compile tested only as I don't have
the hardware.
Comment 7 Antonino Daplas 2005-08-02 06:37:29 UTC
Created attachment 5477 [details]
Add suspend/resume for neofb pci_driver (2)

Oops, forgot to set the power state on resume.	Try this instead.
Comment 8 Pavel Machek 2005-08-08 04:54:13 UTC
Just for the record, attached patch (id 5477) looks good to me. If it fixes the
problem, great and it should go to neofb maintainer.
Comment 9 Antonino Daplas 2005-08-08 18:15:37 UTC
Russel replied to me that the problem persists even if VGA is used.  So this is
not specific to the neofb driver, or to the framebuffer layer. I'm asking him to
check for "POST Video BIOS on Resume" in his BIOS setup, and to submit lspci -vvv
before and after resume.
Comment 10 Antonino Daplas 2005-08-09 23:40:59 UTC
I'm posting his reply:

	'Do you have an option to "POST Video BIOS on Resume" or
something like that in your BIOS setup?'
	No.

	'Also can you send the output of lspci -vvv before resume and
after resume?'
	I post the BEFORE, AFTER, and DIFF below.
	It does not change in kernel 2.6.11, but in 2.6.13 the status
line of the USB controller changed from:


< 	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-

to:

> > 	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort+ >SERR- <PERR-


(MAbort- to MAbort+), and the subsystem line on the Multimedia Audio
controller changed from:

< 	Subsystem: ESS Technology: Unknown device 8898

to:

> > 	Subsystem: IBM: Unknown device 0136

	Audio did not work on this particular episode of resume; it
usually does.


BEFORE:

00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03)
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR+ FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort+ >SERR- <PERR-
	Latency: 64
	Region 0: Memory at f8000000 (32-bit, prefetchable) [size=64M]
	Capabilities: [a0] AGP version 1.0
		Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3-
Rate=x1,x2
		Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW- Rate=<none>

00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)
(prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV+ VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 128
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=64
	I/O behind bridge: 0000f000-00000fff
	Memory behind bridge: f4100000-f47fffff
	Prefetchable memory behind bridge: f5000000-f5ffffff
	BridgeCtl: Parity- SERR- NoISA+ VGA+ MAbort- >Reset- FastB2B+

00:02.0 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
	Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 0

00:02.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01) (prog-if 80
[Master])
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 64
	Region 4: I/O ports at 10c0 [size=16]

00:02.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01) (prog-if 00
[UHCI])
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 64
	Interrupt: pin D routed to IRQ 11
	Region 4: I/O ports at 1060 [size=32]

00:02.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Interrupt: pin ? routed to IRQ 9

00:03.0 CardBus bridge: Texas Instruments PCI1251B
	Subsystem: IBM: Unknown device 0138
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 168, cache line size 08
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at 14000000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=00, secondary=02, subordinate=05, sec-latency=176
	Memory window 0: 0c000000-0dfff000 (prefetchable)
	Memory window 1: 0e000000-0ffff000
	I/O window 0: 00002000-00002fff
	I/O window 1: 00003000-00003fff
	BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+
	16-bit legacy interface ports at 0001

00:03.1 CardBus bridge: Texas Instruments PCI1251B
	Subsystem: IBM: Unknown device 0138
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 168, cache line size 08
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at 14001000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=00, secondary=06, subordinate=09, sec-latency=176
	Memory window 0: 10000000-11fff000 (prefetchable)
	Memory window 1: 12000000-13fff000
	I/O window 0: 00004000-00004fff
	I/O window 1: 00005000-00005fff
	BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+
	16-bit legacy interface ports at 0001

00:06.0 Communication controller: Lucent Microelectronics WinModem 56k (rev 01)
	Subsystem: CIS Technology Inc Lucent Win Modem
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at f4000000 (32-bit, non-prefetchable) [size=256]
	Region 1: I/O ports at 02e8 [size=8]
	Region 2: I/O ports at 1400 [size=256]
	Capabilities: [f8] Power Management version 2
		Flags: PMEClk- DSI+ D1- D2+ AuxCurrent=0mA PME(D0-,D1-,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:07.0 Multimedia audio controller: ESS Technology ES1969 Solo-1 Audiodrive
(rev 02)
	Subsystem: ESS Technology: Unknown device 8898
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 64 (500ns min, 6000ns max)
	Interrupt: pin A routed to IRQ 5
	Region 0: I/O ports at 1080 [size=64]
	Region 1: I/O ports at 10e0 [size=16]
	Region 2: I/O ports at 10d0 [size=16]
	Region 3: I/O ports at 10fc [size=4]
	Region 4: I/O ports at 10f8 [size=4]
	Capabilities: [c0] Power Management version 1
		Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

01:00.0 VGA compatible controller: Neomagic Corporation NM2200 [MagicGraph
256AV] (rev 20) (prog-if 00 [VGA])
	Subsystem: IBM: Unknown device 0137
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B+
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 128 (4000ns min, 63750ns max)
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at f5000000 (32-bit, prefetchable) [size=16M]
	Region 1: Memory at f4400000 (32-bit, non-prefetchable) [size=4M]
	Region 2: Memory at f4100000 (32-bit, non-prefetchable) [size=1M]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: [dc] Power Management version 1
		Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-



AFTER:

00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03)
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR+ FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort+ >SERR- <PERR-
	Latency: 64
	Region 0: Memory at f8000000 (32-bit, prefetchable) [size=64M]
	Capabilities: [a0] AGP version 1.0
		Status: RQ=32 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3-
Rate=x1,x2
		Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW- Rate=<none>

00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03)
(prog-if 00 [Normal decode])
	Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV+ VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 128
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=64
	I/O behind bridge: 0000f000-00000fff
	Memory behind bridge: f4100000-f47fffff
	Prefetchable memory behind bridge: f5000000-f5ffffff
	BridgeCtl: Parity- SERR- NoISA+ VGA+ MAbort- >Reset- FastB2B+

00:02.0 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02)
	Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 0

00:02.1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01) (prog-if 80
[Master])
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 64
	Region 4: I/O ports at 10c0 [size=16]

00:02.2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB (rev 01) (prog-if 00
[UHCI])
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort+ >SERR- <PERR-
	Latency: 64
	Interrupt: pin D routed to IRQ 11
	Region 4: I/O ports at 1060 [size=32]

00:02.3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 02)
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Interrupt: pin ? routed to IRQ 9

00:03.0 CardBus bridge: Texas Instruments PCI1251B
	Subsystem: IBM: Unknown device 0138
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 168, cache line size 08
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at 14000000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=00, secondary=02, subordinate=05, sec-latency=176
	Memory window 0: 0c000000-0dfff000 (prefetchable)
	Memory window 1: 0e000000-0ffff000
	I/O window 0: 00002000-00002fff
	I/O window 1: 00003000-00003fff
	BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+
	16-bit legacy interface ports at 0001

00:03.1 CardBus bridge: Texas Instruments PCI1251B
	Subsystem: IBM: Unknown device 0138
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 168, cache line size 08
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at 14001000 (32-bit, non-prefetchable) [size=4K]
	Bus: primary=00, secondary=06, subordinate=09, sec-latency=176
	Memory window 0: 10000000-11fff000 (prefetchable)
	Memory window 1: 12000000-13fff000
	I/O window 0: 00004000-00004fff
	I/O window 1: 00005000-00005fff
	BridgeCtl: Parity- SERR- ISA- VGA- MAbort- >Reset+ 16bInt+ PostWrite+
	16-bit legacy interface ports at 0001

00:06.0 Communication controller: Lucent Microelectronics WinModem 56k (rev 01)
	Subsystem: CIS Technology Inc Lucent Win Modem
	Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at f4000000 (32-bit, non-prefetchable) [size=256]
	Region 1: I/O ports at 02e8 [size=8]
	Region 2: I/O ports at 1400 [size=256]
	Capabilities: [f8] Power Management version 2
		Flags: PMEClk- DSI+ D1- D2+ AuxCurrent=0mA PME(D0-,D1-,D2+,D3hot+,D3cold+)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:07.0 Multimedia audio controller: ESS Technology ES1969 Solo-1 Audiodrive
(rev 02)
	Subsystem: IBM: Unknown device 0136
	Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B-
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 64 (500ns min, 6000ns max)
	Interrupt: pin A routed to IRQ 5
	Region 0: I/O ports at 1080 [size=64]
	Region 1: I/O ports at 10e0 [size=16]
	Region 2: I/O ports at 10d0 [size=16]
	Region 3: I/O ports at 10fc [size=4]
	Region 4: I/O ports at 10f8 [size=4]
	Capabilities: [c0] Power Management version 1
		Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-

01:00.0 VGA compatible controller: Neomagic Corporation NM2200 [MagicGraph
256AV] (rev 20) (prog-if 00 [VGA])
	Subsystem: IBM: Unknown device 0137
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping-
SERR- FastB2B+
	Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
	Latency: 128 (4000ns min, 63750ns max)
	Interrupt: pin A routed to IRQ 11
	Region 0: Memory at f5000000 (32-bit, prefetchable) [size=16M]
	Region 1: Memory at f4400000 (32-bit, non-prefetchable) [size=4M]
	Region 2: Memory at f4100000 (32-bit, non-prefetchable) [size=1M]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: [dc] Power Management version 1
		Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-


DIFF:

33c33
< 	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort+ >SERR- <PERR-
---
> > 	Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort-
<MAbort- >SERR- <PERR-
86c86
< 	Subsystem: IBM: Unknown device 0136
---
> > 	Subsystem: ESS Technology: Unknown device 8898

Comment 11 russell bell 2005-08-15 17:45:43 UTC
For those who have not kept up on the news, this bug has nothing to do with the
neofb driver:   it happens when I use VGA16 as well.

It definitely does not happen if I don't build the apm.ko module, but then
I don't get any suspension at all.  I commented out the device_suspend and
device_resume calls in apm.c but that made no difference.  I notice that
when I build apm.ko the compiler warns that pm_send_all is deprecated.  It
is now just a return in include/linux/pm.h.  Could this have something to do 
with it?
Comment 12 russell bell 2005-11-08 18:41:27 UTC
Hey, guys, I thought I delivered the news that the problem happens even
with the VGA driver, so it's not a neofb specific problem.

I used the apm.c from 2.6.11 (the last kernel on which this worked properly;
I have 2.6.14 installed also) and the problem still happened.

I tried to write an unblank routine.  I called unblank_screen, a routine
that vt.c exports, but it is in the kernel and the linker cannot link
to it.  How do I link to a routine in the kernel?
Comment 13 Antonino Daplas 2005-11-08 21:17:09 UTC
You can probably call setterm -powersave on. However, past kernels have a buggy
implementation of console blanking.  Someone did submit a patch a few days ago
that will fix this but I haven't tested it yet.  Wait for the next mm or rc
release if you want to test that this command works. 
Comment 14 Andrew Morton 2005-11-08 21:22:44 UTC
Created attachment 6500 [details]
fix-console-blanking.patch

This is the patch to which Tony is referring.	Please test..
Comment 15 russell bell 2005-11-18 21:42:19 UTC
fix-console-blanking.patch made no difference.

setterm -powersave on  did not unblank the screen.

russell bell
Comment 16 Pavel Machek 2005-11-20 06:51:25 UTC
If it works in 2.6.11 and is broken in 2.6.12, can you simply binary search for
the patch that breaks it? And... you are using apm, right?
Comment 17 russell bell 2005-11-20 13:11:00 UTC
I searched the 2.6.11 -> 2.6.12 patch file for everything that
used the word blank, suspend, or resume, restoring all the
2.6.11 code, and I have substituted the apm.c from 2.6.11.  
None have made a difference.  I have even commented out 
everything that refers to screen blanking.
Nothing has made a difference.

Yes, I use apm.  My old computer does not support acpi.
Comment 18 Pavel Machek 2005-11-21 11:36:58 UTC
Well, git bisect is probably tool to use. There are good intros on the web...
Comment 19 russell bell 2005-11-24 18:54:46 UTC
Find a patch that repairs this in http://rickstewart.com/VTPatch

I had restored the portion with the unblank routine but not the
portion that calls it when trying to diagnose it myself.  The
patch works with some automatic relocation on 2.6.14.

Thanks, Pavel!
Comment 20 Pavel Machek 2005-11-25 11:51:05 UTC
AYeee.... okay, this reintroduces old pm code. Not good, we want it removed.
Could you introduce platform_device and redo the same code, but using sysfs
infrastructure?

You can find simple user of plaftorm_device code in arch/arm/common/locomo.c ...
Comment 21 Antonino Daplas 2005-11-25 17:27:22 UTC
Created attachment 6683 [details]
Convert to platform device, add suspend/resume hooks

Pavel is right, that's legacy code.

Try this patch instead.  It converts vgacon to a platform_device (which
basically
does nothing in its probe functions because vgacon is initialized directly by
early console init), but it adds suspend/resume hooks.

Tested in my system with echo {standby, mem, disk} > /sys/power/state .
Comment 22 russell bell 2005-11-27 13:48:05 UTC
With what version of the kernel must I use this patch?  I upgraded to
2.6.15-rc2, the latest on the site, and the patch is inappropriate.
The first and third hunks worked by relocating themselves.  The second
hunk I tried to put in by hand since it is just one line, just before
'return display_desc', but that caused an immediate crash on boot.
Then I noticed that the 'cue' for the second hunk refers to some
constants absent from 2.6.15-rc2, thus I need stuff outside vgacon.c
to make this patch work.
Comment 23 Antonino Daplas 2005-11-27 14:21:00 UTC
I use the mm tree.  Get it here,
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.15-rc2/2.6.15-rc2-mm1/2.6.15-rc2-mm1.bz2,
apply it on top of linux-2.6.15-rc2, then my patch.

Comment 24 russell bell 2005-11-27 18:29:49 UTC
I did as you instructed.  The second hunk of your patch still fails.
I put it in by hand (the 'vga_init = 1' before 'return display_desc' 
and my system crashes on boot.
Comment 25 Antonino Daplas 2005-11-27 20:14:50 UTC
Strange. I just tried the patch on linux-2.6.15-rc2-mm1 and it applied, albeit
with a single offset.  I also recompiled my kernel to support apm instead of
acpi.  I did not experience any crash but my system did not finish booting, and
I have to do a hard reset. But that's with and without the patch.

Can you describe what the crash is? Any oops, display corruption, etc?

Anyway, can you also post your .config?

Tony
Comment 26 russell bell 2005-11-28 16:47:15 UTC
A build from the unpatched 2.6.15-rc2-mm source works for me.
Your patch works automatically if I set the fuzz to 3.
When I boot with it, the screen blanks after 
'BIOS data check successful' and makes no further
progress.  The logs record nothing of the boot.

I have backed out the patch, built the unpatched kernel
again, confirmed that it worked, then installed the patch
again to confirm that it fails.

You can find my .config at http://rickstewart.com/config
Comment 27 Antonino Daplas 2005-11-28 17:00:13 UTC
Can you boot with video=neofb:off?
Comment 28 russell bell 2005-11-29 12:03:47 UTC
'Can you boot with video=neofb:off?'

No.  The same thing happens.
Comment 29 Antonino Daplas 2005-11-29 13:18:28 UTC
Created attachment 6714 [details]
Dummy con on startup

Getting stranger...

Can you try this patch?  This patch will force your initial console to dummycon
and then you'll have vgacon only when vgacon_probe get's called.

It's only a test patch so we can localize where the hang occurs. If you
complete the boot process, test if suspend/resume works for you.
Comment 30 russell bell 2005-11-29 21:58:21 UTC
'Can you try this patch?  This patch will force your initial console to dummycon
and then you'll have vgacon only when vgacon_probe get's called.'
This crashes in the same manner.

If you give me an idea of what you are trying to do then I can try things on
my own.  I can program but I have not hacked the Linux kernel.  Is there some
way to put in code to report progress, at least on the screen?  Is the BIOS
still usable?  I wrote in assembler for years, systems software, not that
I was a star, but I could track problems with output to the screen through
the BIOS before the OS loaded.
Comment 31 Antonino Daplas 2005-11-29 23:07:40 UTC
Created attachment 6717 [details]
Add suspend/resume for vgacon

Forget the previous patches.  I think I was able to duplicate the hang when I
have a vga= in my option parameter.  The previous patch conflicts with vesafb.

Try this patch.
Comment 32 Antonino Daplas 2005-11-29 23:12:38 UTC
> If you give me an idea of what you are trying to do then I can try things on
> my own.  I can program but I have not hacked the Linux kernel.  Is there some
> way to put in code to report progress, at least on the screen?  Is the BIOS
> still usable?  I wrote in assembler for years, systems software, not that
> I was a star, but I could track problems with output to the screen through
> the BIOS before the OS loaded.

The main problem is that the vgacon driver is not hooked up to power management.
 Another difficulty is that vgacon is unusual in that it has to be active very,
very early during the boot process. Which means that it doesn't go through the
kernel's standard initcalls. So with this patch, we let vgacon initialize when
vgacon_startup() is directly called by con_init() in vt.c.  Since this is very
early, we cannot setup the suspend/hooks yet.  Later on, we do hookup to power
management when vgacon_start() is called by module_init().

Another difficulty is that vgacon_startup can fail (ie, if vesafb is active), so
we flag that with vga_init.
Comment 33 Adrian Bunk 2005-12-29 05:57:00 UTC
Russell, does the patch from comment 31 fix the problem for you?
Comment 34 russell bell 2005-12-30 20:49:38 UTC
No.  I must have forgotten to post that response.  I tried almost
immediately.

 
Comment 35 Antonino Daplas 2006-04-26 06:23:44 UTC
If you can use acpi, try booting with

acpi_sleep=s3_bios,s3_mode

If not, try this script:

vbetool vbestate save > /tmp/vbestate
/* suspend here */
vbetool post
sleep 1
vbetool vbestate restore < /tmp/vbestate

Comment 36 russell bell 2006-04-28 10:25:50 UTC
ACPI will put the machine (a new machine:  the
old machine did not support ACPI) to sleep with
mode 3 but I have found nothing to wake it up.
What is supposed to?  The keyboard is ignored
but the log files record activity during the
sleep period, so I know it's on.
Comment 37 Pavel Machek 2006-04-28 11:17:49 UTC
If you see periodic log entries, machine is not really sleeping. Power button
should be enough to wake the machine up, but your machine is probably not sleeping.

Try c-a-d to see if it reboots. Ouch and open new bugreport if this is different
machine (and different problem).
Comment 38 Pavel Machek 2006-05-19 02:55:59 UTC
This bug is reported for 2.6.12 --- that's really historic. If it still happens
with new kernel, please open new report.
Comment 39 russell bell 2006-05-19 20:27:24 UTC
This still happens in 2.6.16.16.




 
Comment 40 Pavel Machek 2006-05-20 09:15:07 UTC
Okay, so some variant of 

@@ -3209,6 +3218,24 @@ void vcs_scr_writew(struct vc_data *vc, 
 	}
 }
 
+static int pm_con_request(struct pm_dev *dev, pm_request_t rqst, void *data)
+{
+	switch (rqst)
+	{
+	case PM_RESUME:
+		acquire_console_sem();
+		unblank_screen();
+		release_console_sem();
+		break;
+	case PM_SUSPEND:
+		acquire_console_sem();
+		do_blank_screen(0);
+		release_console_sem();
+		break;
+	}
+	return 0;
+}

...fixes it for you. Try to find variant that is acceptable with new kernel --
looks like Antonio has some ideas. Or just hardcode 

+		acquire_console_sem();
+		unblank_screen();
+		release_console_sem();

...into the right place into APM. If that works for you, it may even be
acceptable. (Original hook is in vt subsystem, and hooking vt subsystem is not
really going to be simple. Plus we only want that in apm case).
Comment 41 Pavel Machek 2006-09-27 16:27:32 UTC
Ping? Did this get somehow solved for 2.6.18?
Comment 42 russell bell 2006-09-28 16:49:48 UTC
Sorry!  My new machine does not support APM.  The one that exhibits this
symptom I lent out.  I will have to fetch it back to test it.  I have not
yet.
Comment 43 Pavel Machek 2006-09-29 04:05:58 UTC
Ok, if we can't reproduce it, lets close it for now. Reopen if still present.

Note You need to log in before you can comment on or make changes to this bug.