lkml.org 
[lkml]   [2008]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] PM: Acquire device locks on suspend
On Tue, 8 Jan 2008, Rafael J. Wysocki wrote:

> Appended is what I managed to put together today.
>
> It probably still has some problems, but I'm not seeing them right now (too
> tired). At least, it doesn't break my system. ;-)
>
> Please review.

Okay, this seems to be better. I like the way the complicated tests
are all localized in power/main.c.

In dpm_resume() you shouldn't need to use dpm_list_mtx at all, because
the list_move_tail() comes before the resume_device(). It's the same
as in dpm_power_up().

The same is true for dpm_suspend(). Once all the device have been
locked, there shouldn't be any other tasks accessing the dpm lists.
Hence there should be no need to protect the list.

Which reminds me, the kerneldoc for device_pm_schedule_removal() is
inaccurate. The routine always just moves the device to dpm_destroy
list for later processing.

Also, the kerneldoc for destroy_suspended_device() should contain an
extra paragraph warning that the routine should never be called except
within the scope of a system sleep transition. In practice this means
it has to be directly or indirectly invoked by a suspend or resume
method.

It looks good.

Alan Stern



\
 
 \ /
  Last update: 2008-01-09 22:05    [W:0.184 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site