* RTL8192SE blank EFUSE readout after suspend resume cycle
@ 2011-10-04 12:27 Stefan Zwanenburg
2011-10-04 13:57 ` Stanislaw Gruszka
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Zwanenburg @ 2011-10-04 12:27 UTC (permalink / raw)
To: linux-wireless
I recently discussed this with Larry Finger and Chaomin Li, but every
once in a while, after having resumed from suspending to RAM, my NIC
(10ec:8172) doesn't work anymore, even after reloading the module. Even
worse, after reloading the module, my NIC's name gets changed (because
of udev rules) as a result of the MAC address changing, which means I
have to temporarily reconfigure whatever I'm using to make a connection
(wicd in my case).
Now, as a byproduct of the other discussion I had (RTL8192SE and 802.11n
problems), I've patched the driver to dump the EFUSE when appropriate
hardware is detected, and this time, I got the following:
rtl8192se 0000:06:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
rtl8192se 0000:06:00.0: setting latency timer to 64
rtl8192se: In process "modprobe" (pid 17913):MAP
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
rtl8192se: Driver for Realtek RTL8192SE/RTL8191SE
Loading firmware rtlwifi/rtl8192sefw.bin
ieee80211 phy1: Selected rate control algorithm 'rtl_rc'
udevd[17907]: renamed network interface wlan0 to wlan26
As you can see, the EFUSE is completely messed up. To fix this problem,
I have to reboot my laptop. I'm not quite sure what could be causing
this, and I was hoping someone here might.
Greetings,
Stefan Zwanenburg
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RTL8192SE blank EFUSE readout after suspend resume cycle
2011-10-04 12:27 RTL8192SE blank EFUSE readout after suspend resume cycle Stefan Zwanenburg
@ 2011-10-04 13:57 ` Stanislaw Gruszka
2011-10-05 3:36 ` Larry Finger
0 siblings, 1 reply; 3+ messages in thread
From: Stanislaw Gruszka @ 2011-10-04 13:57 UTC (permalink / raw)
To: Stefan Zwanenburg; +Cc: linux-wireless, Larry Finger, Chaoming Li
On Tue, Oct 04, 2011 at 02:27:55PM +0200, Stefan Zwanenburg wrote:
> I recently discussed this with Larry Finger and Chaomin Li, but every
> once in a while, after having resumed from suspending to RAM, my NIC
> (10ec:8172) doesn't work anymore, even after reloading the module. Even
> worse, after reloading the module, my NIC's name gets changed (because
> of udev rules) as a result of the MAC address changing, which means I
> have to temporarily reconfigure whatever I'm using to make a connection
> (wicd in my case).
You might try configure pm-utils to unload module before suspend, by
something like this:
echo 'SUSPEND_MODULES="rtl8192se rtlwifi"' >> /etc/pm/config.d/modules.conf
Other than that, would be good to try if converting to new PM framework
helps. It can be done quite simply, similar way like in this ath9k commit:
commit f0e94b479c987abef17eb18e5c8e0ed178d00cd4
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date: Sat Oct 16 00:36:17 2010 +0200
ath9k: Convert to new PCI PM framework
Stanislaw
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: RTL8192SE blank EFUSE readout after suspend resume cycle
2011-10-04 13:57 ` Stanislaw Gruszka
@ 2011-10-05 3:36 ` Larry Finger
0 siblings, 0 replies; 3+ messages in thread
From: Larry Finger @ 2011-10-05 3:36 UTC (permalink / raw)
To: Stefan Zwanenburg; +Cc: Stanislaw Gruszka, linux-wireless, Chaoming Li
[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]
On 10/04/2011 08:57 AM, Stanislaw Gruszka wrote:
> On Tue, Oct 04, 2011 at 02:27:55PM +0200, Stefan Zwanenburg wrote:
>> I recently discussed this with Larry Finger and Chaomin Li, but every
>> once in a while, after having resumed from suspending to RAM, my NIC
>> (10ec:8172) doesn't work anymore, even after reloading the module. Even
>> worse, after reloading the module, my NIC's name gets changed (because
>> of udev rules) as a result of the MAC address changing, which means I
>> have to temporarily reconfigure whatever I'm using to make a connection
>> (wicd in my case).
>
> You might try configure pm-utils to unload module before suspend, by
> something like this:
>
> echo 'SUSPEND_MODULES="rtl8192se rtlwifi"'>> /etc/pm/config.d/modules.conf
>
> Other than that, would be good to try if converting to new PM framework
> helps. It can be done quite simply, similar way like in this ath9k commit:
>
> commit f0e94b479c987abef17eb18e5c8e0ed178d00cd4
> Author: Rafael J. Wysocki<rjw@sisk.pl>
> Date: Sat Oct 16 00:36:17 2010 +0200
>
> ath9k: Convert to new PCI PM framework
Stefan,
Following Stanislaw's suggestion, I have reworked the PM routines to use the new
framework. Attached is a patch. My system does not sleep and I cannot test it,
but it does hibernate. Let me know what happens.
Larry
[-- Attachment #2: rtl8192se_new_pm_framework --]
[-- Type: text/plain, Size: 5301 bytes --]
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192se/sw.c
@@ -397,17 +397,21 @@ MODULE_PARM_DESC(ips, "Set to 0 to not u
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+static const struct dev_pm_ops rtlwifi_pm_ops = {
+ .suspend = rtl_pci_suspend,
+ .resume = rtl_pci_resume,
+ .freeze = rtl_pci_suspend,
+ .thaw = rtl_pci_resume,
+ .poweroff = rtl_pci_suspend,
+ .restore = rtl_pci_resume,
+};
+
static struct pci_driver rtl92se_driver = {
.name = KBUILD_MODNAME,
.id_table = rtl92se_pci_ids,
.probe = rtl_pci_probe,
.remove = rtl_pci_disconnect,
-
-#ifdef CONFIG_PM
- .suspend = rtl_pci_suspend,
- .resume = rtl_pci_resume,
-#endif
-
+ .driver.pm = &rtlwifi_pm_ops,
};
static int __init rtl92se_module_init(void)
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/pci.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/pci.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/pci.c
@@ -1993,36 +1993,25 @@ call rtl_mac_stop() from the mac80211
suspend function first, So there is
no need to call hw_disable here.
****************************************/
-int rtl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
+int rtl_pci_suspend(struct device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev);
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->cfg->ops->hw_suspend(hw);
rtl_deinit_rfkill(hw);
- pci_save_state(pdev);
- pci_disable_device(pdev);
- pci_set_power_state(pdev, PCI_D3hot);
return 0;
}
EXPORT_SYMBOL(rtl_pci_suspend);
-int rtl_pci_resume(struct pci_dev *pdev)
+int rtl_pci_resume(struct device *dev)
{
- int ret;
+ struct pci_dev *pdev = to_pci_dev(dev);
struct ieee80211_hw *hw = pci_get_drvdata(pdev);
struct rtl_priv *rtlpriv = rtl_priv(hw);
- pci_set_power_state(pdev, PCI_D0);
- ret = pci_enable_device(pdev);
- if (ret) {
- RT_ASSERT(false, ("ERR: <======\n"));
- return ret;
- }
-
- pci_restore_state(pdev);
-
rtlpriv->cfg->ops->hw_resume(hw);
rtl_init_rfkill(hw);
return 0;
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/pci.h
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/pci.h
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/pci.h
@@ -237,8 +237,8 @@ extern struct rtl_intf_ops rtl_pci_ops;
int __devinit rtl_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id);
void rtl_pci_disconnect(struct pci_dev *pdev);
-int rtl_pci_suspend(struct pci_dev *pdev, pm_message_t state);
-int rtl_pci_resume(struct pci_dev *pdev);
+int rtl_pci_suspend(struct device *dev);
+int rtl_pci_resume(struct device *dev);
static inline u8 pci_read8_sync(struct rtl_priv *rtlpriv, u32 addr)
{
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192ce/sw.c
@@ -365,17 +365,21 @@ MODULE_PARM_DESC(ips, "Set to 0 to not u
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+static const struct dev_pm_ops rtlwifi_pm_ops = {
+ .suspend = rtl_pci_suspend,
+ .resume = rtl_pci_resume,
+ .freeze = rtl_pci_suspend,
+ .thaw = rtl_pci_resume,
+ .poweroff = rtl_pci_suspend,
+ .restore = rtl_pci_resume,
+};
+
static struct pci_driver rtl92ce_driver = {
.name = KBUILD_MODNAME,
.id_table = rtl92ce_pci_ids,
.probe = rtl_pci_probe,
.remove = rtl_pci_disconnect,
-
-#ifdef CONFIG_PM
- .suspend = rtl_pci_suspend,
- .resume = rtl_pci_resume,
-#endif
-
+ .driver.pm = &rtlwifi_pm_ops,
};
static int __init rtl92ce_module_init(void)
Index: wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
===================================================================
--- wireless-testing-new.orig/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
+++ wireless-testing-new/drivers/net/wireless/rtlwifi/rtl8192de/sw.c
@@ -385,17 +385,21 @@ MODULE_PARM_DESC(ips, "Set to 0 to not u
MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
+static const struct dev_pm_ops rtlwifi_pm_ops = {
+ .suspend = rtl_pci_suspend,
+ .resume = rtl_pci_resume,
+ .freeze = rtl_pci_suspend,
+ .thaw = rtl_pci_resume,
+ .poweroff = rtl_pci_suspend,
+ .restore = rtl_pci_resume,
+};
+
static struct pci_driver rtl92de_driver = {
.name = KBUILD_MODNAME,
.id_table = rtl92de_pci_ids,
.probe = rtl_pci_probe,
.remove = rtl_pci_disconnect,
-
-#ifdef CONFIG_PM
- .suspend = rtl_pci_suspend,
- .resume = rtl_pci_resume,
-#endif
-
+ .driver.pm = &rtlwifi_pm_ops,
};
/* add global spin lock to solve the problem that
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-05 3:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-04 12:27 RTL8192SE blank EFUSE readout after suspend resume cycle Stefan Zwanenburg
2011-10-04 13:57 ` Stanislaw Gruszka
2011-10-05 3:36 ` Larry Finger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).