]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
wil6210: missing reinit_completion in HALP voting
authorMaya Erez <qca_merez@qca.qualcomm.com>
Wed, 8 Mar 2017 11:52:14 +0000 (13:52 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 9 Mar 2017 08:04:18 +0000 (10:04 +0200)
After setting HALP ICR bit, we keep it set until HALP unvote.
Masking HALP ICR should protect the driver from hitting the HALP ICR
over and over again. However, in case there is another MISC ICR
we will read the HALP ICR and issue a completion. This can lead to
a case where HALP voting is completed immediately, as the completion
is already set.
Reinit the HALP completion before the actual vote will clear previous
completions and protect from such cases.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/wil6210/main.c

index 21b7faca2c9b4304974642e8f188123eb0666a08..dddde94f03566cf26d422136aebc7bb3691466b4 100644 (file)
@@ -1158,6 +1158,7 @@ void wil_halp_vote(struct wil6210_priv *wil)
                    wil->halp.ref_cnt);
 
        if (++wil->halp.ref_cnt == 1) {
+               reinit_completion(&wil->halp.comp);
                wil6210_set_halp(wil);
                rc = wait_for_completion_timeout(&wil->halp.comp, to_jiffies);
                if (!rc) {