From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jens Axboe Subject: Re: 2.6.19-rc3-git7: scsi_device_unbusy: inconsistent lock state Date: Mon, 30 Oct 2006 15:43:16 +0100 Message-ID: <20061030144315.GG4563@kernel.dk> References: <45460D52.3000404@rtr.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from brick.kernel.dk ([62.242.22.158]:58483 "EHLO kernel.dk") by vger.kernel.org with ESMTP id S1751957AbWJ3Olh (ORCPT ); Mon, 30 Oct 2006 09:41:37 -0500 Content-Disposition: inline In-Reply-To: <45460D52.3000404@rtr.ca> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Mark Lord Cc: IDE/ATA development list , Linux Kernel , mingo@elte.hu On Mon, Oct 30 2006, Mark Lord wrote: > ================================= > [ INFO: inconsistent lock state ] > 2.6.19-rc3-git7-ml #3 > --------------------------------- > inconsistent {in-softirq-W} -> {softirq-on-W} usage. > startproc/4046 [HC0[0]:SC0[0]:HE1:SE1] takes: > (&q->__queue_lock){-+..}, at: [] cfq_set_request+0x351/0x3b0 > {in-softirq-W} state was registered at: > [] mark_lock+0x81/0x5f0 > [] __lock_acquire+0x660/0xc10 > [] lock_acquire+0x5d/0x80 > [] _spin_lock+0x29/0x40 > [] scsi_device_unbusy+0x64/0x90 > [] scsi_finish_command+0x1c/0xa0 > [] blk_done_softirq+0x62/0x70 > [] __do_softirq+0x87/0x100 > [] do_softirq+0x55/0x60 > [] ksoftirqd+0x7c/0xd0 > [] kthread+0xf6/0x100 > [] kernel_thread_helper+0x7/0x18 > [] 0xffffffff > irq event stamp: 3331 > hardirqs last enabled at (3331): [] kmem_cache_alloc+0x6d/0xa0 > hardirqs last disabled at (3330): [] kmem_cache_alloc+0x1f/0xa0 > softirqs last enabled at (3012): [] do_softirq+0x55/0x60 > softirqs last disabled at (2971): [] do_softirq+0x55/0x60 Not sure what exactly is complained about here. The queue_lock must always be grabbed with an irq disabling option, such as _irq or _irqsave if potentially in interrupt context. I'm guessing it's the scsi_device_unbusy() locking sequence that confuses it: spin_lock_irqsave(shost->host_lock, flags); ... spin_unlock(shost->host_lock); spin_lock(sdev->request_queue->queue_lock); ... spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); which has always been considered safe, while not very pretty. Ingo? -- Jens Axboe