Loading drivers/usb/pd/policy_engine.c +8 −2 Original line number Original line Diff line number Diff line Loading @@ -1649,8 +1649,11 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) u32 vdm_hdr; u32 vdm_hdr; int ret; int ret; if (!pd->vdm_tx) mutex_lock(&pd->svid_handler_lock); if (!pd->vdm_tx) { mutex_unlock(&pd->svid_handler_lock); return; return; } /* only send one VDM at a time */ /* only send one VDM at a time */ vdm_hdr = pd->vdm_tx->data[0]; vdm_hdr = pd->vdm_tx->data[0]; Loading @@ -1664,6 +1667,7 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) pd->current_pr == PR_SRC && !in_src_ams(pd)) { pd->current_pr == PR_SRC && !in_src_ams(pd)) { /* Set SinkTxNG and reschedule sm_work to send again */ /* Set SinkTxNG and reschedule sm_work to send again */ start_src_ams(pd, true); start_src_ams(pd, true); mutex_unlock(&pd->svid_handler_lock); return; return; } } Loading @@ -1673,6 +1677,7 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) usbpd_err(&pd->dev, "Error (%d) sending VDM command %d\n", usbpd_err(&pd->dev, "Error (%d) sending VDM command %d\n", ret, SVDM_HDR_CMD(pd->vdm_tx->data[0])); ret, SVDM_HDR_CMD(pd->vdm_tx->data[0])); mutex_unlock(&pd->svid_handler_lock); /* retry when hitting PE_SRC/SNK_Ready again */ /* retry when hitting PE_SRC/SNK_Ready again */ if (ret != -EBUSY && sop_type == SOP_MSG) if (ret != -EBUSY && sop_type == SOP_MSG) usbpd_set_state(pd, PE_SEND_SOFT_RESET); usbpd_set_state(pd, PE_SEND_SOFT_RESET); Loading Loading @@ -1705,6 +1710,7 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) } } pd->vdm_tx = NULL; pd->vdm_tx = NULL; mutex_unlock(&pd->svid_handler_lock); } } static void reset_vdm_state(struct usbpd *pd) static void reset_vdm_state(struct usbpd *pd) Loading @@ -1721,7 +1727,6 @@ static void reset_vdm_state(struct usbpd *pd) } } } } mutex_unlock(&pd->svid_handler_lock); pd->vdm_state = VDM_NONE; pd->vdm_state = VDM_NONE; kfree(pd->vdm_tx_retry); kfree(pd->vdm_tx_retry); pd->vdm_tx_retry = NULL; pd->vdm_tx_retry = NULL; Loading @@ -1732,6 +1737,7 @@ static void reset_vdm_state(struct usbpd *pd) pd->vdm_tx = NULL; pd->vdm_tx = NULL; pd->ss_lane_svid = 0x0; pd->ss_lane_svid = 0x0; pd->vdm_in_suspend = false; pd->vdm_in_suspend = false; mutex_unlock(&pd->svid_handler_lock); } } static void handle_get_src_cap_extended(struct usbpd *pd) static void handle_get_src_cap_extended(struct usbpd *pd) Loading Loading
drivers/usb/pd/policy_engine.c +8 −2 Original line number Original line Diff line number Diff line Loading @@ -1649,8 +1649,11 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) u32 vdm_hdr; u32 vdm_hdr; int ret; int ret; if (!pd->vdm_tx) mutex_lock(&pd->svid_handler_lock); if (!pd->vdm_tx) { mutex_unlock(&pd->svid_handler_lock); return; return; } /* only send one VDM at a time */ /* only send one VDM at a time */ vdm_hdr = pd->vdm_tx->data[0]; vdm_hdr = pd->vdm_tx->data[0]; Loading @@ -1664,6 +1667,7 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) pd->current_pr == PR_SRC && !in_src_ams(pd)) { pd->current_pr == PR_SRC && !in_src_ams(pd)) { /* Set SinkTxNG and reschedule sm_work to send again */ /* Set SinkTxNG and reschedule sm_work to send again */ start_src_ams(pd, true); start_src_ams(pd, true); mutex_unlock(&pd->svid_handler_lock); return; return; } } Loading @@ -1673,6 +1677,7 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) usbpd_err(&pd->dev, "Error (%d) sending VDM command %d\n", usbpd_err(&pd->dev, "Error (%d) sending VDM command %d\n", ret, SVDM_HDR_CMD(pd->vdm_tx->data[0])); ret, SVDM_HDR_CMD(pd->vdm_tx->data[0])); mutex_unlock(&pd->svid_handler_lock); /* retry when hitting PE_SRC/SNK_Ready again */ /* retry when hitting PE_SRC/SNK_Ready again */ if (ret != -EBUSY && sop_type == SOP_MSG) if (ret != -EBUSY && sop_type == SOP_MSG) usbpd_set_state(pd, PE_SEND_SOFT_RESET); usbpd_set_state(pd, PE_SEND_SOFT_RESET); Loading Loading @@ -1705,6 +1710,7 @@ static void handle_vdm_tx(struct usbpd *pd, enum pd_sop_type sop_type) } } pd->vdm_tx = NULL; pd->vdm_tx = NULL; mutex_unlock(&pd->svid_handler_lock); } } static void reset_vdm_state(struct usbpd *pd) static void reset_vdm_state(struct usbpd *pd) Loading @@ -1721,7 +1727,6 @@ static void reset_vdm_state(struct usbpd *pd) } } } } mutex_unlock(&pd->svid_handler_lock); pd->vdm_state = VDM_NONE; pd->vdm_state = VDM_NONE; kfree(pd->vdm_tx_retry); kfree(pd->vdm_tx_retry); pd->vdm_tx_retry = NULL; pd->vdm_tx_retry = NULL; Loading @@ -1732,6 +1737,7 @@ static void reset_vdm_state(struct usbpd *pd) pd->vdm_tx = NULL; pd->vdm_tx = NULL; pd->ss_lane_svid = 0x0; pd->ss_lane_svid = 0x0; pd->vdm_in_suspend = false; pd->vdm_in_suspend = false; mutex_unlock(&pd->svid_handler_lock); } } static void handle_get_src_cap_extended(struct usbpd *pd) static void handle_get_src_cap_extended(struct usbpd *pd) Loading