Sometimes resuming leaves only a black lit screen, no unity8
Bug #1450017 reported by
Michael Terry
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
powerd (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
unity8 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Sometimes when I turn my dogfooding mako device on (running stable channel), I see a back lighted screen, but no unity8. It stays like that indefinitely, and I just have to hard-reset.
I haven't noticed any obvious correlations to the behavior. It just happens.
To post a comment you must log in.
OK, here's a wild theory. Looking at powerd/ libsuspend/ earlysuspend. c and reading the 0.5s kernel delay comments in bug 1421455...
Why don't earlysuspend_exit and _enter lock the mutex before making the sysfs_write call? Seems like they could miss the pthread_cond_signal call depending on thread timing.
Consider:
- Main powerd thread writes to /sys/power/state
- Kernel does it's thing, maybe takes a while, updates /sys/power/state
- Listening powerd thread notices FB_AWAKE state, locks mutex, emits cond_signal, and then blocks waiting for FB_SLEEP state
- Main powerd thread enters the mutex locking section, locks mutex, waits for FB_AWAKE signal (that it missed)
Now powerd is blocked forever until someone else writes to /sys/power/state, right?
If powerd simply locked the mutex before writing to /sys/power/state, the listening thread would be forced to wait to update fb_state until the main thread gave up the lock via pthread_cond_wait and no one would miss any cond_signals.
(Threading is not my forte, so I'm probably missing something.)