ide_cs cannot unload

Larry W. Finger Larry.Finger at lwfinger.net
Tue Feb 10 13:38:02 GMT 2004


At 04:50 AM 2/10/2004, Patrice Lazareff wrote:

>Ejecting the card (manually since cardctl says device
>busy) seems to be ok, but also prevents unmounting
>ide1, where the root partition is, on shutdown/reboot.
>(the cdrom, when available, is on ide2).
>
>Re-inserting the card totally freezes the machine.
>
>Laptop Sony Vaio Z600
>Kernel 2.6.2
>modules-utils 3.0pre9
>all compiled with gcc-3.3.2

My machine is an HP ze1115 using an Apricorn EZ-Gig expansion card for an 
external hard drive. With the following patch, the module loads cleanly and 
works. There is one error message upon unload, but the module will reload OK.

The unload error message is "request module: failed /sbin/modprobe 
--block-major - 33-0, error = 256"

The patch (against 2.6.2) is:

--- old/drivers/ide/legacy/ide-cs.c.orig        2004-02-10 
12:32:15.000000000 -0700
+++ new/drivers/ide/legacy/ide-cs.c     2004-02-10 12:52:34.984758032 -0700
@@ -361,7 +361,7 @@
         goto failed;
      }

-    MOD_INC_USE_COUNT;
+    try_module_get(THIS_MODULE);
      info->ndev = 1;
      sprintf(info->node.dev_name, "hd%c", 'a'+(hd*2));
      info->node.major = ide_major[hd];
@@ -407,7 +407,7 @@
         if (link->io.NumPorts2)
             request_region(link->io.BasePort2, link->io.NumPorts2,
                            info->node.dev_name);
-       MOD_DEC_USE_COUNT;
+       module_put(THIS_MODULE);
      }
      info->ndev = 0;
      link->dev = NULL;

My mailer lives on Windows and corrupts patches; therefore, I am also 
including the diff file from Linux.

Larry 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ide_cs.diff
Type: application/octet-stream
Size: 600 bytes
Desc: not available
Url : http://lists.infradead.org/pipermail/linux-pcmcia/attachments/20040210/c3f26b6f/ide_cs.obj


More information about the linux-pcmcia mailing list