diff options
author | Larry Finger <Larry.Finger@lwfinger.net> | 2012-03-19 15:44:31 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-09 16:12:31 -0400 |
commit | 30899cc6ab4d4b63d43f6d652d1ecf9107eadb8d (patch) | |
tree | b6f6e4dca078cc6983e3c110f095e2e1f36a26d9 /drivers/net/wireless/rtlwifi/wifi.h | |
parent | 292c41acddfdbe0fb42d4c4ad9b896168fd16e91 (diff) | |
download | talos-op-linux-30899cc6ab4d4b63d43f6d652d1ecf9107eadb8d.tar.gz talos-op-linux-30899cc6ab4d4b63d43f6d652d1ecf9107eadb8d.zip |
rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine
The current version of rtlwifi for USB operations uses kmalloc to
acquire a 32-bit buffer for each read of the device. When
_usb_read_sync() is called with the rcu_lock held, the result is
a "sleeping function called from invalid context" BUG. This is
reported for two cases in https://bugzilla.kernel.org/show_bug.cgi?id=42775.
The first case has the lock originating from within rtlwifi and could
be fixed by rearranging the locking; however, the second originates from
within mac80211. The kmalloc() call is removed from _usb_read_sync()
by creating a ring buffer pointer in the private area and
allocating the buffer data in the probe routine.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [This version good for 3.3+ - different patch for 3.2 - 2.6.39]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rtlwifi/wifi.h')
-rw-r--r-- | drivers/net/wireless/rtlwifi/wifi.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index 0f1d21175d6a..521398803099 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h @@ -67,7 +67,7 @@ #define QOS_QUEUE_NUM 4 #define RTL_MAC80211_NUM_QUEUE 5 #define REALTEK_USB_VENQT_MAX_BUF_SIZE 254 - +#define RTL_USB_MAX_RX_COUNT 100 #define QBSS_LOAD_SIZE 5 #define MAX_WMMELE_LENGTH 64 @@ -1629,6 +1629,10 @@ struct rtl_priv { interface or hardware */ unsigned long status; + /* data buffer pointer for USB reads */ + __le32 *usb_data; + int usb_data_index; + /*This must be the last item so that it points to the data allocated beyond this structure like: |