From: torvalds@transmeta.com (Linus Torvalds)
To: linux-kernel@vger.kernel.org
Subject: Re: ehci-hcd on CARDBUS hangs when stopping card service
Date: Fri, 24 May 2002 18:49:29 +0000 (UTC) [thread overview]
Message-ID: <acm1vp$2ak$1@penguin.transmeta.com> (raw)
In-Reply-To: <20020523171326.GA11562@kroah.com> <3CED6E0B.8020501@pacbell.net>
In article <3CED6E0B.8020501@pacbell.net>,
David Brownell <david-b@pacbell.net> wrote:
>
>Is there a clean way to detect the "card ejected before anything calls
>pci_dev->remove()" case? I don't really like the idea of wrapping code
>around every PCI register access to detect such cases.
You don't have much choice with CardBus, I'm afraid.
Even if the user were to do the rmmod "before" yanking out the card,
assuming that the rmmod took a bit of time and started the "remove()"
call at the same time the card was actually removed, you'll end up in
the same situation.
It's just a fact of life with any hot-plug thing that can be removed
without software first freeing it.
On most (practically all?) machines, a device that no longer exists will
return a nice floating 0xff for device reads, so it's usually reasonably
simple to detect (0xff is often not a legal status register value for
most devices for example).
Also, it's generally a good idea to "just say no" to endless loops in
drivers. Hardware bugs _do_ happen, and it's a lot more pleasant to have
the driver do a
printk("Device does not respond\n");
than for the kernel to hang.
Linus
next prev parent reply other threads:[~2002-05-24 18:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20020523171326.GA11562@kroah.com>
2002-05-23 22:32 ` ehci-hcd on CARDBUS hangs when stopping card service David Brownell
2002-05-24 18:49 ` Linus Torvalds [this message]
2002-05-26 13:41 ` David Woodhouse
2002-05-28 13:54 ` Ingo Oeser
[not found] ` <200205241849.g4OInTe02393@penguin.transmeta.com>
2002-05-25 17:15 ` David Brownell
2002-05-25 17:54 ` Linus Torvalds
2002-05-27 6:27 ` Borsenkow Andrej
2002-05-27 18:37 ` David Brownell
2002-05-27 10:54 ` Borsenkow Andrej
2002-05-23 6:33 Borsenkow Andrej
2002-05-23 6:39 ` Borsenkow Andrej
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='acm1vp$2ak$1@penguin.transmeta.com' \
--to=torvalds@transmeta.com \
--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