linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard Purdie" <rpurdie@rpsys.net>
To: linux-ide@vger.kernel.org
Subject: Problems with ide-cs.c
Date: Mon, 13 Dec 2004 20:57:20 -0000	[thread overview]
Message-ID: <046201c4e156$5862e610$0f01a8c0@max> (raw)

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


             reply	other threads:[~2004-12-13 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-13 20:57 Richard Purdie [this message]
2004-12-15 14:51 ` Problems with ide-cs.c Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='046201c4e156$5862e610$0f01a8c0@max' \
    --to=rpurdie@rpsys.net \
    --cc=linux-ide@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).