Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261896AbVCANLt (ORCPT ); Tue, 1 Mar 2005 08:11:49 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261895AbVCANLt (ORCPT ); Tue, 1 Mar 2005 08:11:49 -0500 Received: from gprs215-241.eurotel.cz ([160.218.215.241]:38879 "EHLO amd.ucw.cz") by vger.kernel.org with ESMTP id S261896AbVCANLH (ORCPT ); Tue, 1 Mar 2005 08:11:07 -0500 Date: Tue, 1 Mar 2005 14:10:51 +0100 From: Pavel Machek To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Patrick Mochel , Greg KH Subject: Re: 2.6.11-rc4-mm1: something is wrong with swsusp powerdown Message-ID: <20050301131051.GE1843@elf.ucw.cz> References: <20050228231721.GA1326@elf.ucw.cz> <20050301020722.6faffb69.akpm@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050301020722.6faffb69.akpm@osdl.org> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.6+20040907i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2860 Lines: 80 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 > [] dump_stack+0x19/0x20 > [] __might_sleep+0x91/0x9c > [] device_shutdown+0x16/0x82 > [] power_down+0x47/0x74 > [] pm_suspend_disk+0x5a/0x74 > [] enter_state+0x2e/0x70 > [] software_suspend+0xa/0x10 > [] acpi_system_write_sleep+0x73/0x98 > [] vfs_write+0xaf/0x118 > [] sys_write+0x3c/0x68 > [] 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! - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/