public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [giri@lmc.cs.sunysb.edu: Resume from suspend-to-ram]
       [not found] ` <20040220235512.GA27779-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org>
@ 2004-02-20 23:57   ` Benjamin Herrenschmidt
       [not found]     ` <1077321457.9623.27.camel-ZSGxbZoyBwc@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2004-02-20 23:57 UTC (permalink / raw)
  To: Kronos; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Giridhar Pemmasani


> Since new radeonfb has suspend/resume driver model, I thought I might
> give it a try, but still the laptop would hang during resume. With a
> bit of trial and error (and some guess work), I got the laptop to
> resume successfully with the following patch.

> .../.../

That's interesting. You are basically preventing fbdev from resuming
at all. Well, partially, since you still have the radeonfb_set_par,
which is supposed to set back the mode.

So X manage to restore the chip in a way that radeonfb doesn't.

Can you send me a dump of XFree log after such a successful suspend
& resume phase ?

Ben.




-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* Re: [giri@lmc.cs.sunysb.edu: Resume from suspend-to-ram]
       [not found]         ` <20040221041647.2F8307831D-Yo/1PYb2HdawRS80dfYGFoIJIQD0bWaD@public.gmane.org>
@ 2004-02-21  4:13           ` Benjamin Herrenschmidt
       [not found]             ` <1077336792.17072.30.camel-ZSGxbZoyBwc@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2004-02-21  4:13 UTC (permalink / raw)
  To: Giridhar Pemmasani; +Cc: Kronos, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Sat, 2004-02-21 at 15:16, Giridhar Pemmasani wrote:
> Actually there was another patch that I missed. 
> 
> I also had to patch radeon driver in XFree86 to softboot/POST. This
> patch is from
> http://mrohne.home.cern.ch/mrohne/P2120/P2120_Linux_S3.html (actually
> there is no patch there, but I didn't want to post his email address
> here, but if you need to contact him, go to the top of this link). 

Ahhhh ... that explains it.. yes, we need to re-POST the card.

I'm afraid in the kernel, that will be a problem, unless we can
do that from real mode some way... my knowledge of x86 isn't good
enough. One thing is sure, we can't rely on the PCI ROM of the
card having a valid useable BIOS image, it's usually hidden
somewhere with the main BIOS, so either we use the RAM image
at c0000 or we ask the main BIOS to re-post the card.

Ben.



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* Re: [giri@lmc.cs.sunysb.edu: Resume from suspend-to-ram]
       [not found]     ` <1077321457.9623.27.camel-ZSGxbZoyBwc@public.gmane.org>
@ 2004-02-21  4:16       ` Giridhar Pemmasani
       [not found]         ` <20040221041647.2F8307831D-Yo/1PYb2HdawRS80dfYGFoIJIQD0bWaD@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Giridhar Pemmasani @ 2004-02-21  4:16 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Kronos, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


Actually there was another patch that I missed. 

I also had to patch radeon driver in XFree86 to softboot/POST. This
patch is from
http://mrohne.home.cern.ch/mrohne/P2120/P2120_Linux_S3.html (actually
there is no patch there, but I didn't want to post his email address
here, but if you need to contact him, go to the top of this link). 

--- xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c.orig	2003-02-25 04:50:15.000000000 +0100
+++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c	2003-03-17 08:25:47.000000000 +0100
@@ -339,6 +339,7 @@
     "xf86InitInt10",
     "xf86FreeInt10",
     "xf86int10Addr",
+    "xf86ExecX86int10",
     NULL
 };
 
@@ -5736,6 +5737,15 @@
 
     RADEONTRACE(("RADEONEnterVT\n"));
 
+    { /* Softboot V_BIOS */
+      xf86Int10InfoPtr pInt = xf86InitInt10 (info->pEnt->index);
+      if (pInt) {
+        pInt->num = 0xe6;
+        xf86ExecX86int10 (pInt);
+        xf86FreeInt10 (pInt);
+      }
+    }
+
     if (info->FBDev) {
 	unsigned char *RADEONMMIO = info->MMIO;
 	if (!fbdevHWEnterVT(scrnIndex,flags)) return FALSE;
 

The XFree86 log after suspend/resume:

(WW) Open APM failed (/dev/apm_bios) (No such device)
(II) RADEON(0): Primary V_BIOS segment is: 0xc000
(II) RADEON(0): [RESUME] Attempting to re-init Radeon hardware.
(II) RADEON(0): [agp] Mode 0x1f000207 [AGP 0x8086/0x3340; Card 0x1002/0x4c66]
(II) USB Mouse: ps2EnableDataReporting: succeeded
(II) TouchPad: ps2EnableDataReporting: succeeded

I have checked that without softboot/POST above, the screen doesn't
get initialized properly (I see initially vertical lines in all
colors, then everything slowly turns to white).

-- 
Giri


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* Re: [giri@lmc.cs.sunysb.edu: Resume from suspend-to-ram]
       [not found]             ` <1077336792.17072.30.camel-ZSGxbZoyBwc@public.gmane.org>
