public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: suggestion on resumption
Date: Fri, 27 Nov 2009 09:18:19 +0100	[thread overview]
Message-ID: <200911270918.20029.oliver@neukum.org> (raw)
In-Reply-To: <200911270147.44837.rjw@sisk.pl>

Am Freitag, 27. November 2009 01:47:44 schrieb Rafael J. Wysocki:
> On Thursday 26 November 2009, Oliver Neukum wrote:
> > Hi,
> >
> > using the USB autosuspend framework I've often faced characteristic
> > problems coding resume() methods. This has led me to an idea. Resume()
> > would be much easier to code if I knew about the reason of resumption,
> > especially about the code path resume() is called in. I wonder whether
> > we could introduce a message argument to resume and give it a few
> > bits from the caller.
> 
> Each of the callbacks in struct dev_pm_ops is executed in exactly one
>  context, so for each of them it is known why it was called.

But the resume method in the driver doesn't learn. It is an extrem hassle
not to know whether you are called synchronously (ie from open which
already holds a lock) or asynchronously (which means you need to guard
against open)

	Regards
		Oliver

  reply	other threads:[~2009-11-27  8:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26 21:59 suggestion on resumption Oliver Neukum
2009-11-27  0:47 ` Rafael J. Wysocki
2009-11-27  8:18   ` Oliver Neukum [this message]
2009-11-27 17:43     ` Alan Stern
2009-11-27 22:37       ` Oliver Neukum
2009-11-28 16:22         ` Alan Stern

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=200911270918.20029.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rjw@sisk.pl \
    /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