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

Linus Torvalds (torvalds@transmeta.com)
Sat, 25 May 2002 10:54:46 -0700 (PDT)


On Sat, 25 May 2002, David Brownell wrote:
>
> 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> ...)

Documentation might be a good thing, indeed. I doubt <asm/io.h> is the
right place for it, people tend to look at other drivers etc to pattern
after (as clearly showed by how often a bug in one place is replicated in
lots of other places ;)

We've actually fixed a number of these things - there are drivers that
notice removal on their own silently, and just turn it into a no-op.

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

Most people don't unplug their devices while they are in use, and on
cardbus the most common case ends up (I think) being the fact that the
cardbus PCI static interrupt itself is shared with the device interrupt.
So what happens is that when you remove the CardBus card, that causes the
cardbus controller to send an interrupt (for removal), but since that
interrupt is shared with the card driver, the card driver also sees the
interrupt even if the card itself is otherwise idle.

This meant that some tulip cards at least were _guaranteed_ to lock up
some time ago, simply because their interrupt handler would loop forever
on seeing the "more work" bit continually (all bits in the status register
were set due to the removal and floating data lines).

Linus

-
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/