[PATCH] Removal of MOD_{INC,DEC}_USE_COUNT in ide-cs

Pavel Roskin proski at gnu.org
Mon Apr 19 15:28:12 BST 2004


On Mon, 19 Apr 2004, Russell King wrote:

> On Sun, Apr 18, 2004 at 11:08:32PM -0400, Pavel Roskin wrote:
> > The "ide-cs" module cannot be unloaded because it used obsolete
> > MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT macros.  In fact, they are not
> > needed in 2.6 kernel.  The generic PCMCIA code already increases use count
> > for every device served by the driver, so it's impossible to unload the
> > ide-cs driver while it's in use.
>
> Last I heard, it was unsafe to remove IDE interfaces, so these obsolete
> macros were kept to remind people of that fact.

The problem is, MOD_INC_USE_COUNT only prevents removing the module, not
the interface.  It's also the first obstacle, albeit a trivial one, for
anybody debugging those problems (i.e. loading a modified module requires
"rmmod -f" or reboot to remove the old version).

"cardctl eject" and physical eject will still unregister the IDE
interface, but the module will stay in memory.

My experience with ide-cs has been following (Linux 2.6.6-rc1).

CompactFlash IDE drive is working fine.  On unload, there is a kernel
warning and stack dump in devfs_remove.  It's just a warning that some
nonexistent entry is removed.  It's a bug in ide-disk.c, and I submitted a
patch to linux-ide at vger.kernel.org yesterday.  There have been no problems
with that fix, even if ide-cs loaded and unloaded every time.

PCMCIA LS-120 drive is detected by ide-cs but the kernel panics when the
card is ejected.  It didn't work in my test because I didn't have
ide-floppy support in the kernel.  I believe this fact triggers the panic.
The IDE drivers need to be fixed not to crash without ide-floppy support.
Also, ide-cs should be tested with ide-floppy support.

I reiterate that MOD_INC_USE_COUNT is irrelevant to any interface removal
problems and the removal of the module doesn't cause any problems by
itself.

-- 
Regards,
Pavel Roskin



More information about the linux-pcmcia mailing list