* Problems with ide-cs.c
@ 2004-12-13 20:57 Richard Purdie
2004-12-15 14:51 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2004-12-13 20:57 UTC (permalink / raw)
To: linux-ide
I've run into an issue when working on pcmcia support for a device with a CF socket.
With CF you can remove the card without ejecting it first. Removal results in a call to ide_release() in ide-cs.c which in turn calls ide_unregister. This all looks quite sensible.
If the usage count for the device is non-zero ide_unregister will fail which is likely if you just pull the card out. This silent failure leads to all kinds of problems which break the device until it's rebooted - quite a serious bug. There is a fixme in ide-cs.c relating to this.
There are several issues on different levels here. If ide_unregister can fail, it should really return a value. Two solutions: Either make it so ide_unregister can't fail or return a failure value.
That latter seems quite simple but if a failure value is returned, there is not a lot ide-cs.c can do other than retry the ide_unregister call periodically until it succeeds. As the hardware has gone, it should really be possible to point this out the ide system and have it act accordingly. The user shouldn't really have to see any timeouts/kernel whinging etc. as it is know the device is gone.
If ide_unregister marked the hwif "gone" and fails any and all new requests passed to IDE drives associated with the hwif immediately, that would solve some of the problems.
Unfortunately, I don't know a lot about the ide system. I'm open to suggestions as to how this bug can be resolved though.
Thanks,
Richard
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Problems with ide-cs.c
2004-12-13 20:57 Problems with ide-cs.c Richard Purdie
@ 2004-12-15 14:51 ` Richard Purdie
0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2004-12-15 14:51 UTC (permalink / raw)
To: linux-ide
I wrote:
> If the usage count for the device is non-zero ide_unregister will fail
> which is likely if you just pull the card out. This silent failure leads
> to all kinds of problems which break the device until it's rebooted -
> quite a serious bug. There is a fixme in ide-cs.c relating to this.
I've been looking into this. I think the simplest approach is to make sure
ide_unregister() succeeds regardless of any busy/usage status.
In order to make it succeed, I found I needed to add some checks on various
functions to see if drives were dead or interface's present. I've made a
working patch available at http://www.rpsys.net/openzaurus/ide.patch . If
someone who knows more about the ide system could have a look at this, I'd
appreciate it. If a patch along these lines could be included, it would
unbreak ide_unregister() and hence the ide_cs module.
Thanks,
Richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-12-15 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-13 20:57 Problems with ide-cs.c Richard Purdie
2004-12-15 14:51 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).