linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard Purdie" <rpurdie@rpsys.net>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: Flaw in ide_unregister()
Date: Mon, 10 Jan 2005 12:39:15 -0000	[thread overview]
Message-ID: <019201c4f711$67237c20$0f01a8c0@max> (raw)
In-Reply-To: 1105314226.12054.57.camel@localhost.localdomain

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 


  reply	other threads:[~2005-01-10 12:42 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
2005-01-09 22:37   ` Richard Purdie
2005-01-10 11:09     ` Alan Cox
2005-01-10 12:39       ` Richard Purdie [this message]
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:
  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='019201c4f711$67237c20$0f01a8c0@max' \
    --to=rpurdie@rpsys.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@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).