Re: Flaw in ide_unregister()

From: Richard Purdie
Date: Sun Jan 09 2005 - 17:39:03 EST


Alan Cox:
[Re: ide_unregister and problems with ide-cs.c]
In 2.6.9-ac and 2.6.10-ac the ide_unregister_hwif calls return an error
if the drive is in use. At this point the ide-cs code still throws it
away. The -ac code IDE also adds "removed_hwif_iops" so the bits are
there for the correct result which is something like

if(ide_unregister_hwif(hwif) < 0 {
printk("Whine whine...");
removed_hwif_ops(hwif);
while(ide_unregister_hwif(hwif) < 0)
msleep(1000);
}

I've just tried 2.6.10-ac8 on my target (an arm PDA) and it doesn't help ide-cs.c. When I pull out a mounted CF out the socket, the kernel prints "Unregister 0 fail 1 0" repeatedly on the console showing the usage count permanently stays at 1. This is the same problem as under 2.6.10.

I haven't investigated it yet but I suspect the usage count is held by ide-disk as the CF card has a mounted filesystem. As previously mentioned and for reference, this patch has the changes I had to make to get standard 2.6.10 to work:

http://www.rpsys.net/openzaurus/2.6.10/ide_fixes-r1.patch

Richard



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.9 - Release Date: 06/01/2005

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/