Updated switch/glue patch?
Adrian Chadd
adrian at freebsd.org
Wed Dec 28 18:35:09 UTC 2011
On 28 December 2011 05:52, Stefan Bethke <stb at lassitu.de> wrote:
> Implement a number of suggestions by Adrian:
> * add mutex to callout
> * add locking macros
> * rename _lockheld to _locked
> * bring debugging under DEBUG, incl. sysctls
> * move i2c select retry to its own function
> * mtx_sleep when retrying the select
> * only reset bus on probe
> * do not DELAY on phy access retries
> * count phy access retries (under DEBUG)
>
> 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)
The patch didn't compile - you were missing softc *sc pointers in
smi_read_locked and smi_write_locked.
Then when I added it:
iicbb0: <I2C bit-banging driver> on gpioiic0
iicbb0: udelay=5 microseconds
iicbus0: <Philips I2C bus> on iicbb0 master-only
iic0: <I2C generic I/O> on iicbus0
panic: mutex (null) not owned at
/home/adrian/work/freebsd/git/adrianchadd-freebsd-work/adrianchadd-freebsd-work/sys/dev/etherswitch/rtl8366rb.c:365
KDB: enter: panic
.. and I bet it's because the path through rtl8366rb_probe() calls
smi_read_locked() without things being locked. Which it can't be,
there's no softc yet. :)
So perhaps you need an smi_read() which doesn't have a lock, and use
that just for the probe path.
Also, remember to use braces ( ) around fields in a macro. :)
Adrian
More information about the freebsd-embedded
mailing list