@ 2004-02-21 17:40               ` Luca
  2004-02-22  0:49                 ` Giridhar Pemmasani
  0 siblings, 1 reply; 5+ messages in thread
From: Luca @ 2004-02-21 17:40 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Benjamin Herrenschmidt

Il Sat, Feb 21, 2004 at 03:13:12PM +1100, Benjamin Herrenschmidt ha scritto: 
> On Sat, 2004-02-21 at 15:16, Giridhar Pemmasani wrote:
> > Actually there was another patch that I missed. 
> > 
> > I also had to patch radeon driver in XFree86 to softboot/POST. This
> > patch is from
> > http://mrohne.home.cern.ch/mrohne/P2120/P2120_Linux_S3.html (actually
> > there is no patch there, but I didn't want to post his email address
> > here, but if you need to contact him, go to the top of this link). 
> 
> Ahhhh ... that explains it.. yes, we need to re-POST the card.
> 
> I'm afraid in the kernel, that will be a problem, unless we can
> do that from real mode some way... my knowledge of x86 isn't good
> enough. One thing is sure, we can't rely on the PCI ROM of the
> card having a valid useable BIOS image, it's usually hidden
> somewhere with the main BIOS, so either we use the RAM image
> at c0000 or we ask the main BIOS to re-post the card.

Giridhar  look into  your BIOS  for something  like "Run  VGABIOS if  S3
Resume" (I have  it under "Power Management") and set  it to "Yes". With
this option  the firmware  will re-init the  card BIOS  before returning
control to  Linux. If you  don't see  it then it's  a big  problem... we
can't go in real mode once Linux  is running. It may be possible to hack
up something in wakeup.S, before restoring processor state.

Without this option I have a hard lockup (no ping, no sysrq, nothing) on
resume. With it framebuffer is restored fine.

>From syslog:
PM: Preparing system for suspend
Stopping tasks: =============|
[...]
radeonfb: suspending to state: 2...
PM: Entering state.
 hwsleep-0265 [17] acpi_enter_sleep_state: Entering sleep state [S3]
PM: Finishing up.
hStart = 1048, hEnd = 1184, hTotal = 1344
vStart = 771, vEnd = 777, vTotal = 806
h_total_disp = 0x7f00a7    hsync_strt_wid = 0x910422
v_total_disp = 0x2ff0325           vsync_strt_wid = 0x860302
pixclock = 15384
freq = 6500
post div = 0x2
fb_div = 0x74
ppll_div_3 = 0x20074
lvds_gen_cntl: 08000008
radeonfb: resumed !

Very nice :)

Luca
-- 
Home: http://kronoz.cjb.net
Windows NT crashed.
I'm the Blue Screen of Death.
No one hears your screams.


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

* Re: [giri@lmc.cs.sunysb.edu: Resume from suspend-to-ram]
  2004-02-21 17:40               ` Luca
@ 2004-02-22  0:49                 ` Giridhar Pemmasani
  0 siblings, 0 replies; 5+ messages in thread
From: Giridhar Pemmasani @ 2004-02-22  0:49 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Luca wrote:

> Giridhar  look into  your BIOS  for something  like "Run  VGABIOS if  S3
> Resume" (I have  it under "Power Management") and set  it to "Yes". With
> this option  the firmware  will re-init the  card BIOS  before returning
> control to  Linux. If you  don't see  it then it's  a big  problem... we

Unfortunately there is no such option in BIOS for Dell Latitude D600.

> can't go in real mode once Linux  is running. It may be possible to hack
> up something in wakeup.S, before restoring processor state.

I am not sure exactly what is needed; X is able to POST (using int10?). I
haven't looked at X code, but is that using real mode?

Giri.



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click

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

end of thread, other threads:[~2004-02-22  0:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040220235512.GA27779@dreamland.darkstar.lan>
     [not found] ` <20040220235512.GA27779-sTXFmx6KbOnUXq0IF5SVAZ4oGUkBHcCu@public.gmane.org>
2004-02-20 23:57   ` [giri@lmc.cs.sunysb.edu: Resume from suspend-to-ram] Benjamin Herrenschmidt
     [not found]     ` <1077321457.9623.27.camel-ZSGxbZoyBwc@public.gmane.org>
2004-02-21  4:16       ` Giridhar Pemmasani
     [not found]         ` <20040221041647.2F8307831D-Yo/1PYb2HdawRS80dfYGFoIJIQD0bWaD@public.gmane.org>
2004-02-21  4:13           ` Benjamin Herrenschmidt
     [not found]             ` <1077336792.17072.30.camel-ZSGxbZoyBwc@public.gmane.org>
2004-02-21 17:40               ` Luca
2004-02-22  0:49                 ` Giridhar Pemmasani

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