This is a note to let you know that I've just added the patch titled rtlwifi: rtl8192ee: Fix problems with calculating free space in FIFO to the 3.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: rtlwifi-rtl8192ee-fix-problems-with-calculating-free-space-in-fifo.patch and it can be found in the queue-3.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 6d4beca3775222884e1ee9d48ef586c438c3dfa1 Mon Sep 17 00:00:00 2001 From: Larry Finger <Larry.Finger@xxxxxxxxxxxx> Date: Tue, 3 Feb 2015 11:15:18 -0600 Subject: rtlwifi: rtl8192ee: Fix problems with calculating free space in FIFO From: Larry Finger <Larry.Finger@xxxxxxxxxxxx> commit 6d4beca3775222884e1ee9d48ef586c438c3dfa1 upstream. This driver utilizes a FIFO buffer for RX descriptors. There are four places in the code where it calculates the number of free slots. Several of those locations do the calculation incorrectly. To fix these and to prevent future mistakes, a common inline routine is created. Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx> Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/wireless/rtlwifi/pci.h | 7 +++++++ drivers/net/wireless/rtlwifi/rtl8192ee/trx.c | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) --- a/drivers/net/wireless/rtlwifi/pci.h +++ b/drivers/net/wireless/rtlwifi/pci.h @@ -325,4 +325,11 @@ static inline void pci_write32_async(str writel(val, (u8 __iomem *) rtlpriv->io.pci_mem_start + addr); } +static inline u16 calc_fifo_space(u16 rp, u16 wp) +{ + if (rp <= wp) + return RTL_PCI_MAX_RX_COUNT - 1 + rp - wp; + return rp - wp - 1; +} + #endif --- a/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192ee/trx.c @@ -658,14 +658,7 @@ u16 rtl92ee_rx_desc_buff_remained_cnt(st if (!start_rx) return 0; - if ((last_read_point > (RX_DESC_NUM_92E / 2)) && - (read_point <= (RX_DESC_NUM_92E / 2))) { - remind_cnt = RX_DESC_NUM_92E - write_point; - } else { - remind_cnt = (read_point >= write_point) ? - (read_point - write_point) : - (RX_DESC_NUM_92E - write_point + read_point); - } + remind_cnt = calc_fifo_space(read_point, write_point); if (remind_cnt == 0) return 0; Patches currently in stable-queue which might be from Larry.Finger@xxxxxxxxxxxx are queue-3.19/rtlwifi-rtl8192ee-fix-dma-stalls.patch queue-3.19/rtlwifi-rtl8192ee-fix-adhoc-fail.patch queue-3.19/rtlwifi-rtl8192ee-fix-parsing-of-received-packet.patch queue-3.19/rtlwifi-rtl8192ee-fix-tx-hang-due-to-failure-to-update-tx-write-point.patch queue-3.19/rtlwifi-remove-logging-statement-that-is-no-longer-needed.patch queue-3.19/rtlwifi-rtl8192ee-fix-problems-with-calculating-free-space-in-fifo.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html