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

Commit a850af78 authored by Maya Erez's avatar Maya Erez
Browse files

wil6210: stop TX queues when suspending



Stop TX queues before suspending in order to prevent TX
packets drops.

Change-Id: Ieda3eef72e20005041c132765c28c8071621844f
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent b1e46ed5
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -98,6 +98,10 @@ static int wil_resume_keep_radio_on(struct wil6210_priv *wil)
		}
	}

	/* Wake all queues */
	if (test_bit(wil_status_fwconnected, wil->status))
		wil_update_net_queues_bh(wil, NULL, false);

out:
	if (rc)
		set_bit(wil_status_suspended, wil->status);
@@ -113,6 +117,7 @@ static int wil_suspend_keep_radio_on(struct wil6210_priv *wil)

	/* Prevent handling of new tx and wmi commands */
	set_bit(wil_status_suspending, wil->status);
	wil_update_net_queues_bh(wil, NULL, true);

	if (!wil_is_tx_idle(wil)) {
		wil_dbg_pm(wil, "Pending TX data, reject suspend\n");
@@ -201,13 +206,17 @@ static int wil_suspend_keep_radio_on(struct wil6210_priv *wil)
	clear_bit(wil_status_suspending, wil->status);
	rc = wmi_resume(wil);
	/* if resume succeeded, reject the suspend */
	if (!rc)
	if (!rc) {
		rc = -EBUSY;

		if (test_bit(wil_status_fwconnected, wil->status))
			wil_update_net_queues_bh(wil, NULL, false);
	}
	return rc;

reject_suspend:
	clear_bit(wil_status_suspending, wil->status);
	if (test_bit(wil_status_fwconnected, wil->status))
		wil_update_net_queues_bh(wil, NULL, false);
	return -EBUSY;
}

+5 −0
Original line number Diff line number Diff line
@@ -1930,6 +1930,11 @@ static inline void __wil_update_net_queues(struct wil6210_priv *wil,
		return;
	}

	/* Do not wake the queues in suspend flow */
	if (test_bit(wil_status_suspending, wil->status) ||
	    test_bit(wil_status_suspended, wil->status))
		return;

	/* check wake */
	for (i = 0; i < WIL6210_MAX_TX_RINGS; i++) {
		struct vring *cur_vring = &wil->vring_tx[i];