The EGD driver can end up locked in the JSD_EGD_STATE_MACHINE_STATE_FAULT if the following sequence of events happens:
- A fault occurs in the EGD. State transitions to
JSD_EGD_STATE_MACHINE_STATE_FAULT.
- The timeout to retrieve the error expires (i.e.
state->pub.fault_code is set to JSD_EGD_FAULT_UNKNOWN).
- Driver transitions out of
JSD_EGD_STATE_MACHINE_STATE_FAULT.
- Before a reset is issued, another fault occurs and cannot be retrieved either.
- Because
state->pub.fault_code is still JSD_EGD_FAULT_UNKNOWN at this point, the code will never execute the timeout since the if clause to act on the timeout requires state->pub.fault_code to be different from JSD_EGD_FAULT_UNKNOWN.
I think the solution is to remove the check of state->pub.fault_code in the if clause. It does not seem that check is actually needed for the proper functioning of the code.
@alex-brinkman, can you corroborate the above reasoning or clarify why the check on state->pub.fault_code is done?
The EGD driver can end up locked in the
JSD_EGD_STATE_MACHINE_STATE_FAULTif the following sequence of events happens:JSD_EGD_STATE_MACHINE_STATE_FAULT.state->pub.fault_codeis set toJSD_EGD_FAULT_UNKNOWN).JSD_EGD_STATE_MACHINE_STATE_FAULT.state->pub.fault_codeis stillJSD_EGD_FAULT_UNKNOWNat this point, the code will never execute the timeout since the if clause to act on the timeout requiresstate->pub.fault_codeto be different fromJSD_EGD_FAULT_UNKNOWN.I think the solution is to remove the check of
state->pub.fault_codein the if clause. It does not seem that check is actually needed for the proper functioning of the code.@alex-brinkman, can you corroborate the above reasoning or clarify why the check on
state->pub.fault_codeis done?