mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Greg KH <greg@kroah.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Kay Sievers <kay.sievers@vrfy.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	David Brownell <david-b@pacbell.net>,
	LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>
Subject: [PATCH -mm 1/3] PM: Remove prev_state from struct dev_pm_info
Date: Sun, 17 Jun 2007 19:48:06 +0200	[thread overview]
Message-ID: <200706171948.07827.rjw@sisk.pl> (raw)
In-Reply-To: <200706171946.26174.rjw@sisk.pl>

From: Rafael J. Wysocki <rjw@sisk.pl>

The prev_state member of struct dev_pm_info (defined in include/linux/pm.h) is
only used during a resume to check if the device's state before the suspend was
'off', in which case the device is not resumed.  However, in such cases the
decision whether or not to resume the device should be made on the driver level
and the resume callbacks from the device's bus and class should be executed
anyway (the may be needed for some things other than just powering on the
device).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/base/power/resume.c  |    3 +--
 drivers/base/power/suspend.c |    2 --
 drivers/usb/core/hub.c       |    5 -----
 drivers/usb/host/ohci-pci.c  |    2 --
 include/linux/pm.h           |    1 -
 5 files changed, 1 insertion(+), 12 deletions(-)

Index: linux-2.6.22-rc4-mm2/drivers/base/power/resume.c
===================================================================
--- linux-2.6.22-rc4-mm2.orig/drivers/base/power/resume.c
+++ linux-2.6.22-rc4-mm2/drivers/base/power/resume.c
@@ -88,8 +88,7 @@ void dpm_resume(void)
 		list_move_tail(entry, &dpm_active);
 
 		mutex_unlock(&dpm_list_mtx);
-		if (!dev->power.prev_state.event)
-			resume_device(dev);
+		resume_device(dev);
 		mutex_lock(&dpm_list_mtx);
 		put_device(dev);
 	}
Index: linux-2.6.22-rc4-mm2/drivers/base/power/suspend.c
===================================================================
--- linux-2.6.22-rc4-mm2.orig/drivers/base/power/suspend.c
+++ linux-2.6.22-rc4-mm2/drivers/base/power/suspend.c
@@ -71,8 +71,6 @@ int suspend_device(struct device * dev, 
 			dev->parent->power.power_state.event);
 	}
 
