Updated switch/glue patch?

Stefan Bethke stb at lassitu.de
Thu Dec 29 16:56:33 UTC 2011


Am 29.12.2011 um 11:18 schrieb Stefan Bethke:

> http://gitorious.org/~stb/freebsd/stb-adrianchadd-freebsd-work (branch work/ath)
> http://www.lassitu.de/freebsd/etherswitch-adrian.patch (patch against Adrians gitorious repo as of now)
> http://www.lassitu.de/freebsd/etherswitch.tbz (all files)


I've updated the patch:

Improve locking.

There is now one lock for the softc.  SMI bus access is serialized through a
softc field protected by sc_mtx.  All bus access functions can be called
with RTL_NOWAIT, making them punt immediately if the bus was already
acquired.  This allows the callout to try and read all three port status
registers, or just abort and wait for the next round.

For bus access through the control device, the functions are called with
RTL_WAITOK, which will make them sleep until the bus becomes available
(through the standard mtx_lock()).

With this version, I get no WITNESS warnings, nor panics from the callout.
The retries for I2C select and PHY register access always succeed (100k+
test accesses in a tight loop).


Stefan

-- 
Stefan Bethke <stb at lassitu.de>   Fon +49 151 14070811





More information about the freebsd-embedded mailing list