Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 11 Mar 2003 03:50:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 11 Mar 2003 03:50:05 -0500 Received: from mailrelay2.lrz-muenchen.de ([129.187.254.102]:62943 "EHLO mailrelay2.lrz-muenchen.de") by vger.kernel.org with ESMTP id convert rfc822-to-8bit; Tue, 11 Mar 2003 03:50:04 -0500 From: Oliver Neukum To: Greg KH , Roman Zippel Subject: Re: PCI driver module unload race? Date: Tue, 11 Mar 2003 10:00:40 +0100 User-Agent: KMail/1.5 Cc: Linux Kernel List , Patrick Mochel , Ivan Kokshaysky , Jeff Garzik , Rusty Russell References: <20030308104749.A29145@flint.arm.linux.org.uk> <20030311011532.GH13145@kroah.com> In-Reply-To: <20030311011532.GH13145@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Content-Disposition: inline Message-Id: <200303111000.40387.oliver@neukum.name> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1498 Lines: 40 Am Dienstag, 11. M?rz 2003 02:15 schrieb Greg KH: > On Tue, Mar 11, 2003 at 02:04:20AM +0100, Roman Zippel wrote: > > On Mon, 10 Mar 2003, Greg KH wrote: > > > > It seems that the semaphore in bus_add_device() makes this > > > > unnecessary. > > > > > > Hm, yes. I think you are correct. > > > > > > So this patch is not needed, and the struct module * can be ripped out > > > of struct usb_driver too :) > > > > I think it's not easy. I haven't studied the code completely yet, but > > e.g. when you attach a device to a driver you also have to get a > > reference to the driver. > > You get a link to the driver, but you can't increment the module count > of the driver at that time, as we have to be able to remove a module > somehow :) That is simple. Export a generic way to disconnect a driver from a device. > > I think there are more interesting races, e.g. when you create a sysfs > > symlink, that symlink might also have references to a module. > > Yeah, I still think there are some nasty issues with regards to being in > a sysfs directory, with a open file handle, and the module is removed. > But I haven't checked stuff like that in a while. > > CONFIG_MODULE_UNLOAD, just say no. That is taking the easy way out. Regards Oliver - 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/