hw/p8-i2c: Fix OCC locking
hw/p8-i2c: Fix OCC locking

There's a few issues with the Host<->OCC I2C bus handshaking. First up,
skiboot is currently examining the wrong bit when checking if the OCC
is currently using the bus. Secondly, when we need to wait for the OCC
to release the bus we are scheduling a recovery timer to run zero
timebase ticks after the current moment so the recovery timeout handler
will run immediately after the bus was requested, which will in turn
re-schedule itself, etc, etc. There's also a race between the OCC
interrupt and the recovery handler which can result in an assertion
failure in the recovery thread. All of this is bad.

This patch addresses all these issues and sets the recovery timeout to
10ms.

Signed-off-by: Oliver O'Halloran <3dfaff8fa6ae977f042064a112a6aac576279b9b@gmail.com>
Signed-off-by: Stewart Smith <ec31ab75ddf977353c8f660f92ea8b23f64aef25@linux.vnet.ibm.com>

open-power/skiboot,shenki/skiboot,legoater/skiboot,qemu/skiboot,shenki/skiboot,shenki/skiboot,legoater/skiboot,open-power/skiboot,shenki/skiboot,legoater/skiboot,qemu/skiboot,legoater/skiboot,qemu/skiboot,shenki/skiboot,open-power/skiboot,qemu/skiboot,stewart-ibm/skiboot,legoater/skiboot,stewart-ibm/skiboot,stewart-ibm/skiboot,qemu/skiboot,open-power/skiboot,open-power/skiboot