lkml.org 
[lkml]   [1996]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: ftape / floppy conflict
Date
From
[...]
>Ok, I just tried the following experiment, something I don't think
>I've ever done before:
>
>vt #1:
> % modprobe floppy
>
>vt #2:
> % modprobe ftape
> % afio -t /dev/ftape # lengthy directory listing starts
>
>vt #1:
> % mount -text2 -rv /dev/fd0H1743 /mnt
> floppy0: Unable to grab IRQ6 for the floppy driver # ok with me
> mount: /dev/fd0H1743 already mounted or /mnt busy # huh ?
> #
> # -- Taken at face value, this mount message isn't true
>
>vt #2:
> Ctrl-C # killed afio
> % rmmod ftape # removed without error
>
> % mount -text2 -rv /dev/fd0H1743 /mnt # failed with lots of error
> # messages (see below)
> % umount /mnt
> umount: /mnt: not mounted # true enough
>
> % rmmod floppy
> floppy: Device or resource busy # Ouch!
>
>
>So, my system isn't frozen, but floppy.o is stuck solid.

I just checked, and noticed that a few usage counter incrementations
were not correctly undone in the floppy driver when resource
allocation failed.


The following patch should fix the problems:

diff -ur 2.0.16/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- 2.0.16/linux/drivers/block/floppy.c Mon Sep 2 08:38:15 1996
+++ linux/drivers/block/floppy.c Mon Sep 2 08:47:08 1996
@@ -4067,12 +4067,16 @@
if (fd_request_irq()) {
DPRINT("Unable to grab IRQ%d for the floppy driver\n",
FLOPPY_IRQ);
+ MOD_DEC_USE_COUNT;
+ usage_count--;
return -1;
}
if (fd_request_dma()) {
DPRINT("Unable to grab DMA%d for the floppy driver\n",
FLOPPY_DMA);
fd_free_irq();
+ MOD_DEC_USE_COUNT;
+ usage_count--;
return -1;
}
for (fdc = 0; fdc < N_FDC; fdc++)
@@ -4098,7 +4102,6 @@
return;
}
INT_ON;
- MOD_DEC_USE_COUNT;
fd_disable_dma();
fd_free_dma();
fd_disable_irq();
@@ -4131,6 +4134,7 @@
if (floppy_tq.sync)
printk("task queue still active\n");
#endif
+ MOD_DEC_USE_COUNT;
}

Regards,
Alain

\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.072 / U:10.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site