mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-31 11:01:19 +00:00
pd: set previous protocol state appropriately after a hard reset
Set the PD protocol last state to hard reset when executing a hard reset. This fixes a bug in which if we receive a hard reset while in one of the hard reset recovery states the last state doesn't change, which means we don't restart timeout periods and it is possible to be indefinitely stuck in the hard reset recovery state until PD MCU reboots. BUG=none BRANCH=samus TEST=when connecting samus port 0 to port 1 we get a very crappy PD connection and about 1 in 5 times it causes us to get stuck in SNK_HARD_RESET_RECOVER until a reboot. with this fix, we never get stuck. Change-Id: I294462ffa56a804ca613535ab9bdc466175f8066 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/241871 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
cea3f26d5d
commit
476e1cedae
@@ -809,6 +809,12 @@ static void execute_hard_reset(int port)
|
||||
pd_dfp_pe_init(port);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Fake set last state to hard reset to make sure that the next
|
||||
* state to run knows that we just did a hard reset.
|
||||
*/
|
||||
pd[port].last_state = PD_STATE_HARD_RESET_EXECUTE;
|
||||
|
||||
#ifdef CONFIG_USB_PD_DUAL_ROLE
|
||||
/*
|
||||
* If we are swapping to a source and have changed to Rp, restore back
|
||||
|
||||
Reference in New Issue
Block a user