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

Commit bf9d9a75 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Gerrit - the friendly Code Review server
Browse files

usb: gsi: Fix USB CV L1 suspend test case failure in RNDIS composition



As a part of Remote wakeup test case, in resume path gsi driver
enabling rndis flow control for RNDIS case and starting the
transfers. Followed by L1 test case is running and device sending
NYET for L1 suspend command and failing the test case.

During L1 suspend test case If requests are queued to the Hardware it
will not allow the suspend.

Added is_flow_ctrl_enable flag to ensure whether flow control enabled
by the host with RNDIS_MSG_INIT before. If it is enabled before then only
enable it gain from resume path.

During CV tests host does not send RNDIS_MSG_INT to enable flow control
and test will pass.

Change-Id: Ifd567d910d6571ec3ac0c1eef2da1ee06d9c8fd5
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 94a77572
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1772,6 +1772,12 @@ void gsi_rndis_flow_ctrl_enable(bool enable, struct rndis_params *param)
	} else {
		log_event_dbg("%s: posting HOST_READY\n", __func__);
		post_event(d_port, EVT_HOST_READY);
		/*
		 * If host supports flow control with RNDIS_MSG_INIT then
		 * mark the flag to true. This flag will be used further to
		 * enable the flow control on resume path.
		 */
		gsi->host_supports_flow_control = true;
	}

	queue_delayed_work(gsi->d_port.ipa_usb_wq, &gsi->d_port.usb_ipa_w, 0);
@@ -2410,6 +2416,8 @@ static void gsi_disable(struct usb_function *f)

	gsi->data_interface_up = false;

	gsi->host_supports_flow_control = false;

	log_event_dbg("%s deactivated", gsi->function.name);
	gsi->d_port.net_ready_trigger = false;
	post_event(&gsi->d_port, EVT_DISCONNECTED);
@@ -2459,10 +2467,12 @@ static void gsi_resume(struct usb_function *f)
	/*
	 * Linux host does not send RNDIS_MSG_INIT or non-zero
	 * RNDIS_MESSAGE_PACKET_FILTER after performing bus resume.
	 * Check whether host supports flow_control are not. If yes
	 * Trigger state machine explicitly on resume.
	 */
	if (gsi->prot_id == IPA_USB_RNDIS &&
			!usb_gsi_remote_wakeup_allowed(f))
			!usb_gsi_remote_wakeup_allowed(f) &&
			gsi->host_supports_flow_control)
		rndis_flow_control(gsi->params, false);

	post_event(&gsi->d_port, EVT_RESUMED);
+1 −1
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ struct f_gsi {
	struct timer_list gsi_rw_timer;
	u8 debugfs_rw_timer_enable;
	u16 gsi_rw_timer_interval;

	bool host_supports_flow_control;
};

static inline struct f_gsi *func_to_gsi(struct usb_function *f)