Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966452AbWKTTSg (ORCPT ); Mon, 20 Nov 2006 14:18:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S966456AbWKTTSf (ORCPT ); Mon, 20 Nov 2006 14:18:35 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:20117 "HELO iolanthe.rowland.org") by vger.kernel.org with SMTP id S966452AbWKTTSe (ORCPT ); Mon, 20 Nov 2006 14:18:34 -0500 Date: Mon, 20 Nov 2006 14:18:33 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Dmitry Torokhov cc: Stefan Richter , , Greg Kroah-Hartman , Subject: Re: deadlock in "modprobe -r ohci1394" shortly after "modprobe ohci1394" In-Reply-To: <200611192241.30740.dtor@insightbb.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 29 On Sun, 19 Nov 2006, Dmitry Torokhov wrote: > I was actually looking at the driver core recently and was surprised that > USB crapped all over it with its locking requirements. I don't think its a > good idea to enforce one subsystem's lcoking rules onto everyone. I agree. The only reason for doing it that way was I couldn't think of any other approach. > Would there be alot of objections if we add bus->[un]lock_device() and > hide all uglies there? If methods are not set when bus is registered then > standard dev->sem lock/unlock will be used. That's a little too simple to work. You can see from examining the existing code in bus.c and dd.c; there are places where the device needs to be locked but not the parent, places where the parent needs to be locked but not the device, and places where both need to be locked. A slightly different way to accomplish much the same thing might be to have a per-bus parent_needs_to_be_locked flag (or method). It wouldn't be quite as elegant, though. Alan Stern - 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/