Bug 518251

Summary: Machine locks up after a second display is removed.
Product: [Fedora] Fedora Reporter: Christian Lupien <christian.lupien>
Component: xorg-x11-drv-intelAssignee: Adam Jackson <ajax>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: ajax, campbecg, cunio, mcepl, xgl-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-06-28 14:10:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Christian Lupien 2009-08-19 16:47:23 UTC
Description of problem:
After connecting then disconnecting an external (VGA) display to my laptop, if I try to suspend the machine locks up (freeze). The mouse, keyboard are unresponsive,  the machine stops all access to the disk and the screen does not update anymore (but it stays on). The only option is a hard shutdown of the machine (holding the power button for 3 seconds).

After some exploration I discovered that I don't really need another display and that the problem is not due to suspend but to something going on during the screen locking (I had the gnome-power-manager lock the screen when suspending with the gui or pressing the power button). If I just called pm-suspend as root on the command line there was no problem.

So I found a simpler way of causing the crash

Version-Release number of selected component (if applicable):
xlockmore-5.26.1-2.fc11.i586
xorg-x11-drv-intel-2.7.0-7.fc11.i586
kernel-2.6.29.6-217.2.8.fc11.i586

How reproducible:
Always

Steps to Reproduce:
There is no need to attach a secondary display. My stand alone laptop is enough. 
1. execute: xrandr --output VGA1 --auto
2. execute: xrandr --output VGA1 --off
3. xlock -inwindow -verbose -debug
  
Actual results:
The machine locks up after a block window is displayed (but before the window manager decoration are added)

Expected results:
The machine should not lock up and xlock should work as usuasl (and it normally does if the xrandr pair of commands is not executed).

Additional info:
As I mentionned above there are many ways to trigger this bug I showed the simplest one but using the GUI to perform similar operation (activating/deactivating displays, suspending or just locking the screen with gnome menus) does the same.

If I boot the kernel with the nomodeset option then this problem is gone and everything works properly.

Machine: Fujitsu LifeBook S6231
lspci -nn -v:
00:02.0 VGA compatible controller [0300]: Intel Corporation 82852/855GM Integrated Graphics Device [8086:3582] (rev 02) (prog-if 00 [VGA controller])
	Subsystem: Fujitsu Limited. Device [10cf:126b]
	Flags: bus master, fast devsel, latency 0, IRQ 11
	Memory at d8000000 (32-bit, prefetchable) [size=128M]
	Memory at d0000000 (32-bit, non-prefetchable) [size=512K]
	I/O ports at 2450 [size=8]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: [d0] Power Management version 1
	Kernel driver in use: i915
	Kernel modules: i915
