mirror of https://gitee.com/openkylin/linux.git
USB fix for 5.14-rc7
Here is a single USB typec tcpm fix for a reported problem for 5.14-rc7. It showed up in 5.13 and resolves an issue that Hans found. It has been in linux-next this week with no reported problems. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYSEgIQ8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ymZpQCfeD9XR0ExAJgn7E0sNuLaOi2BxmUAn3Eu2IFu dFcSEpQtg23mY6aBFWfH =7kfD -----END PGP SIGNATURE----- Merge tag 'usb-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb Pull USB fix from Greg KH: "Here is a single USB typec tcpm fix for a reported problem for 5.14-rc7. It showed up in 5.13 and resolves an issue that Hans found. It has been in linux-next this week with no reported problems" * tag 'usb-5.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: usb: typec: tcpm: Fix VDMs sometimes not being forwarded to alt-mode drivers
This commit is contained in:
commit
f4ff9e6b01
|
@ -1737,6 +1737,10 @@ static int tcpm_pd_svdm(struct tcpm_port *port, struct typec_altmode *adev,
|
|||
return rlen;
|
||||
}
|
||||
|
||||
static void tcpm_pd_handle_msg(struct tcpm_port *port,
|
||||
enum pd_msg_request message,
|
||||
enum tcpm_ams ams);
|
||||
|
||||
static void tcpm_handle_vdm_request(struct tcpm_port *port,
|
||||
const __le32 *payload, int cnt)
|
||||
{
|
||||
|
@ -1764,11 +1768,11 @@ static void tcpm_handle_vdm_request(struct tcpm_port *port,
|
|||
port->vdm_state = VDM_STATE_DONE;
|
||||
}
|
||||
|
||||
if (PD_VDO_SVDM(p[0])) {
|
||||
if (PD_VDO_SVDM(p[0]) && (adev || tcpm_vdm_ams(port) || port->nr_snk_vdo)) {
|
||||
rlen = tcpm_pd_svdm(port, adev, p, cnt, response, &adev_action);
|
||||
} else {
|
||||
if (port->negotiated_rev >= PD_REV30)
|
||||
tcpm_queue_message(port, PD_MSG_CTRL_NOT_SUPP);
|
||||
tcpm_pd_handle_msg(port, PD_MSG_CTRL_NOT_SUPP, NONE_AMS);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2471,10 +2475,7 @@ static void tcpm_pd_data_request(struct tcpm_port *port,
|
|||
NONE_AMS);
|
||||
break;
|
||||
case PD_DATA_VENDOR_DEF:
|
||||
if (tcpm_vdm_ams(port) || port->nr_snk_vdo)
|
||||
tcpm_handle_vdm_request(port, msg->payload, cnt);
|
||||
else if (port->negotiated_rev > PD_REV20)
|
||||
tcpm_pd_handle_msg(port, PD_MSG_CTRL_NOT_SUPP, NONE_AMS);
|
||||
tcpm_handle_vdm_request(port, msg->payload, cnt);
|
||||
break;
|
||||
case PD_DATA_BIST:
|
||||
port->bist_request = le32_to_cpu(msg->payload[0]);
|
||||
|
|
Loading…
Reference in New Issue