From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
Cc: pavel@ucw.cz, akpm@linux-foundation.org,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org,
michal.k.k.piotrowski@gmail.com
Subject: Re: [2.6.23-rc1 REGRESSION] ThinkPad T42 poweroff failure by "PM: Introduce pm_power_off_prepare"
Date: Thu, 26 Jul 2007 16:29:55 +0200 [thread overview]
Message-ID: <200707261629.55741.rjw@sisk.pl> (raw)
In-Reply-To: <20070726.080624.94043434.yoshfuji@linux-ipv6.org>
On Thursday, 26 July 2007 15:06, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> Hello.
>
> In article <200707261412.33839.rjw@sisk.pl> (at Thu, 26 Jul 2007 14:12:33 +0200), "Rafael J. Wysocki" <rjw@sisk.pl> says:
>
> > On Wednesday, 25 July 2007 17:28, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> > > Hello.
> > >
> > > In article <200707251446.56809.rjw@sisk.pl> (at Wed, 25 Jul 2007 14:46:55 +0200), "Rafael J. Wysocki" <rjw@sisk.pl> says:
> > >
> > > > On Wednesday, 25 July 2007 00:19, YOSHIFUJI Hideaki / 吉藤英明 wrote:
> > > :
> > > > > Linux 2.6.23-rc1 fails to power off my ThinkPad T42.
> > > > > Git-bisect told me that the following commit is to blame,
> > > > > and by reverting that commit, it works appropriately.
> > > >
> > > > (1) Can you please apply the appended patch and see if the message gets
> > > > printed when you try to power off the system?
> > >
> > > Yup, I got it. Last lines are:
> :
> > Can you please check if the appended patch helps?
>
> Yes, it definitely does. Thank you.
OK, so here it goes again with a changelog:
---
From: Rafael J. Wysocki <rjw@sisk.pl>
Generally, sysdev_shutdown() should be called after the ACPI preparation for
powering the system off. To make it happen, we can separate sysdev_shutdown()
from device_shutdown() and call it directly wherever necessary.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/shutdown.c | 2 --
include/linux/device.h | 3 +++
kernel/power/disk.c | 1 +
kernel/sys.c | 3 +++
4 files changed, 7 insertions(+), 2 deletions(-)
Index: linux-2.6.23-rc1/drivers/base/power/shutdown.c
===================================================================
--- linux-2.6.23-rc1.orig/drivers/base/power/shutdown.c 2007-07-09 01:32:17.000000000 +0200
+++ linux-2.6.23-rc1/drivers/base/power/shutdown.c 2007-07-26 12:24:37.000000000 +0200
@@ -44,7 +44,5 @@ void device_shutdown(void)
dev->driver->shutdown(dev);
}
}
-
- sysdev_shutdown();
}
Index: linux-2.6.23-rc1/kernel/sys.c
===================================================================
--- linux-2.6.23-rc1.orig/kernel/sys.c 2007-07-23 22:07:02.000000000 +0200
+++ linux-2.6.23-rc1/kernel/sys.c 2007-07-26 12:08:07.000000000 +0200
@@ -804,6 +804,7 @@ static void kernel_restart_prepare(char
blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
system_state = SYSTEM_RESTART;
device_shutdown();
+ sysdev_shutdown();
}
/**
@@ -860,6 +861,7 @@ void kernel_shutdown_prepare(enum system
void kernel_halt(void)
{
kernel_shutdown_prepare(SYSTEM_HALT);
+ sysdev_shutdown();
printk(KERN_EMERG "System halted.\n");
machine_halt();
}
@@ -876,6 +878,7 @@ void kernel_power_off(void)
kernel_shutdown_prepare(SYSTEM_POWER_OFF);
if (pm_power_off_prepare)
pm_power_off_prepare();
+ sysdev_shutdown();
printk(KERN_EMERG "Power down.\n");
machine_power_off();
}
Index: linux-2.6.23-rc1/kernel/power/disk.c
===================================================================
--- linux-2.6.23-rc1.orig/kernel/power/disk.c 2007-07-26 12:13:58.000000000 +0200
+++ linux-2.6.23-rc1/kernel/power/disk.c 2007-07-26 12:14:23.000000000 +0200
@@ -216,6 +216,7 @@ int hibernation_platform_enter(void)
* sleep state after all
*/
error = hibernation_ops->prepare();
+ sysdev_shutdown();
if (!error)
error = hibernation_ops->enter();
} else {
Index: linux-2.6.23-rc1/include/linux/device.h
===================================================================
--- linux-2.6.23-rc1.orig/include/linux/device.h 2007-07-23 22:06:59.000000000 +0200
+++ linux-2.6.23-rc1/include/linux/device.h 2007-07-26 12:48:05.000000000 +0200
@@ -551,6 +551,9 @@ extern void put_device(struct device * d
/* drivers/base/power/shutdown.c */
extern void device_shutdown(void);
+/* drivers/base/sys.c */
+extern void sysdev_shutdown(void);
+
/* drivers/base/firmware.c */
extern int __must_check firmware_register(struct kset *);
next prev parent reply other threads:[~2007-07-26 14:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 22:19 YOSHIFUJI Hideaki / 吉藤英明
2007-07-24 23:44 ` Thinkpad ACPI Steven
2007-07-25 12:46 ` [2.6.23-rc1 REGRESSION] ThinkPad T42 poweroff failure by "PM: Introduce pm_power_off_prepare" Rafael J. Wysocki
2007-07-25 15:28 ` YOSHIFUJI Hideaki / 吉藤英明
2007-07-26 12:12 ` Rafael J. Wysocki
2007-07-26 13:06 ` YOSHIFUJI Hideaki / 吉藤英明
2007-07-26 14:29 ` Rafael J. Wysocki [this message]
2007-07-26 14:36 ` YOSHIFUJI Hideaki / 吉藤英明
2007-07-26 20:57 ` [2.6.23-rc1 REGRESSION] ThinkPad T42 poweroff failure by Meelis Roos
2007-07-30 21:51 ` [2.6.23-rc1 REGRESSION] ThinkPad T42 poweroff failure by "PM: Introduce pm_power_off_prepare" Steven
2007-07-30 22:59 ` Bongani Hlope
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=200707261629.55741.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.k.k.piotrowski@gmail.com \
--cc=pavel@ucw.cz \
--cc=torvalds@linux-foundation.org \
--cc=yoshfuji@linux-ipv6.org \
/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
Powered by JetHome