wil6210: fix L2 RX status handling
authorMaya Erez <merez@codeaurora.org>
Wed, 31 Oct 2018 08:52:19 +0000 (10:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Dec 2019 08:17:19 +0000 (09:17 +0100)
[ Upstream commit 04de15010aa42a92add66b159e3ae44b4287390f ]

L2 RX status errors should not be treated as a bitmap and the actual
error values should be checked.
Print L2 errors as wil_err_ratelimited for easier debugging
when such errors occurs.

Signed-off-by: Maya Erez <merez@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/wil6210/txrx_edma.c

index 409a6fa..5fa8d6a 100644 (file)
@@ -808,23 +808,24 @@ static int wil_rx_error_check_edma(struct wil6210_priv *wil,
                wil_dbg_txrx(wil, "L2 RX error, l2_rx_status=0x%x\n",
                             l2_rx_status);
                /* Due to HW issue, KEY error will trigger a MIC error */
-               if (l2_rx_status & WIL_RX_EDMA_ERROR_MIC) {
-                       wil_dbg_txrx(wil,
-                                    "L2 MIC/KEY error, dropping packet\n");
+               if (l2_rx_status == WIL_RX_EDMA_ERROR_MIC) {
+                       wil_err_ratelimited(wil,
+                                           "L2 MIC/KEY error, dropping packet\n");
                        stats->rx_mic_error++;
                }
-               if (l2_rx_status & WIL_RX_EDMA_ERROR_KEY) {
-                       wil_dbg_txrx(wil, "L2 KEY error, dropping packet\n");
+               if (l2_rx_status == WIL_RX_EDMA_ERROR_KEY) {
+                       wil_err_ratelimited(wil,
+                                           "L2 KEY error, dropping packet\n");
                        stats->rx_key_error++;
                }
-               if (l2_rx_status & WIL_RX_EDMA_ERROR_REPLAY) {
-                       wil_dbg_txrx(wil,
-                                    "L2 REPLAY error, dropping packet\n");
+               if (l2_rx_status == WIL_RX_EDMA_ERROR_REPLAY) {
+                       wil_err_ratelimited(wil,
+                                           "L2 REPLAY error, dropping packet\n");
                        stats->rx_replay++;
                }
-               if (l2_rx_status & WIL_RX_EDMA_ERROR_AMSDU) {
-                       wil_dbg_txrx(wil,
-                                    "L2 AMSDU error, dropping packet\n");
+               if (l2_rx_status == WIL_RX_EDMA_ERROR_AMSDU) {
+                       wil_err_ratelimited(wil,
+                                           "L2 AMSDU error, dropping packet\n");
                        stats->rx_amsdu_error++;
                }
                return -EFAULT;