• Tomer Tayar's avatar
    habanalabs: prevent false heartbeat failure during soft-reset · 930feb41
    Tomer Tayar authored
    The heartbeat thread is active during soft-reset, and it tries to send
    messages to CPU-CP core.
    Within the soft-reset, in the time window in which the device is marked
    as disabled, any CPU-CP command is "silently" skipped and a success
    value it returned.
    However, in addition to the return value, the heartbeat function also
    checks the F/W result, but because no command is sent in this time
    window, the result variable won't hold the expected value and we will
    have a false heartbeat failure.
    
    To avoid it, modify the "silent" skip to be done only in hard-reset.
    The CPU-CP should be able to handle messages during soft-reset.
    
    In addition to the heartbeat problem, this should also solve other
    issues in other flows that send messages during soft-reset and use the
    F/W result as it w/o being aware to the reset.
    Signed-off-by: default avatarTomer Tayar <ttayar@habana.ai>
    Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
    Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
    930feb41
firmware_if.c 74.9 KB