Updated switch/glue patch?

Adrian Chadd adrian at freebsd.org
Tue Dec 20 03:53:53 UTC 2011


Hi,

I've just dumped some more locking fixes into -HEAD. I've also changed
iicbb.c a little so it has a configurable udelay. Sorry Stefan, you're
going to have to rebase your iicbb changes. :)

With the default per-bit sleep of 10uS, a rough calculation is:

* 3 sleeps per bit: 30uS per bit
* 8 bits per byte
* 1 bit for ACK
* == 12 bits per byte: 360uS a byte

Each transaction is what, 5 bytes or 6 btyes total? I'll say 6 bytes,
to be conservative. That's 2.1ms a transaction. Say thirty register
accesses a second (for 5 switch PHY ports) - 63mS. I still think
that's a bit low. But that's minimum 63mS of DELAY(), each second.
Nothing else occurs during that.

I've dropped the udelay parameter from 10 to 2 and had things work
successfully. It still wastes a significant fraction of 100mS of CPU
time each second.

Sorry, but there has to be a better way to do this. Is it possible to
just only poll a minimal set of PHY registers each second, rather than
polling them all?


Adrian


More information about the freebsd-embedded mailing list