Bug 15168 - [855GM] system freezes when switching to console or exiting xserver
Summary: [855GM] system freezes when switching to console or exiting xserver
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Jesse Barnes
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: NEEDINFO
: 15310 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-22 06:22 UTC by Maximilian Engelhardt
Modified: 2008-07-17 12:52 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
lspci output (1.92 KB, text/plain)
2008-03-22 06:23 UTC, Maximilian Engelhardt
no flags Details
dmesg output (20.46 KB, text/plain)
2008-03-22 06:23 UTC, Maximilian Engelhardt
no flags Details
Xorg.0.log (36.44 KB, text/x-log)
2008-03-22 06:24 UTC, Maximilian Engelhardt
no flags Details
xorg.conf (2.06 KB, text/plain)
2008-03-22 06:25 UTC, Maximilian Engelhardt
no flags Details
output of intel_reg_dumper (8.39 KB, text/plain)
2008-03-25 16:44 UTC, Maximilian Engelhardt
no flags Details
Flush posted writes in RestoreHWState paths (3.30 KB, patch)
2008-04-04 15:12 UTC, Jesse Barnes
no flags Details | Splinter Review
lspci -v (6.95 KB, text/plain)
2008-04-05 10:20 UTC, Maximilian Engelhardt
no flags Details
/proc/mtrr (335 bytes, text/plain)
2008-04-05 10:22 UTC, Maximilian Engelhardt
no flags Details
lspci -v on TM 663 (7.20 KB, text/plain)
2008-05-09 10:17 UTC, Arthur Spitzer
no flags Details
/proc/mtrr on TM 663 (335 bytes, text/plain)
2008-05-09 10:17 UTC, Arthur Spitzer
no flags Details
xorg log on TM 663 (50.72 KB, text/plain)
2008-05-09 11:02 UTC, Arthur Spitzer
no flags Details
xorg log on TM 663 (37.09 KB, text/plain)
2008-05-12 03:23 UTC, Arthur Spitzer
no flags Details
config and log files (381.30 KB, application/octet-stream)
2008-05-12 17:49 UTC, Marcelo Barros
no flags Details
debug register I/O (1.97 KB, patch)
2008-06-26 16:42 UTC, Jesse Barnes
no flags Details | Splinter Review
Xorg.0.log with patch from comment 38 (208.25 KB, text/x-log)
2008-06-27 20:07 UTC, Maximilian Engelhardt
no flags Details
make 855 chips use the force A quirk (996 bytes, patch)
2008-07-07 11:24 UTC, Jesse Barnes
no flags Details | Splinter Review

Description Maximilian Engelhardt 2008-03-22 06:22:36 UTC
System environment:
------------------------
--chipset: 855GM
--system architecture: i686
--xf86-video-intel: xserver-xorg-video-intel 2:2.2.99.901-1 from debian experimental, xserver from debian sid
--kernel version: 2.6.25-rc6-git4
--Linux distribution: debian sid
--Machine or mobo model: Acer TM 661lci


Bug Description:
Most times when switching to console or exiting the xserver the screen goes blank and the system freezes. Even SysRq doesn't work anymore in this situation. Sometimes the system doesn't freeze, but these cases are rare.
The problem happens with version 2:2.2.99.901-1 and 2:2.2.1-1 from debian. I think older versions are also affected but I didn't test them explicitly.


Reproduce steps:
1, start kdm
2, switch to console
or
1, start kdm
2, exit xserver (shut down system)
Comment 1 Maximilian Engelhardt 2008-03-22 06:23:15 UTC
Created attachment 15384 [details]
lspci output
Comment 2 Maximilian Engelhardt 2008-03-22 06:23:47 UTC
Created attachment 15385 [details]
dmesg output
Comment 3 Maximilian Engelhardt 2008-03-22 06:24:32 UTC
Created attachment 15386 [details]
Xorg.0.log
Comment 4 Maximilian Engelhardt 2008-03-22 06:25:00 UTC
Created attachment 15387 [details]
xorg.conf
Comment 5 Jesse Barnes 2008-03-25 15:29:13 UTC
Can you capture a register dump from a text console after a fresh boot?  You'll need to build the intel_reg_dumper tool from src/reg_dumper...
Comment 6 Julien Cristau 2008-03-25 15:36:39 UTC
On Tue, Mar 25, 2008 at 15:29:14 -0700, bugzilla-daemon@freedesktop.org wrote:

