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

Commit c1afdaff authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville
Browse files

ath9k: fix going to full-sleep on PS idle



The check for PS_WAIT_FOR_TX_ACK was inverted, the hardware should only go
to full sleep if no tx is pending.

Reported-by: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ffb1c56a
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -118,13 +118,15 @@ void ath9k_ps_restore(struct ath_softc *sc)
	if (--sc->ps_usecount != 0)
		goto unlock;

	if (sc->ps_idle && (sc->ps_flags & PS_WAIT_FOR_TX_ACK))
	if (sc->ps_flags & PS_WAIT_FOR_TX_ACK)
		goto unlock;

	if (sc->ps_idle)
		mode = ATH9K_PM_FULL_SLEEP;
	else if (sc->ps_enabled &&
		 !(sc->ps_flags & (PS_WAIT_FOR_BEACON |
			      PS_WAIT_FOR_CAB |
			      PS_WAIT_FOR_PSPOLL_DATA |
			      PS_WAIT_FOR_TX_ACK)))
			      PS_WAIT_FOR_PSPOLL_DATA)))
		mode = ATH9K_PM_NETWORK_SLEEP;
	else
		goto unlock;