All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Brandt, Todd E" <todd.e.brandt@intel.com>
Cc: "linux-ide@vger.kernel.org" <linux-ide@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Jeff Garzik <jgarzik@pobox.com>, Jens Axboe <axboe@kernel.dk>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	Arjan van de Ven <arjan@linux.intel.com>
Subject: Re: [PATCH v2 2/2] Adds new device resume mode in PM core, async plus non-blocking
Date: Fri, 17 May 2013 12:11:47 -0700	[thread overview]
Message-ID: <20130517191147.GA12986@kroah.com> (raw)
In-Reply-To: <11E08D716F0541429B7042699DD5C1A16B97BD8A@FMSMSX103.amr.corp.intel.com>

On Fri, May 17, 2013 at 07:05:33PM +0000, Brandt, Todd E wrote:
> Updates the drivers/base/power subsystem to allow any devices which
> have registred as asynchronous and who have not registered "complete"
> callbacks to be non-blocking. i.e system resume can finish and return
> control to the user while these devices continue resuming.
> 
> Changelog:
> v2:
>         - Updated patch submission. Incorporates comments from Tejun Heo.   
>           Fixed comment format, removed camelcase. No functional changes.
> 
> Signed-off-by: Todd Brandt <todd.e.brandt@intel.com>
> ---
>  drivers/base/power/main.c |   20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
> index 2b7f77d..1b16379 100644
> --- a/drivers/base/power/main.c
> +++ b/drivers/base/power/main.c
> @@ -713,7 +713,6 @@ void dpm_resume(pm_message_t state)
>  		put_device(dev);
>  	}
>  	mutex_unlock(&dpm_list_mtx);
> -	async_synchronize_full();
>  	dpm_show_time(starttime, state, NULL);
>  }
>  
> @@ -726,11 +725,14 @@ static void device_complete(struct device *dev, pm_message_t state)
>  {
>  	void (*callback)(struct device *) = NULL;
>  	char *info = NULL;
> +	bool hascb = false;

"hascb"?  Please spell out what this is.

>  
>  	if (dev->power.syscore)
>  		return;
>  
> -	device_lock(dev);
> + docomplete:
> +	if (hascb)
> +		device_lock(dev);
>  
>  	if (dev->pm_domain) {
>  		info = "completing power domain ";
> @@ -751,13 +753,21 @@ static void device_complete(struct device *dev, pm_message_t state)
>  		callback = dev->driver->pm->complete;
>  	}
>  
> +	/*
> +	 * if a callback exists, lock the device and call it
> +	 * otherwise don't even lock/unlock the device
> +	 */
>  	if (callback) {
> +		if (!hascb) {
> +			hascb = true;
> +			goto docomplete;

You want to jump backwards?  This isn't the scheduler, please, you can
do better here.

thanks,

greg k-h

  reply	other threads:[~2013-05-17 19:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17 19:05 [PATCH v2 2/2] Adds new device resume mode in PM core, async plus non-blocking Brandt, Todd E
2013-05-17 19:11 ` Greg Kroah-Hartman [this message]
2013-05-17 19:29   ` Brandt, Todd E
2013-05-17 19:44 ` Alan Stern
2013-06-03 21:10   ` Brandt, Todd E
2013-06-04 14:06     ` 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=20130517191147.GA12986@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=arjan@linux.intel.com \
    --cc=axboe@kernel.dk \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=todd.e.brandt@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.