Subject: Re: wi0: recap
To: Peter Seebach <firstname.lastname@example.org>
From: Bill Sommerfeld <email@example.com>
Date: 12/26/2000 19:30:48
Of course, the correct thing is to figure out why the device is
failing to accept the command and unbusy; however, there is a bandaid
for underdocumented and/or buggy network hardware. Simply add a
watchdog timer: if the hardware is handed a packet to transmit and
fails to interrupt within a given time interval, hit it with a
metaphoric 2x4 to reset it.
This sort of thing is sufficiently common that there's a special hack
in the network driver API for it; see ifp->if_timer and
ifp->if_watchdog, and sys/net/if.c:if_slowtimeo().
if_wi.c already has a watchdog timer in it; however, it may not be
using a heavy enough 2x4:
> Unfortunately, under certain circumstances, the cards hang. Hanging looks
> * The first command after a hang times out.
> * The second command also times out, and when it's done, the command
> register has the busy bit set.
> * The third command, of course, times out because the command register
> has the busy bit set. (My patch tries to wait for the command
> register, Just In Case.)
> After this, nothing will ever work again. No interrupts are received, the
> card is hosed.
Could be that the card's internal firmware crashed.
> "ifconfig wi0 down; ifconfig wi0 up" fixes it, though.
well, this is the ultimate hammer because it power-cycles the card.
If all else fails, you could have the driver reset the card in this
case (doing a pcmcia_function_disable() followed by a
pcmcia_function_enable() to cycle the power to the card, following by
reinitializing the card).