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

Commit 133f3503 authored by Jack Pham's avatar Jack Pham Committed by Gerrit - the friendly Code Review server
Browse files

usb: pd: Relinquish Source AMS after every VDM transaction



When performing VDM message discovery each VDM initiator and
response exchange is considered an interruptible AMS. Hence
as a PD 3.0 source, relinquish Rp to SinkTxOk to allow the
sink a chance to initiate an AMS as soon as the response is
received. In particular this fixes some DisplayPort use cases
with a PD 3.0 sink in which incoming Attention messages are
blocked due to SinkTxNG while DP Configure message is being
handled.

Change-Id: I5edf298b7244352659b9d41a6e65e934e99a9c24
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent e77f22c4
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1468,7 +1468,7 @@ static void usbpd_set_state(struct usbpd *pd, enum usbpd_state next_state)

		pd->in_explicit_contract = true;

		if (pd->vdm_tx)
		if (pd->vdm_tx && !pd->sm_queued)
			kick_sm(pd, 0);
		else if (pd->current_dr == DR_DFP && pd->vdm_state == VDM_NONE)
			usbpd_send_svdm(pd, USBPD_SID,
@@ -1859,6 +1859,10 @@ static void handle_vdm_rx(struct usbpd *pd, struct rx_msg *rx_msg)
		return;
	}

	if (cmd_type != SVDM_CMD_TYPE_INITIATOR &&
			pd->current_state != PE_SRC_STARTUP_WAIT_FOR_VDM_RESP)
		start_src_ams(pd, false);

	if (handler && handler->svdm_received) {
		handler->svdm_received(handler, cmd, cmd_type, vdos, num_vdos);

@@ -2714,8 +2718,6 @@ static void usbpd_sm(struct work_struct *w)
			vconn_swap(pd);
		} else if (IS_DATA(rx_msg, MSG_VDM)) {
			handle_vdm_rx(pd, rx_msg);
			if (!pd->vdm_tx)
				start_src_ams(pd, false);
		} else if (IS_CTRL(rx_msg, MSG_GET_SOURCE_CAP_EXTENDED)) {
			handle_get_src_cap_extended(pd);
		} else if (IS_EXT(rx_msg, MSG_GET_BATTERY_CAP)) {