Subject: Re: Inserting wavelan card disrupts USB sound playback?
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: enami tsugutomo <enami@but-b.or.jp>
List: current-users
Date: 10/18/2000 08:05:29
Jonathan Stone <jonathan@DSG.Stanford.EDU> writes:

> Oops... something I forgot to mention is the other drivers for pc-card
> NICs interrupt routines dont check for IFF_RUNNING.  Both
> sys/dev/ic/dp8390.c:dp8390intr() and sys/dev/ic/elink3:epintr() check
> for DVF_ACTIVE and a device-softc "enabled" flag, but not IFF_RUNNING.

Yes, since they were initially drivers only for isa card.  And,
acutally, if irq isn't shared, testing enabled flag or IFF_RUNNING are
same, since interrupts are blocked during ioctl.

> I think both have a race: when sharing an already-busy interrupt, the
> pc-card can power the card up, but not set IFF_RUNNING; and a
> subsequent interrupt will result in the interrupt-hanlder frobbing
> card registers before it should (sc_enabled set, but IFF_RUNNING not set).

So, the answer is test IFF_RUNNING instead of enabled flag.

enami.