[Skiboot] [PATCH] p8-i2c reset things manually in some error conditions

Stewart Smith stewart at linux.vnet.ibm.com
Fri Dec 2 14:56:50 AEDT 2016


Stewart Smith <stewart at linux.vnet.ibm.com> writes:
> It appears that our reset code wasn't entirely correct, and what we're
> meant to do is reset each port and wait for command complete. In the
> event where that fails, we can then bitbang things to recover to a state
> where at least the i2c engine isn't in a weird state.
>
> Practically, this means that "i2cdetect -y 10; i2cdetect -y 10" (where 10
> is the bus where a TPM is attached, typically p8e1p2) doesn't hard lock
> the machine (things are still bad and you won't reboot successfully, but
> it's *better*).
>
> one downside to this patch is that we spend a *long* time in OPAL (tens
> of ms) when doing the reset. This is something that we really need to fix,
> as it's not at all nice. The full fix for this though will involve changing
> a decent chunk of the p8-i2c code, as we don't want to write *any* registers
> while doing this extended reset (while existing code checks status a bit
> later).
>
> Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
> ---
>  hw/p8-i2c.c | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 157 insertions(+), 22 deletions(-)

Merged to master as of
and to 5.4.x as of 2924f7fd96564ed139927ee404699547c2350d5e

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list