The 3c509 driver and SMP in 2.1.x

Alan Cox (alan@lxorguk.ukuu.org.uk)
Tue, 8 Dec 98 21:34 GMT


I've done a pile more digging. We can avoid some of the locking with a bit
of a driver change it seems. The locks are needed but most of them are
probably controllable.

If we are transmitting and take an interrupt which requests a status update
we trash the statistics data and the packet (the other CPU blasts the packet
into the stats window not the tx fifo) and bits of it vanish.

Because this is from an IRQ we also can't use simple spinlocks - an
irq on the same processor would cause a deadlock if that IRQ occured during
a TX and wanted to clear the stats.

Just ignoring the pending stats request doesnt work (at least not on a 3c529
although probably on a 509), but it does look like it should be possible
to make the get_stats function test the lock and if it fails instead
of reading the stats set an internal driver flag to read the stats 'asap'
and then mask that IRQ bit.

Someone may want to play with that idea.

Alan

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