> --- Comment #5 from Jesse Barnes <jbarnes@virtuousgeek.org>  2008-03-25 15:29:13 PST ---
> Can you capture a register dump from a text console after a fresh boot?  You'll
> need to build the intel_reg_dumper tool from src/reg_dumper...

Or install the xserver-xorg-video-intel-dbg and libpciaccess0 packages
from sid, fwiw.
Comment 7 Maximilian Engelhardt 2008-03-25 16:44:17 UTC
Created attachment 15458 [details]
output of intel_reg_dumper

attaching output of intel_reg_dumper after a reboot without starting X as requested.
Comment 8 Michael Fu 2008-03-25 17:45:30 UTC
Maximilian, your dmesg shows that you are using vesafb, could you remove that kernel module and re-test? thanks.
Comment 9 Maximilian Engelhardt 2008-03-26 06:49:10 UTC
I did build a new 2.6.25-rc7 kernel without any framebuffers and it still freezes when switching to a console.

Comment 10 Jesse Barnes 2008-03-26 15:21:49 UTC
Ok, thanks, I'll check out the register dump to see if I can find any reason why we wouldn't be able to restore it at exit/vt switch time...
Comment 11 Jesse Barnes 2008-03-28 14:28:13 UTC
I'm getting an 8xx platform soon, hopefully I'll be able to reproduce this.

But in the meantime, can you give this a try to see if it fixes things for you?

