summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorHemant Kumar <hemantk@codeaurora.org>2017-05-30 14:52:18 -0700
committerHemant Kumar <hemantk@codeaurora.org>2017-05-30 15:09:08 -0700
commitf26a5ca3646f3f10b7306f11570538e2250425df (patch)
tree1f5a451eef712446a168a309fb3788ced7762435 /drivers/usb
parent25865f691b22d9b013cce032c06d3c0ed2485495 (diff)
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: Hemant Kumar <hemantk@codeaurora.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/pd/policy_engine.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/usb/pd/policy_engine.c b/drivers/usb/pd/policy_engine.c
index 7d893c5815e2..2d4cf1dd759b 100644
--- a/drivers/usb/pd/policy_engine.c
+++ b/drivers/usb/pd/policy_engine.c
@@ -1725,14 +1725,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,