LKML Archive on
help / color / mirror / Atom feed
From: Pavel Machek <>
To: "Rafael J. Wysocki" <>
Cc: Greg KH <>, Alan Stern <>,
	Andrew Morton <>,
	David Brownell <>,
	LKML <>,
	pm list <>
Subject: Re: [PATCH 1/3] PM: Handle device registrations during suspend/resume
Date: Thu, 13 Mar 2008 09:37:13 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Wed 2008-03-12 00:57:22, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <>
> Modify the PM core to protect its data structures, specifically the
> dpm_active list, from being corrupted if a child of the currently
> suspending device is registered concurrently with its ->suspend()
> callback.  In that case, since the new device (the child) is added
> to dpm_active after its parent, the PM core will attempt to
> suspend it after the parent, which is wrong.
> Introduce a new member of struct dev_pm_info, called 'sleeping',
> and use it to check if the parent of the device being added to
> dpm_active has been suspended, in which case the device registration
> fails.  Also, use 'sleeping' for checking if the ordering of devices
> on dpm_active is correct.
> Introduce variable 'all_sleeping' that will be set to 'true' once all
> devices have been suspended and make new device registrations fail
> until 'all_sleeping' is reset to 'false', in order to avoid having
> unsuspended devices around while the system is going into a sleep state.
> Remove pm_sleep_rwsem which is not necessary any more.
> Special thanks to Alan Stern for discussions and suggestions that
> lead to the creation of this patch.
> Signed-off-by: Rafael J. Wysocki <>


(cesky, pictures)

  reply	other threads:[~2008-03-13 10:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-11 23:55 [PATCH 0/3] PM core fixes Rafael J. Wysocki
2008-03-11 23:57 ` [PATCH 1/3] PM: Handle device registrations during suspend/resume Rafael J. Wysocki
2008-03-13  8:37   ` Pavel Machek [this message]
2008-03-13 20:54   ` patch pm-handle-device-registrations-during-suspend-resume.patch added to gregkh-2.6 tree gregkh
2008-03-11 23:59 ` [PATCH 2/3] Driver core: Call device_pm_add() after bus_add_device() in device_add() Rafael J. Wysocki
2008-03-13  9:30   ` Pavel Machek
2008-03-13 20:54   ` patch driver-core-call-device_pm_add-after-bus_add_device-in-device_add.patch added to gregkh-2.6 tree gregkh
2008-03-12  0:01 ` [PATCH 3/3] PM: make wakeup flags available whenever CONFIG_PM is set Rafael J. Wysocki
2008-03-13  9:31   ` Pavel Machek
2008-03-13 20:54   ` patch pm-make-wakeup-flags-available-whenever-config_pm-is-set.patch added to gregkh-2.6 tree gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH 1/3] PM: Handle device registrations during suspend/resume' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).