Skip to content

Commit f892914

Browse files
lwfingerlinvjw
authored andcommitted
rtlwifi: rtl8192ce: Fix kernel crashes due to missing callback entry
In the major update of the rtlwifi-family of drivers, one of the callback entries was missed, which leads to memory corruption. Unfortunately, this corruption never caused a kernel oops, but showed up in other parts of the system. This patch is one of three needed to fix the kernel regression reported at https://bugzilla.kernel.org/show_bug.cgi?id=88951. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Reported-by: Catalin Iacob <iacobcatalin@gmail.com> Tested-by: Catalin Iacob <iacobcatalin@gmail.com> Cc: Catalin Iacob <iacobcatalin@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 99a82f7 commit f892914

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

drivers/net/wireless/rtlwifi/rtl8192ce/sw.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ static struct rtl_hal_ops rtl8192ce_hal_ops = {
228228
.led_control = rtl92ce_led_control,
229229
.set_desc = rtl92ce_set_desc,
230230
.get_desc = rtl92ce_get_desc,
231+
.is_tx_desc_closed = rtl92ce_is_tx_desc_closed,
231232
.tx_polling = rtl92ce_tx_polling,
232233
.enable_hw_sec = rtl92ce_enable_hw_security_config,
233234
.set_key = rtl92ce_set_key,
@@ -271,6 +272,8 @@ static struct rtl_hal_cfg rtl92ce_hal_cfg = {
271272
.maps[MAC_RCR_ACRC32] = ACRC32,
272273
.maps[MAC_RCR_ACF] = ACF,
273274
.maps[MAC_RCR_AAP] = AAP,
275+
.maps[MAC_HIMR] = REG_HIMR,
276+
.maps[MAC_HIMRE] = REG_HIMRE,
274277

275278
.maps[EFUSE_TEST] = REG_EFUSE_TEST,
276279
.maps[EFUSE_CTRL] = REG_EFUSE_CTRL,

drivers/net/wireless/rtlwifi/rtl8192ce/trx.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,23 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
739739
return ret;
740740
}
741741

742+
bool rtl92ce_is_tx_desc_closed(struct ieee80211_hw *hw,
743+
u8 hw_queue, u16 index)
744+
{
745+
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
746+
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[hw_queue];
747+
u8 *entry = (u8 *)(&ring->desc[ring->idx]);
748+
u8 own = (u8)rtl92ce_get_desc(entry, true, HW_DESC_OWN);
749+
750+
/*beacon packet will only use the first
751+
*descriptor defautly,and the own may not
752+
*be cleared by the hardware
753+
*/
754+
if (own)
755+
return false;
756+
return true;
757+
}
758+
742759
void rtl92ce_tx_polling(struct ieee80211_hw *hw, u8 hw_queue)
743760
{
744761
struct rtl_priv *rtlpriv = rtl_priv(hw);

drivers/net/wireless/rtlwifi/rtl8192ce/trx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,8 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
723723
void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
724724
u8 desc_name, u8 *val);
725725
u32 rtl92ce_get_desc(u8 *pdesc, bool istx, u8 desc_name);
726+
bool rtl92ce_is_tx_desc_closed(struct ieee80211_hw *hw,
727+
u8 hw_queue, u16 index);
726728
void rtl92ce_tx_polling(struct ieee80211_hw *hw, u8 hw_queue);
727729
void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
728730
bool b_firstseg, bool b_lastseg,

0 commit comments

Comments
 (0)