Updated switch/glue patch?
Stefan Bethke
stb at lassitu.de
Sun Dec 18 10:17:52 UTC 2011
Am 18.12.2011 um 11:11 schrieb Adrian Chadd:
> On 18 December 2011 01:54, Adrian Chadd <adrian at freebsd.org> wrote:
>
>> Just as a side note - reducing the udelay value from 10 to 1 in my git
>> tree doesn't stop the huge CPU use. I'm going to next try removing the
>> locking, as I note that each GPIO access involves a mutex lock and I
>> bet the witness code is taking a freaking beating here.
>
> .. yup. Not compiling in witness helps hugely. I wish I had PMC
> working at this point - I bet lots of lock overhead would creep up.
>
> Basically, a lock is acquired for each GPIO pin set, clear and
> reconfigure. The gpiobus code itself doesn't do this - that's what
> gpiobus_lock_bus and gpiobus_unlock_bus is for - but the ar71xx gpio
> code however does. And so does the gpioiic code - it's locking and
> unlocking the bus for each scl/sda line operation.
>
> Erm, surely that's a bit ridiculous.. surely the locking doesn't need
> to be that fine grained _and_ multi-levelled. There has to be a better
> way to do this. :)
Exactly.
I've reimplemented iicbb.c to be slightly more protocol compliant, and to be able to tune transfer speeds to the actual hardware capabilities. I've timed a single GETSCL (with WITNESS) to 8.7 microseconds, clearly that won't do.
I think I'll look at gpio next, as you have, and see if the overhead can be reduced.
Stefan
--
Stefan Bethke <stb at lassitu.de> Fon +49 151 14070811
More information about the freebsd-embedded
mailing list