archive mirror
 help / color / mirror / Atom feed
From: Alan Cox <>
To: Richard Purdie <>
Cc: Linux Kernel Mailing List <>
Subject: Re: Flaw in ide_unregister()
Date: Sun, 02 Jan 2005 14:36:49 +0000	[thread overview]
Message-ID: <1104674725.14712.50.camel@localhost.localdomain> (raw)
In-Reply-To: <007e01c4ef30$f23ba3c0$0f01a8c0@max>

On Gwe, 2004-12-31 at 12:04, Richard Purdie wrote:
> I've been having some problems with calls to ide_unregister() (in ide.c).
> This function is declared void which should mean it always succeeds and yet 
> it can fail *silently* under the following condition:

Actually in 2.4.x and 2.6.x (except 2.6.9-ac and 2.6.10-ac) its
essentially unusable and full of races and should always be avoided.

> 3. Add a return value. What does ide-cs.c do with it though? The hardware is 
> gone. (doesn't help)

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...");
		while(ide_unregister_hwif(hwif) < 0)

I've just not had time yet to propogate this into the drivers and into
the new PCI helper for hotplugging IDE controllers.


  reply	other threads:[~2005-01-02 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-31 12:04 Flaw in ide_unregister() Richard Purdie
2005-01-02 14:36 ` Alan Cox [this message]
2005-01-09 22:37   ` Richard Purdie
2005-01-10 11:09     ` Alan Cox
2005-01-10 12:39       ` Richard Purdie
2005-01-10 19:23         ` Alan Cox
2005-01-10 21:17           ` 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:

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

  git send-email \
    --in-reply-to=1104674725.14712.50.camel@localhost.localdomain \ \ \ \

* 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).