-	dev->power.prev_state = dev->power.power_state;
-
 	if (dev->class && dev->class->suspend && !dev->power.power_state.event) {
 		suspend_device_dbg(dev, state, "class ");
 		error = dev->class->suspend(dev, state);
Index: linux-2.6.22-rc4-mm2/drivers/usb/core/hub.c
===================================================================
--- linux-2.6.22-rc4-mm2.orig/drivers/usb/core/hub.c
+++ linux-2.6.22-rc4-mm2/drivers/usb/core/hub.c
@@ -623,7 +623,6 @@ static void mark_children_for_reset_resu
 
 		if (child) {
 			child->reset_resume = 1;
-			child->dev.power.prev_state.event = PM_EVENT_ON;
 			clear_port_feature(hdev, port1,
 					USB_PORT_FEAT_C_CONNECTION);
 		}
@@ -1190,10 +1189,6 @@ void usb_root_hub_lost_power(struct usb_
 	dev_warn(&rhdev->dev, "root hub lost power or was reset\n");
 	rhdev->reset_resume = 1;
 
-	/* Force the root hub to be resumed, even if it was suspended,
-	 * so that no wakeup events will get lost.
-	 */
-	rhdev->dev.power.prev_state.event = PM_EVENT_ON;
 }
 EXPORT_SYMBOL_GPL(usb_root_hub_lost_power);
 
Index: linux-2.6.22-rc4-mm2/include/linux/pm.h
===================================================================
--- linux-2.6.22-rc4-mm2.orig/include/linux/pm.h
+++ linux-2.6.22-rc4-mm2/include/linux/pm.h
@@ -235,7 +235,6 @@ struct dev_pm_info {
 	unsigned		can_wakeup:1;
 #ifdef	CONFIG_PM
 	unsigned		should_wakeup:1;
-	pm_message_t		prev_state;
 	struct list_head	entry;
 #endif
 };
Index: linux-2.6.22-rc4-mm2/drivers/usb/host/ohci-pci.c
===================================================================
--- linux-2.6.22-rc4-mm2.orig/drivers/usb/host/ohci-pci.c
+++ linux-2.6.22-rc4-mm2/drivers/usb/host/ohci-pci.c
@@ -281,8 +281,6 @@ static int ohci_pci_resume (struct usb_h
 	/* FIXME: we should try to detect loss of VBUS power here */
 	prepare_for_handover(hcd);
 
-	/* Force the PM core to resume the root hub */
-	hcd_to_bus(hcd)->root_hub->dev.power.prev_state.event = PM_EVENT_ON;
 	return 0;
 }
 


  reply	other threads:[~2007-06-17 18:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13 13:51 [PATCH -mm 0/7] PM: Remove unused and unnecessary features from suspend and resume core Rafael J. Wysocki
2007-06-13 13:53 ` [PATCH -mm 1/7] PM: Remove pm_parent from struct dev_pm_info Rafael J. Wysocki
2007-06-13 13:55 ` [PATCH -mm 2/7] PM: Remove saved_state " Rafael J. Wysocki
2007-06-13 14:19 ` [PATCH -mm 3/7] PM: Simplify suspend_device Rafael J. Wysocki
2007-06-13 14:20 ` [PATCH -mm 4/7] PM: Remove suspend and resume support from struct device_type Rafael J. Wysocki
2007-06-13 22:20   ` Kay Sievers
2007-06-14  4:10     ` Dmitry Torokhov
2007-06-14 12:37       ` Rafael J. Wysocki
2007-06-14 12:59         ` Dmitry Torokhov
2007-06-14 17:46           ` Greg KH
2007-06-14 22:32             ` Rafael J. Wysocki
2007-06-14 22:50               ` Greg KH
2007-06-14 23:14               ` Greg KH
2007-06-14 23:30                 ` Rafael J. Wysocki
2007-06-17 17:46                 ` [PATCH -mm 0/3] PM: Remove unused and unnecessary features from core suspend code (continued) Rafael J. Wysocki
2007-06-17 17:48                   ` Rafael J. Wysocki [this message]
2007-06-17 17:49                   ` [PATCH -mm 2/3] PM: Remove power_state.event checks from suspend core code Rafael J. Wysocki
2007-06-17 17:50                   ` [PATCH -mm 3/3] PM: Do not check parent state in suspend and resume " Rafael J. Wysocki
2007-06-14 14:19       ` [PATCH -mm 4/7] PM: Remove suspend and resume support from struct device_type David Brownell
2007-06-14 14:44         ` Dmitry Torokhov
2007-06-14 15:03           ` David Brownell
2007-06-14 15:17             ` Dmitry Torokhov
2007-06-13 15:16 ` [PATCH -mm 5/7] PM: Remove prev_state from struct dev_pm_info Rafael J. Wysocki
2007-06-13 15:16 ` [PATCH -mm 6/7] PM: Remove power_state.event checks from suspend core code Rafael J. Wysocki
2007-06-14 14:21   ` David Brownell
2007-06-14 22:46     ` Rafael J. Wysocki
2007-06-15  2:00       ` Alan Stern
2007-06-15 21:57         ` Rafael J. Wysocki
2007-06-17 19:26           ` Rafael J. Wysocki
2007-06-13 15:17 ` [PATCH -mm 7/7] PM: Do not check parent state in suspend and resume " Rafael J. Wysocki
2007-06-13 21:59 ` [PATCH -mm 0/7] PM: Remove unused and unnecessary features from suspend and resume core Greg KH
2007-06-13 23:02   ` Rafael J. Wysocki
2007-06-13 23:36 ` 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=200706171948.07827.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=david-b@pacbell.net \
    --cc=dmitry.torokhov@gmail.com \
    --cc=greg@kroah.com \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --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®