In am using the Option "Tiling" "False" xorg configuration (otherwise mplayer and such don't work, screen is garbled).
The resolution is 1024x768

Comment 1 Christian Lupien 2009-08-23 23:06:02 UTC
I found other ways to freeze the machine. These seem different. The screens goes black and freezes there. There are 2 ways to produce this:
1- press the display switch hotkey without a monitor connected to the VGA output
2- execute "cat /proc/acpi/video/VGA/CRT/state" also without a monitor attached

In both case, if the machine boots with nomodeset, the problem goes mostly away. Without nomodeset the hang happens every time. With nomodeset it happens only sometimes (I think after playing with xrandr).

If found the culprit for this one. My temporary fix does not change the other type of freeze reported above.

So the problem is that both ways of producing the freeze execute the same acpi code which produces the freeze.
The code is :

Method (UPDD, 0, NotSerialized)
                {
                    If (LGreaterEqual (\_SB.OSTP (), 0x08))
                    {
                        Notify (\_SB.PCI0, 0x00)
                    }
                    Else
                    {
                        Notify (\_SB.PCI0.VGA, 0x00)

                    }

                    Sleep (0x02EE)
                    Store (0xFF, DVID)
                    Store (0x8E, CMD)
                    Store (Zero, SSMI)
                }
with the method \_SB.OSTP () returning 0 on my machine (It only checks for various windows version)
OperationRegion (PSIO, SystemIO, 0x0000FE00, 0x00000002)
OperationRegion (PSBF, SystemMemory, 0x3F6FBE92, 0x00000090)
     Field (\_SB.PSIO, ByteAcc, NoLock, Preserve)
            {
                SSMI,   8
            }
     Field (\_SB.PSBF, ByteAcc, NoLock, Preserve)
            {
                CMD,    8, 
                DVID,   32, 
                PSDT,   32
            }

The problem seems to be with the "Store (Zero, SSMI)" line. I commented it out and recompiled my DSDT. With the tuxonice kernel I was able to load it and my problem disappeared. I was able to do 1- and 2- above without any crash. In the gui, the output does change properly if a display is connected. But the output of "cat /proc/acpi/video/VGA/CRT/state" does not change anymore.

Comment 2 Jacek Pawlyta 2009-09-29 11:10:51 UTC
I'm confirming the same bug. Switching off external monitor causes the machine to lockup when KMS is active.

Comment 3 Matěj Cepl 2009-11-05 18:36:36 UTC
Since this bugzilla report was filed, there have been several major updates in various components of the Xorg system, which may have resolved this issue. Users who have experienced this problem are encouraged to upgrade their system to the latest version of their packages. For packages from updates-testing repository you can use command

yum upgrade --enablerepo='*-updates-testing'

Alternatively, you can also try to test whether this bug is reproducible with the upcoming Fedora 12 distribution by downloading LiveMedia of F12 Beta available at http://alt.fedoraproject.org/pub/alt/nightly-composes/ . By using that you get all the latest packages without need to install anything on your computer. For more information on using LiveMedia take a look at https://fedoraproject.org/wiki/FedoraLiveCD .

Please, if you experience this problem on the up-to-date system, let us now in the comment for this bug, or whether the upgraded system works for you.

If you won't be able to reply in one month, I will have to close this bug as INSUFFICIENT_DATA. Thank you.

[This is a bulk message for all open Fedora Rawhide Xorg-related bugs. I'm adding myself to the CC list for each bug, so I'll see any comments you make after this and do my best to make sure every issue gets proper attention.]

Comment 4 Christian Lupien 2009-11-07 19:41:42 UTC
I tried Fedora 12 beta (live image on usb stick).
With that version, the problem in the original description is gone.

However the problem in the first comment is still present.
With some more checking I believe it is a kernel problem because:
1- starting linux in single mode (single kernel option)
2- cat /proc/acpi/video/VGA/CRT/state
 --> This produces a hang and the X server is not even running.
 This with kernel 2.6.31.1-56.fc12.i686
 Here the i915 modules is running

If I add the nomodeset kernel option in step 1-, the screen flickers but does not
hang the machine (the i915 module is still loaded but not used)

I checked the current Fedora 11 kernel and some older ones and they all behave in the same way.

P.S. I did not check that my ACPI fix works but I expect it to work.

Comment 5 Christian Lupien 2009-11-08 08:45:19 UTC
I created a kernel bug #14556
  http://bugzilla.kernel.org/show_bug.cgi?id=14556

For the observations in comment 1 and 4

Comment 6 Christian Lupien 2009-11-10 06:25:56 UTC
I can prevent the hotkey from hanging the machine by executing:
 echo 6 > /proc/acpi/video/VGA/DOS
(The value was 4 before that command)

This basically disables the hotkey (Fn-F8) on my system. It does not do anything anymore but at least it does not hang the machine either.

I can activate displays with xrandr and the display preference GUI.

Comment 7 Chris Campbell 2009-11-13 17:56:22 UTC
Christian, in comment #4 you indicate that THIS bug is closed, is that correct? I'm sorry, but I have gotten confused with your comments in #5 and #6. 

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 8 Christian Lupien 2009-11-13 19:07:33 UTC
Sorry, it is my fault.
The problem in the original description of the bug report has been solved.

However, the additional problems I reported in comments 1 (part of 4 and 5,6)
are not solved. I should have opened another bug report for them.

I could still do that if you want me to.

Comment 9 Bug Zapper 2010-04-28 09:50:17 UTC
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Bug Zapper 2010-06-28 14:10:54 UTC
Fedora 11 changed to end-of-life (EOL) status on 2010-06-25. Fedora 11 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.