[Skiboot] [PATCH 1/4] i2c: Add i2c_run_req() to crank the state machine for a request

Stewart Smith stewart at linux.vnet.ibm.com
Thu Nov 24 17:15:54 AEDT 2016


Stewart Smith <stewart at linux.vnet.ibm.com> writes:
> Doing everything asynchronously is brilliant, it's exactly what we
> want to do.
>
> Except... the tpm driver wants to do things synchronously, which isn't
> so cool.
>
> For reasons that are not yet completely known, we spend an awful lot of
> time in the main thread *not* running pollers (potentially seconds), which
> doesn't bode well for I2C timeouts.
>
> Since the TPM measure is done in a secondary thread, we do *not* run pollers
> there either (as of 323c8aeb54bd4e0b9004091fcbb4a9daeda2f576 - which is
> roughly as of skiboot 2.1.1).
>
> But we still need to crank the i2c state machine, so we introduce a call
> to do just that. It will return how long the poll interval should be, so
> that we can time_wait() for a more appropriate time for whatever i2c
> implementation is sitting behind things.
>
> Without this, it was "easy" to get to a situation where the i2c state machine
> wasn't cranked at all, and you'd hit the i2c timeout (for the issued operation)
> before the poller to crank i2c was ever called.
>
> Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
> ---
>  hw/p8-i2c.c                        | 18 ++++++++++++++++++
>  include/i2c.h                      |  8 ++++++++
>  libstb/drivers/tpm_i2c_interface.c | 14 +++++++++-----
>  3 files changed, 35 insertions(+), 5 deletions(-)

Series (with v2 patches where applicable) merged to master as of
6c077e9ed08c7af7db56ef6f334d204f78e6de8d

Also cherry-picked back to 5.4.x as of:
[skiboot-5.4.x f176f5c]

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list