Re: Flaw in ide_unregister()

From: Richard Purdie
Date: Mon Jan 10 2005 - 07:44:42 EST


Alan Cox:
On Sul, 2005-01-09 at 22:37, Richard Purdie wrote:
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:

Correct. This is intentional - what the -ac code allows you to do
(although you probably need to move the final free up to a workqueue) is
to free the hardware resources. The ide resources will then free later
on the umount

Ok. I can see what you're saying and I can visualise a patch for ide-cs.c which will probably work using a workqueue as you suggest.

I'd like to question whether the driver or the ide code should be taking care of this freeing of resources though?

It all depends what a call to ide_unregister() is supposed to mean. I'd have thought it should mean *remove this inferface by doing whatever is neccessary to do so*. If its busy and/or in use, wait until it isn't and then remove it by queueing some work to do so at a later date.

Offloading this responsibility onto each and every driver seems rather rather unwise and will result in a lot of code duplication. Are there any circumstances where we need ide_unregister to abort on busy? Even if there are would a flag to indicate what it should do with a busy drive be better?

Richard

-
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/