From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Date: Sun, 04 Feb 2001 18:16:00 +0000 Subject: Re: Adding PCMCIA support to the kernel tree -- developers needed. Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org > Module startup automatically calls init then register. Conditional > shutdown checks for zero use count, calls unregister then flushes any > other cpus that had just entered the module. If the flush was Flushing ? How ? > successful, call exit. If the flush was unsuccessful (somebody just > started using the module), call register to make the services available > again. Doing so means that there's a time where the device is unregistered illegitimately. Wouldn't it be simpler to take the big kernel lock for the check ? The unregistering would have to take it anyway. > There is also an unconditional shutdown mode. Call unregister and even > if the module is still in use, do not call register again. When the > use count finally goes to zero, the exit routine is called and the > module is removed. This is definitely needed, but why two calls for that ? It would be easier to provide a callback to be called when the use count reaches zero. > I think this will help hot unplugging. When the device disappears, the > driver internally marks its hardware as unusable and schedules an > unconditional shutdown of itself, all out of the interrupt handler. Is that really necessary ? Can't a kernel thread be used ? It is much easier than coding in interrupt. > Unconditional shutdown calls unregister which stops any new code > entering the module. The driver returns -EIO for all outstanding > requests which will eventually result in the outstanding users calling > close() or its equivalent and leaving the module. When the use count > finally goes to zero, exit releases the resources and the module is > removed. For built in code we do almost the same, the only difference > is that built in code is not removed from memory. That is wise. Regards Oliver _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel