Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee2db9bc authored by Hemant Kumar's avatar Hemant Kumar Committed by Jack Pham
Browse files

usb: pd: policy_engine: Handle Get_Source_Cap properly from PE_SRC_Ready



Get_Source_Cap message is responded by sending source capability message
without running sender response timer after GoodCRC is received. As a
result if sender response is timed out driver is not issuing hard reset.
Fix the issue by moving policy engine state from PE_SRC_READY to
PE_SRC_SEND_CAPABILITIES which starts sender response timer and handles
timeout.

Change-Id: Id47a4c8f989db19d28ef9c8b2c069d0b7797e17f
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 796534e1
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -1734,14 +1734,8 @@ static void usbpd_sm(struct work_struct *w)

	case PE_SRC_READY:
		if (IS_CTRL(rx_msg, MSG_GET_SOURCE_CAP)) {
			ret = pd_send_msg(pd, MSG_SOURCE_CAPABILITIES,
					default_src_caps,
					ARRAY_SIZE(default_src_caps), SOP_MSG);
			if (ret) {
				usbpd_err(&pd->dev, "Error sending SRC CAPs\n");
				usbpd_set_state(pd, PE_SRC_SEND_SOFT_RESET);
				break;
			}
			pd->current_state = PE_SRC_SEND_CAPABILITIES;
			kick_sm(pd, 0);
		} else if (IS_CTRL(rx_msg, MSG_GET_SINK_CAP)) {
			ret = pd_send_msg(pd, MSG_SINK_CAPABILITIES,
					pd->sink_caps, pd->num_sink_caps,