public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	pm list <linux-pm@lists.linux-foundation.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Greg KH <greg@kroah.com>, Len Brown <lenb@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexey Starikovskiy <astarikovskiy@suse.de>,
	David Brownell <david-b@pacbell.net>, Pavel Machek <pavel@ucw.cz>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 3)
Date: Tue, 25 Mar 2008 12:55:30 +0100	[thread overview]
Message-ID: <200803251255.31482.oliver@neukum.org> (raw)
In-Reply-To: <200803242318.21052.rjw@sisk.pl>

Am Montag 24 März 2008 schrieb Rafael J. Wysocki:
> -/*
> +/**
> + * struct pm_ops - device PM callbacks
> + *
>   * Several driver power state transitions are externally visible, affecting
>   * the state of pending I/O queues and (for drivers that touch hardware)
>   * interrupts, wakeups, DMA, and other hardware state.  There may also be
> @@ -122,6 +124,254 @@ typedef struct pm_message {
>   * to the rest of the driver stack (such as a driver that's ON gating off
>   * clocks which are not in active use).
>   *
> + * The externally visible transitions are handled with the help of the following
> + * callbacks included in this structure:
> + *
> + * @prepare: Prepare the device for the upcoming transition, but do NOT change
> + *     its hardware state.  Prevent new children of the device from being
> + *     registered and prevent new calls to the probe method from being made

How is a driver supposed to prevent calls to probe()? You can block in probe()
or you can fail it, but how do you prevent it from being called? User space
can trigger probe via sysfs. To be useful to driver writers, this has
to be clarified.

> + *     after @prepare() returns.  If @prepare() detects a situation it cannot
> + *     handle (e.g. registration of a child already in progress), it may return
> + *     -EAGAIN, so that the PM core can execute it once again (e.g. after the
> + *     new child has been registered) to recover from the race condition. This
> + *     method is executed for all kinds of suspend transitions and is followed
> + *     by one of the suspend callbacks: @suspend(), @freeze(), or @poweroff().

This could be understood so that disconnect() cannot be called.

> + *     The PM core executes @prepare() for all devices before starting to
> + *     execute suspend callbacks for any of them, so drivers may assume all of
> + *     the other devices to be present and functional while @prepare() is being
> + *     executed.  However, they may NOT assume anything about the availability
> + *     of the user space at that time.

Probably it should be mentioned that this is the time to allocate memory
if you have to. And it is too late to request firmware.

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-03-25 11:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-24 17:39 [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 3) Rafael J. Wysocki
2008-03-24 20:14 ` Alan Stern
2008-03-24 21:18   ` Rafael J. Wysocki
2008-03-25 15:06     ` Alan Stern
2008-03-25 20:35       ` Rafael J. Wysocki
2008-03-26 14:03         ` Alan Stern
2008-03-26 20:26           ` Rafael J. Wysocki
2008-03-26 20:36             ` Alan Stern
2008-03-26 20:54               ` Rafael J. Wysocki
2008-03-24 22:18   ` Rafael J. Wysocki
2008-03-25 11:55     ` Oliver Neukum [this message]
2008-03-25 12:40       ` Rafael J. Wysocki
2008-03-25 13:37         ` Oliver Neukum
2008-03-25 14:24           ` Alan Stern
2008-03-25 14:29         ` Alan Stern
2008-03-25 15:12     ` Alan Stern
2008-03-25 20:39       ` Rafael J. Wysocki

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=200803251255.31482.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=astarikovskiy@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox