From: Pavel Machek <pavel@suse.cz>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org,
Patrick Mochel <mochel@digitalimplant.org>,
Greg KH <greg@kroah.com>
Subject: Re: 2.6.11-rc4-mm1: something is wrong with swsusp powerdown
Date: Tue, 1 Mar 2005 14:10:51 +0100 [thread overview]
Message-ID: <20050301131051.GE1843@elf.ucw.cz> (raw)
In-Reply-To: <20050301020722.6faffb69.akpm@osdl.org>
Hi!
> btw, suspend is a bit messy. The disk spins down. Then up. Then down
> again. And:
Yes, this is going to be properly solved by switching pm_message_t to
struct (preview patch attached, EVENT will become .event, this is just
for me). I could do some hack to make disk not go up-down-up (and will
need to do it for suse9.3, anyway), but I do not think that would
belong to mainline.
> Powering off system
> Debug: sleeping function called from invalid context at include/linux/rwsem.h:66
> in_atomic():0, irqs_disabled():1
> [<c010318d>] dump_stack+0x19/0x20
> [<c0111731>] __might_sleep+0x91/0x9c
> [<c0285872>] device_shutdown+0x16/0x82
> [<c012aa97>] power_down+0x47/0x74
> [<c012ac5a>] pm_suspend_disk+0x5a/0x74
> [<c01292ea>] enter_state+0x2e/0x70
> [<c0129336>] software_suspend+0xa/0x10
> [<c024a8a7>] acpi_system_write_sleep+0x73/0x98
> [<c0149f1b>] vfs_write+0xaf/0x118
> [<c014a028>] sys_write+0x3c/0x68
> [<c0102c05>] sysenter_past_esp+0x52/0x75
> Synchronizing SCSI cache for disk sda:
> Shutdown: hda
> acpi_power_off called
Hmm, device_shutdown is confused. Should it be called with interrupts
enabled or disabled? It uses rwsem, that suggests interrupts enabled,
but I do not think sysdev_shutdown with enabled interrupts is good
idea (and comment suggests it should be called with interrupts disabled).
Pavel
/**
* We handle system devices differently - we suspend and shut them
* down last and resume them first. That way, we don't do anything
stupid like
* shutting down the interrupt controller before any devices..
*
* Note that there are not different stages for power management calls
-
* they only get one called once when interrupts are disabled.
*/
extern int sysdev_shutdown(void);
/**
* device_shutdown - call ->shutdown() on each device to shutdown.
*/
void device_shutdown(void)
{
struct device * dev;
down_write(&devices_subsys.rwsem);
list_for_each_entry_reverse(dev, &devices_subsys.kset.list, kobj.entry) {
pr_debug("shutting down %s: ", dev->bus_id);
if (dev->driver && dev->driver->shutdown) {
pr_debug("Ok\n");
dev->driver->shutdown(dev);
} else
pr_debug("Ignored.\n");
}
up_write(&devices_subsys.rwsem);
sysdev_shutdown();
}
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
next prev parent reply other threads:[~2005-03-01 13:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-28 23:17 Pavel Machek
2005-03-01 6:38 ` Laurent Riffard
2005-03-01 9:52 ` Andrew Morton
2005-03-01 10:54 ` Pavel Machek
2005-03-01 11:12 ` Eric W. Biederman
2005-03-01 12:02 ` Pavel Machek
2005-03-01 11:08 ` Eric W. Biederman
2005-03-01 12:08 ` Pavel Machek
2005-03-01 17:33 ` Eric W. Biederman
2005-03-01 10:07 ` Andrew Morton
2005-03-01 10:21 ` Andrew Morton
2005-03-01 10:56 ` Pavel Machek
2005-03-01 20:35 ` Andrew Morton
2005-03-01 23:39 ` Pavel Machek
2005-03-01 10:48 ` Pavel Machek
2005-03-01 13:10 ` Pavel Machek [this message]
2005-03-01 13:12 ` Pavel Machek
2005-03-01 20:38 ` Andrew Morton
2005-03-02 22:57 ` Jindrich Makovicka
2005-03-03 0:30 ` Andrew Morton
2005-03-03 12:38 ` Jindrich Makovicka
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=20050301131051.GE1843@elf.ucw.cz \
--to=pavel@suse.cz \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@digitalimplant.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
all inboxes | Powered by JetHome®