Fix rtl8192cu-Fix-WARNING-on-suspend-resume.patch so it actually applies

This commit is contained in:
Josh Boyer 2012-01-13 13:45:20 -05:00
parent 76da9b0851
commit b23da04d3e
1 changed files with 34 additions and 20 deletions

View File

@ -1,3 +1,8 @@
From e234ca17f2d5ce23606fceef2df6c02f8555547e Mon Sep 17 00:00:00 2001
From: Josh Boyer <jwboyer@redhat.com>
Date: Wed, 11 Jan 2012 13:35:33 -0500
Subject: [PATCH] rtl8192cu: Fix WARNING on suspend/resume
A recent LKML thread (http://lkml.indiana.edu/hypermail/linux/kernel/1112.3/00965.html)
discusses warnings that occur during a suspend/resume cycle. The driver
attempts to read the firmware file before userspace is ready, leading to the
@ -13,8 +18,6 @@ through a suspend/resume cycle, and does not have to be reread.
This patch should fix the bug reported in
https://bugzilla.redhat.com/show_bug.cgi?id=771002.
Note: This patch also touches rtl8192ce as the "firmware" loaded message
is now printed in the wrong place.
Note: This patch also touches rtl8192ce as the "firmware" loaded message
is now printed in the wrong place.
@ -24,25 +27,30 @@ Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Stable <stable@xxxxxxxxxxxxxxx>
Backported to Fedora 3.1.x.
---
drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c | 1 -
drivers/net/wireless/rtlwifi/rtl8192ce/sw.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 58 +++++++++++++++++----
3 files changed, 49 insertions(+), 11 deletions(-)
--- linux-2.6/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c 2012-01-13 13:07:58.830625006 -0500
+++ linux-2.6/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c 2012-01-13 13:08:06.825439927 -0500
@@ -227,7 +227,6 @@ int rtl92c_download_fw(struct ieee80211_
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index 49a064b..e3c4ac7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -226,7 +226,6 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
u32 fwsize;
enum version_8192c version = rtlhal->version;
- pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name);
if (!rtlhal->pfirmware)
return 1;
--- linux-2.6/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ linux-2.6/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -186,6 +186,7 @@ int rtl92c_init_sw_vars(struct ieee80211
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
index 373dc78..9c3a8f1 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -171,6 +171,7 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size);
rtlpriv->rtlhal.fwsize = firmware->size;
release_firmware(firmware);
@ -50,18 +58,21 @@ Cc: Stable <stable@xxxxxxxxxxxxxxx>
return 0;
}
--- linux-2.6/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ linux-2.6/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -43,6 +43,8 @@
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
index ef63c0d..f4230dd 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
@@ -42,6 +42,9 @@
#include "led.h"
#include "hw.h"
#include <linux/vmalloc.h>
#include <linux/module.h>
+#include <linux/atomic.h>
+#include <linux/types.h>
+
MODULE_AUTHOR("Georgia <georgia@realtek.com>");
MODULE_AUTHOR("Ziv Huang <ziv_huang@realtek.com>");
@@ -51,6 +53,10 @@ MODULE_LICENSE("GPL");
@@ -50,6 +53,10 @@ MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n USB wireless");
MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin");
@ -72,10 +83,10 @@ Cc: Stable <stable@xxxxxxxxxxxxxxx>
static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -62,12 +68,21 @@ static int rtl92cu_init_sw_vars(struct i
rtlpriv->dm.disable_framebursting = false;
@@ -60,12 +67,21 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
rtlpriv->dm.dm_flag = 0;
rtlpriv->dm.disable_framebursting = 0;
rtlpriv->dm.thermalvalue = 0;
rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug;
- rtlpriv->rtlhal.pfirmware = vmalloc(0x4000);
- if (!rtlpriv->rtlhal.pfirmware) {
+
@ -96,7 +107,7 @@ Cc: Stable <stable@xxxxxxxxxxxxxxx>
/* request fw */
err = request_firmware(&firmware, rtlpriv->cfg->fw_name,
rtlpriv->io.dev);
@@ -82,9 +97,14 @@ static int rtl92cu_init_sw_vars(struct i
@@ -80,9 +96,14 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw)
release_firmware(firmware);
return 1;
}
@ -112,7 +123,7 @@ Cc: Stable <stable@xxxxxxxxxxxxxxx>
return 0;
}
@@ -93,12 +113,30 @@ static void rtl92cu_deinit_sw_vars(struc
@@ -91,12 +112,30 @@ static void rtl92cu_deinit_sw_vars(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
@ -145,7 +156,7 @@ Cc: Stable <stable@xxxxxxxxxxxxxxx>
static struct rtl_hal_ops rtl8192cu_hal_ops = {
.init_sw_vars = rtl92cu_init_sw_vars,
.deinit_sw_vars = rtl92cu_deinit_sw_vars,
@@ -374,11 +412,10 @@ static struct usb_driver rtl8192cu_drive
@@ -338,11 +377,10 @@ static struct usb_driver rtl8192cu_driver = {
.disconnect = rtl_usb_disconnect,
.id_table = rtl8192c_usb_ids,
@ -161,3 +172,6 @@ Cc: Stable <stable@xxxxxxxxxxxxxxx>
#ifdef CONFIG_AUTOSUSPEND
.supports_autosuspend = 1,
#endif
--
1.7.7.5