Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757054Ab0BTWWh (ORCPT ); Sat, 20 Feb 2010 17:22:37 -0500 Received: from mail-fx0-f219.google.com ([209.85.220.219]:39407 "EHLO mail-fx0-f219.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756951Ab0BTWWf (ORCPT ); Sat, 20 Feb 2010 17:22:35 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:in-reply-to:references:content-type:date :message-id:mime-version:x-mailer:content-transfer-encoding; b=LdFC+zAInfPP6HRSBDsaixGpJYfsBCEo5LYZ93I5slnID3Ay8dtb5FmgBCuaq3FAgo wgQa1wl7QZGgAVX9NtO2Bt/V55N8E9RgQwLQGPE9Y7ZnJh3dBu0jeOSUpC93BJW2hU8S kbVPb+99Z0dKGg6+Kyg7mFzdGITu2VJDd7gjI= Subject: Re: [linux-pm] Is it supposed to be ok to call del_gendisk while userspace is frozen? From: Maxim Levitsky To: Alan Stern Cc: "Rafael J. Wysocki" , linux-pm , linux-kernel , Andrew Morton , Jens Axboe In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Sun, 21 Feb 2010 00:22:30 +0200 Message-ID: <1266704550.3748.7.camel@maxim-laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2970 Lines: 68 On Tue, 2010-02-16 at 11:27 -0500, Alan Stern wrote: > On Mon, 15 Feb 2010, Rafael J. Wysocki wrote: > > > On Monday 15 February 2010, Maxim Levitsky wrote: > > > On Sat, 2010-02-13 at 15:29 +0200, Maxim Levitsky wrote: > > > > I noticed that currently calling del_gendisk leads to sure deadlock if > > > > attemped from .suspend or .resume functions. > > > > Well, it shouldn't be called from there, then. > > Even if drivers avoid calling it from within suspend methods, they have > to be able to call it from within resume methods. After all, the > resume method may find that the disk's device has vanished. > > > > > Something like that: > > > > > > > > [] ? prepare_to_wait+0x2a/0x90 > > > > [] ? trace_hardirqs_on+0xd/0x10 > > > > [] ? _raw_spin_unlock_irqrestore+0x42/0x80 > > > > [] ? bdi_sched_wait+0x0/0x20 > > > > [] bdi_sched_wait+0xe/0x20 > > > > [] __wait_on_bit+0x5f/0x90 > > > > [] ? bdi_sched_wait+0x0/0x20 > > > > [] out_of_line_wait_on_bit+0x78/0x90 > > > > [] ? wake_bit_function+0x0/0x40 > > > > [] ? bdi_queue_work+0xa3/0xe0 > > > > [] bdi_sync_writeback+0x6f/0x80 > > > > [] sync_inodes_sb+0x22/0x120 > > > > [] __sync_filesystem+0x82/0x90 > > > > [] sync_filesystem+0x4b/0x70 > > > > [] fsync_bdev+0x2e/0x60 > > > > [] invalidate_partition+0x2e/0x50 > > > > [] del_gendisk+0x3f/0x140 > > > > [] mmc_blk_remove+0x33/0x60 [mmc_block] > > > > [] mmc_bus_remove+0x17/0x20 > > > > [] __device_release_driver+0x66/0xc0 > > > > [] device_release_driver+0x2d/0x40 > > > > [] bus_remove_device+0xb5/0x120 > > > > [] device_del+0x12f/0x1a0 > > > > [] mmc_remove_card+0x5b/0x90 > > > > [] mmc_sd_remove+0x27/0x50 > > > > [] mmc_resume_host+0x10c/0x140 > > > > [] sdhci_resume_host+0x69/0xa0 [sdhci] > > > > [] sdhci_pci_resume+0x8e/0xb0 [sdhci_pci] > > > > > > > > bdi_queue_work seems to be the problem. > > > > > > > > Some device drivers need to remove their cards logically in .suspend, > > > > because the card is removable, and can be changed while system is > > > > suspended. > > > > I don't know how to resolve this right now. > > This is a matter for Jens. Is the bdi writeback task freezable? If it > is, should it be made unfreezable? Any update? Best regards, Maxim Levitsky -- 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/