Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S271082AbTHCIm5 (ORCPT ); Sun, 3 Aug 2003 04:42:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S271089AbTHCIm5 (ORCPT ); Sun, 3 Aug 2003 04:42:57 -0400 Received: from AMarseille-201-1-2-252.w193-253.abo.wanadoo.fr ([193.253.217.252]:8487 "EHLO gaston") by vger.kernel.org with ESMTP id S271082AbTHCIm4 (ORCPT ); Sun, 3 Aug 2003 04:42:56 -0400 Subject: IDE locking problem From: Benjamin Herrenschmidt To: Alan Cox , Bartlomiej Zolnierkiewicz , Jens Axboe Cc: linux-kernel mailing list Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1059900149.3524.84.camel@gaston> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 03 Aug 2003 10:42:29 +0200 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1013 Lines: 23 Hi Alan & Bart ! While fixing my hotswap media-bay IDE controller for 2.6, I found a locking problem with IDE (again ? :) in ide_unregister_hw. Basically the problem is that it calls blk_cleanup_queue(), which is unsafe to call with a lock held (it will call flush_workqueue() at one point). Other side effect, flush_workqueue() will re-enable IRQs, thus allowing us to get an IRQ while holding the spinlock -> double lock, but that's just a side effect of calling flush_workqueue in that context. So the call to blk_cleanup_queue() shall be moved outside of the spinlock. I don't know much about the BIO details, is it possible to first unregister_blkdev, then only call blk_cleanup_queue() ? That would help making sure we don't get a request sneaking in ? Ben. - 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/