Re: ehci-hcd on CARDBUS hangs when stopping card service

David Brownell (david-b@pacbell.net)
Sat, 25 May 2002 10:15:15 -0700


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

Seems to me it'd be worth mentioning this issue somewhere in the
documentation or source. One could get the impression that the
main issue for a CardBus-enabled PCI driver is to make sure that
the "new style" driver APIs -- with a DEVICE_TABLE etc -- are used.
(Maybe just a brief comment in <asm/io.h> ...)

> Also, it's generally a good idea to "just say no" to endless loops in
> drivers.

I'm hardly averse to changing that loop (which normally does have an end :)
and I expected to need to at some point. It's interesting to me just how
long that has been there without causing problems. In this case the root
cause is that Cardbus "improper shutdown sequence" problem, so "no end"
is just a particularly nasty secondary failure mode.

- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/