diff --git a/src/i830_display.c b/src/i830_display.c
index 5e52aac..2836c66 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -372,8 +372,8 @@ i830FindBestPLL(xf86CrtcPtr crtc, int target, int refclk, intel_clock_t *best_cl
 void
 i830WaitForVblank(ScrnInfoPtr pScreen)
 {
-    /* Wait for 20ms, i.e. one cycle at 50hz. */
-    usleep(30000);
+    /* Wait for 300ms */
+    usleep(300000);
 }

 void
diff --git a/src/i830_driver.c b/src/i830_driver.c
index a19c8eb..6125f83 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2047,7 +2047,7 @@ SaveHWState(ScrnInfoPtr pScrn)
 static void
 i830_dpll_settle(void)
 {
-    usleep(10000); /* 10 ms *should* be plenty */
+    usleep(300000); /* 300 ms *should* be plenty */
 }

 static Bool
Comment 12 Maximilian Engelhardt 2008-03-29 13:24:02 UTC
I tried your patch (applied to 2.2.99.901 from debian experimental), but it doesn't help.
Comment 13 Jesse Barnes 2008-04-03 16:14:41 UTC
Here's another crazy one for you to try:

diff --git a/src/common.h b/src/common.h
index 9a3e0ac..ff1dc94 100644
--- a/src/common.h
+++ b/src/common.h
@@ -167,6 +167,7 @@ static inline void memcpy_volatile(volatile void *dst, const
       ErrorF("OUTREG(0x%lx, 0x%lx) in %s\n", (unsigned long)(addr),    \
                (unsigned long)(val), FUNCTION_NAME);                   \
    }                                                                   \
+   POSTING_READ(addr);                                                 \
 } while (0)

 /* To remove all debugging, make sure I810_DEBUG is defined as a
Comment 14 Maximilian Engelhardt 2008-04-04 14:39:39 UTC
Yeah, this one seems to fix the freeze.
Comment 15 Jesse Barnes 2008-04-04 15:12:58 UTC
Created attachment 15688 [details] [review]
Flush posted writes in RestoreHWState paths

Can you give this one a try?  It's a much smaller hammer than the previous patch, but hopefully it'll still fix your hang.
Comment 16 Maximilian Engelhardt 2008-04-05 09:30:35 UTC
looks like I was wrong, your patch from comment #13 doesn't fix the freeze, it just makes it happen less often.
Your patch from comment #15 doesn't seem to change anything.

I did all testing with version 2.2.99.901 of the driver.

Also some other things I noticed (but I'm not 100% sure about them):
If switching to console did work once, it also does work any further times, even after xserver restarts.
If it did work and I restart the laptop (choosing restart in kdm), a freeze happens less likely than with a normal boot (system is off, I hit the powerbutton).
Comment 17 Jesse Barnes 2008-04-05 10:09:46 UTC
Sigh, well it was a long shot anyway.

Can you attach lspci -v and /proc/mtrr from your machine?
Comment 18 Maximilian Engelhardt 2008-04-05 10:20:45 UTC
Created attachment 15704 [details]
lspci -v
Comment 19 Maximilian Engelhardt 2008-04-05 10:22:06 UTC
Created attachment 15705 [details]
/proc/mtrr
Comment 20 Arthur Spitzer 2008-05-09 10:09:35 UTC
Hi,

today I've upgradet
Comment 21 Arthur Spitzer 2008-05-09 10:16:08 UTC
Hi,

today I've upgraded the intel-driver to new version 2.3.0. After removing vesafb everything is shown correct in xorg. But now I have crashes during X restart or X  shutdown. 
Seems like I have a nearly equal machine. It's a Acer TravelMate 663.
I'll attach lspci -v and 

My system:  2.6.24-gentoo-r7 i686 Intel(R) Pentium(R) M processor 1600MHz
xorg-server 1.3.0.0
xf86-video-intel-2.3.0
no framebuffer
The crashes also happend with the 1.4.0.90 version of xorg-server.

Please let me know if I can help.
Comment 22 Arthur Spitzer 2008-05-09 10:17:15 UTC
Created attachment 16458 [details]
lspci -v on TM 663
Comment 23 Arthur Spitzer 2008-05-09 10:17:45 UTC
Created attachment 16459 [details]
/proc/mtrr on TM 663
Comment 24 Jesse Barnes 2008-05-09 10:31:14 UTC
Does your log show anything interesting when X exits?  Hopefully there's a backtrace?
Comment 25 Arthur Spitzer 2008-05-09 11:02:57 UTC
Created attachment 16460 [details]
xorg log on TM 663

I can't find anything interesting. Though I don't know whether there is a backtrace switch or something. I could turn on ModeDebug if you like.
Sorry, but I'm no developer. I don't know anything about patches. But I will try. 
Just say what you need.
Comment 26 Jesse Barnes 2008-05-09 11:11:21 UTC
Arthur, you may have a different problem from Max.  It looks like DRI isn't getting enabled in your configuration for some reason, maybe your Mesa is out of date?  Can you try upgrading that as well?  Check out Max's log for what things should look like when AIGLX initializes properly.
Comment 27 Arthur Spitzer 2008-05-09 13:21:19 UTC
you're right. I think that's because of the xorg-server version 1.3.

I updated mesa to 7.0.2 but the problem remains. today morning this wasn't an issue. I'll file a new bug. Thanks for the hint.

best regards,

Arthur
Comment 28 Arthur Spitzer 2008-05-12 03:23:40 UTC
Created attachment 16480 [details]
xorg log on TM 663

After upgrading the xorg-server to version 1.4.0.90, the AIGLX problem is gone, but the crashes remain by switching to console or logout. new Xorg.0.log attached.
Comment 29 Marcelo Barros 2008-05-12 17:49:04 UTC
Created attachment 16495 [details]
config and log files
Comment 30 Marcelo Barros 2008-05-12 17:49:54 UTC
I had the same problem with me (dell d505, intel 801 card).
I have tried to chance several options inside /etc/defaults/acpi-support, as discussed in
https://bugs.launchpad.net/ubuntu/+bug/38915/comments/61
No success. So, I decided to test if my system could hibernate from console, using /etc/acpi/hibernate.sh from command line. This gave me some freezes as well and a clue: acpi and kernel. I tried to boot using acpi=off but the system the system freezes as wells, less frequent, however.

Additional information:

- it is not possible to use ssh to log in from other machine, even ping does not respond. I had a similar problem in other machine but it was possible to log in. In that case, compiz was using 100% of CPU and I found a bug related to it at launchpad. In the current issue, I removed compiz to avoid more problems.
- I tried all options cited in "DebuggingACPI", like acpi=ht, noapic, pnpacpi=off, pci=noirq, nolapic ... freezing as well.

I am attaching related files for further investigation. Any other debug action, please let me know.

Reference:
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/229043
Comment 31 Jesse Barnes 2008-05-21 13:46:54 UTC
If this is firmware related, the "ForceEnablePipeA" option might prevent the crashes, has anyone tried that yet?  FWIW, my 855GM is solid on VT switch with the latest release.
Comment 32 Arthur Spitzer 2008-05-26 08:44:35 UTC
(In reply to comment #31)
"ForceEnablePipeA" realy makes a difference. System didn't crash since I enabled this option.
Comment 33 Marcelo Barros 2008-05-26 16:38:37 UTC
(In reply to comment #32)
> (In reply to comment #31)
> "ForceEnablePipeA" realy makes a difference. System didn't crash since I
> enabled this option.
> 

Following the comment, I added ForceEnablePipeA to xorg.conf, like below

Section "Device"
	... <other options here> ...
	Option 		"ForceEnablePipeA" "true"
EndSection

I tried 10x to reproduce the problem without success (login/logout). I was possible to hibernate and suspend as well. This option seems to solve the problem. I am using a newer gdm version as well (2.20.6-0ubuntu1) but problem was happening with it if I don't use the cited option. 

Just to keep the bug tracker up to date. I will test more.

Comment 34 Maximilian Engelhardt 2008-06-01 06:49:44 UTC
I added 'Option "ForceEnablePipeA" "true"' to my xorg.conf some time ago and didn't have a single crash since then. I will report here when things change, but till now it looks really good.
Comment 35 Michael Fu 2008-06-17 22:24:43 UTC
Jesse, is this fixed then?
Comment 36 Jesse Barnes 2008-06-18 09:24:00 UTC
No, I think the ForceEnablePipeA is just a workaround in this case, it shouldn't be needed.  We still need to figure out what's going on...
Comment 37 Dave Farrance 2008-06-26 09:39:39 UTC
Before I noticed this report, I'd raised a bug on the Mandriva bugzilla:
https://qa.mandriva.com/show_bug.cgi?id=41582

I tried version 1.7.4 of the Intel driver that Mandriva had forward-ported to Mandriva 2008.1 because of problems with the new Intel driver, and that worked OK.
However, I find that the ForceEnablePipeA hack works fine with the new 2.x driver.

Should this bug's priority setting be raised, given that the 855GME was standard fitting to Centrino laptops for some time?
Comment 38 Jesse Barnes 2008-06-26 16:42:00 UTC
Created attachment 17402 [details] [review]
debug register I/O

Can you try this patch?  Also, please add a section like this to your xorg.conf:
Section "ServerFlags"
        Option "Log" "sync"
EndSection

Hopefully the log syncing will give us a useful log of where the hang happens.  It would be best to start your X session by ssh'ing into the laptop and running X with the -verbose option, that way even if the log isn't preserved you'll see what's going on.
Comment 39 Maximilian Engelhardt 2008-06-27 20:07:01 UTC
Created attachment 17437 [details]
Xorg.0.log with patch from comment 38

See the attached logfile. My ssh connection didn't show anything more than the log.
Comment 40 Jesse Barnes 2008-07-02 09:45:13 UTC
*** Bug 15310 has been marked as a duplicate of this bug. ***
Comment 41 Jesse Barnes 2008-07-07 11:24:13 UTC
Created attachment 17565 [details] [review]
make 855 chips use the force A quirk

After talking with the hw guys, it seems that something like the pipe a force enable quirk is needed on 855 platforms in general.  Can you give this patch a try and make sure it works for you?  It should remove the need to add the option to your xorg.conf file...
Comment 42 Maximilian Engelhardt 2008-07-08 15:23:16 UTC
The patch seems to work after a quick test. I'll do some more testing and report back.
Comment 43 Michael Fu 2008-07-13 19:16:34 UTC
(In reply to comment #42)
> The patch seems to work after a quick test. I'll do some more testing and
> report back.
> 

max, any new finding? is everything ok?
Comment 44 Maximilian Engelhardt 2008-07-14 11:23:26 UTC
No problems so far. Till now everything works as it should.
Comment 45 Jesse Barnes 2008-07-17 12:52:05 UTC
Ok, pushed the patch as b37a2a8ca82279468e3806dcf77d5fa7bdd0e874.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.