]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.14/0038-rtlwifi-rtl8192c-Prevent-sleeping-from-invalid-conte.patch
linux-ti335x-psp 3.2: update to 3.2.14
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.14 / 0038-rtlwifi-rtl8192c-Prevent-sleeping-from-invalid-conte.patch
1 From 9d3a0177f72e20f06c844ede994dc3541bdae01b Mon Sep 17 00:00:00 2001
2 From: Larry Finger <Larry.Finger@lwfinger.net>
3 Date: Fri, 2 Mar 2012 15:23:36 -0600
4 Subject: [PATCH 038/147] rtlwifi: rtl8192c: Prevent sleeping from invalid
5  context in rtl8192cu
7 commit ebecdcc12fed5d3c81853dea61a0a78a5aefab52 upstream.
9 When driver rtl8192cu is used with the debug level set to 3 or greater,
10 the result is "sleeping function called from invalid context" due to
11 an rcu_read_lock() call in the DM refresh routine in driver rtl8192c.
12 This lock is not necessary as the USB driver does not use the struct
13 being protected, thus the lock is set only when a PCI interface is
14 active.
16 This bug is reported in https://bugzilla.kernel.org/show_bug.cgi?id=42775.
18 Reported-by: Ronald Wahl <ronald.wahl@raritan.com>
19 Tested-by: Ronald Wahl <ronald.wahl@raritan.com>
20 Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
21 Cc: Ronald Wahl <ronald.wahl@raritan.com>
22 Signed-off-by: John W. Linville <linville@tuxdriver.com>
23 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 ---
25  drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c |   11 ++++++++---
26  1 file changed, 8 insertions(+), 3 deletions(-)
28 diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
29 index 72a98ca..4de6b78 100644
30 --- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
31 +++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
32 @@ -1219,13 +1219,18 @@ static void rtl92c_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw)
33                                  ("PreState = %d, CurState = %d\n",
34                                   p_ra->pre_ratr_state, p_ra->ratr_state));
35  
36 -                       rcu_read_lock();
37 -                       sta = ieee80211_find_sta(mac->vif, mac->bssid);
38 +                       /* Only the PCI card uses sta in the update rate table
39 +                        * callback routine */
40 +                       if (rtlhal->interface == INTF_PCI) {
41 +                               rcu_read_lock();
42 +                               sta = ieee80211_find_sta(mac->vif, mac->bssid);
43 +                       }
44                         rtlpriv->cfg->ops->update_rate_tbl(hw, sta,
45                                         p_ra->ratr_state);
46  
47                         p_ra->pre_ratr_state = p_ra->ratr_state;
48 -                       rcu_read_unlock();
49 +                       if (rtlhal->interface == INTF_PCI)
50 +                               rcu_read_unlock();
51                 }
52         }
53  }
54 -- 
55 1.7.9.4