mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Greg KH <greg@kroah.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jiri Slaby <jirislaby@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>,
	USB list <linux-usb@vger.kernel.org>
Subject: Re: [PATCH] PM: use pm_op methods for device types
Date: Thu, 25 Sep 2008 23:27:02 +0200	[thread overview]
Message-ID: <200809252327.03305.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0809251704580.2181-100000@iolanthe.rowland.org>

On Thursday, 25 of September 2008, Alan Stern wrote:
> This patch (as1141) adds code to use the device type's pm_op methods,
> if they are defined.  It fixes a regression in the USB PM code; the
> various suspend and resume methods are defined in the device type
> rather than in the bus, because USB devices have to be handled
> differently from USB interfaces.  Without the patch, those methods
> never get called.
> 
> The patch also fixes a couple of spelling errors.

Hm, these changes are not needed in the current mainline, so there's a patch
in -next that removes the code added by this patch.

It might be better to find that patch and drop it instead, IMO.

> Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
> Tested-by: Jiri Slaby <jirislaby@gmail.com>
> 
> ---
> 
> This should be merged before 2.6.27 is released, if possible.  
> Otherwise people will find their systems refuse to suspend when any USB
> devices are attached.
> 
> 
> 
> Index: usb-2.6/drivers/base/power/main.c
> ===================================================================
> --- usb-2.6.orig/drivers/base/power/main.c
> +++ usb-2.6/drivers/base/power/main.c
> @@ -107,7 +107,7 @@ void device_pm_remove(struct device *dev
>  }
>  
>  /**
> - *	pm_op - execute the PM operation appropiate for given PM event
> + *	pm_op - execute the PM operation appropriate for given PM event
>   *	@dev:	Device.
>   *	@ops:	PM operations to choose from.
>   *	@state:	PM transition of the system being carried out.
> @@ -166,7 +166,7 @@ static int pm_op(struct device *dev, str
>  }
>  
>  /**
> - *	pm_noirq_op - execute the PM operation appropiate for given PM event
> + *	pm_noirq_op - execute the PM operation appropriate for given PM event
>   *	@dev:	Device.
>   *	@ops:	PM operations to choose from.
>   *	@state: PM transition of the system being carried out.
> @@ -363,6 +363,13 @@ static int resume_device(struct device *
>  			goto End;
>  	}
>  
> +	if (dev->type && dev->type->pm) {
> +		pm_dev_dbg(dev, state, "type ");
> +		error = pm_op(dev, dev->type->pm, state);
> +		if (error)
> +			goto End;
> +	}
> +
>  	if (dev->class) {
>  		if (dev->class->pm) {
>  			pm_dev_dbg(dev, state, "class ");
> @@ -596,6 +603,13 @@ static int suspend_device(struct device 
>  			goto End;
>  	}
>  
> +	if (dev->type && dev->type->pm) {
> +		pm_dev_dbg(dev, state, "type ");
> +		error = pm_op(dev, dev->type->pm, state);
> +		if (error)
> +			goto End;
> +	}
> +
>  	if (dev->bus) {
>  		if (dev->bus->pm) {
>  			pm_dev_dbg(dev, state, "");
> 
> 
> 



  reply	other threads:[~2008-09-25 21:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-15 14:00 hda_intel (sigmatel) defunct in mmotm 2008-09-13-03-09 Jiri Slaby
2008-09-15 14:16 ` Matthew Ranostay
2008-09-16 14:43 ` Matthew Ranostay
2008-09-17  8:58   ` Jiri Slaby
2008-09-17 14:09     ` Matthew Ranostay
2008-09-24  9:42       ` Jiri Slaby
2008-09-17 16:46     ` suspend (uhci_hcd) " Jiri Slaby
2008-09-18 21:14       ` Alan Stern
2008-09-24 10:55         ` Jiri Slaby
2008-09-24 14:49           ` Alan Stern
2008-09-24 16:04             ` Jiri Slaby
2008-09-24 16:38               ` Alan Stern
2008-09-24 18:14                 ` Greg KH
2008-09-24 18:19                   ` Jiri Slaby
2008-09-24 18:54                     ` Jiri Slaby
2008-09-24 21:29                       ` Alan Stern
2008-09-25 20:51                         ` Jiri Slaby
2008-09-25 21:07                           ` [PATCH] PM: use pm_op methods for device types Alan Stern
2008-09-25 21:27                             ` Rafael J. Wysocki [this message]
2008-09-25 22:06                               ` Greg KH
2008-09-26 13:56                                 ` Alan Stern
2008-09-26 17:59                                   ` Greg KH
2008-10-06 15:11                                     ` Pavel Machek

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=200809252327.03305.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=greg@kroah.com \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-usb@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®