Bug 14229

Summary: tty change breaks resume from hibernation on MSI Wind U100
Product: Drivers Reporter: Rafael J. Wysocki (rjw)
Component: OtherAssignee: drivers_other
Status: CLOSED CODE_FIX    
Severity: normal CC: alan, greg, torvalds
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 2.6.31-git-94a8d5caba Subsystem:
Regression: Yes Bisected commit-id:
Bug Depends on:    
Bug Blocks: 14230    

Description Rafael J. Wysocki 2009-09-25 22:20:11 UTC
Resume from hibernation doesn't work any more on my MSI Wind U100 with the current mainline.  It hangs forever after devices have been resumed, apparently during the console switch back to the terminal where s2disk was started (the problem seems to be only reproducible with s2disk).

Bisection turned up the following commit as the one that introduced the regression:

commit b50989dc444599c8b21edc23536fc305f4e9b7d5
Author: Alan Cox <alan@linux.intel.com>
Date:   Sat Sep 19 13:13:22 2009 -0700

    tty: make the kref destructor occur asynchronously

    We want to be able to sleep in the destructor for USB at least. It isn't a
    hot path so just pushing it to a work queue doesn't really cause any
    difficulty.

    Signed-off-by: Alan Cox <alan@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

I'm not sure about the actual root cause at the moment, but it appears to be a race condition of some sort, as I'm able to reproduce this on a faster machine.
Comment 1 Rafael J. Wysocki 2009-09-27 16:01:57 UTC
Handled-By : From: Dave Young <hidave.darkstar@gmail.com>
Patch : http://patchwork.kernel.org/patch/50321/
Comment 2 Rafael J. Wysocki 2009-09-27 16:02:51 UTC
Not-Handled-By : From: Dave Young <hidave.darkstar@gmail.com>
Handled-By : Dave Young <hidave.darkstar@gmail.com>
Comment 3 Linus Torvalds 2009-09-27 21:44:12 UTC
Committed (with fixes) as f278a2f7bbc2239f479eaf63d0b3ae573b1d746c.

The reason it causes problems for suspend and hibernate is that the X server will try to do a VT_ACTIVATE ioctl on the tty, but it gets rejected with EIO due to the hangup handling having been delayed due to the asynchronous workqueue thing.

Please verify that current git (I'll release -rc1 soon) works for everybody.