iwlegacy: warn when enabling power save
authorStanislaw Gruszka <sgruszka@redhat.com>
Mon, 15 May 2017 09:28:26 +0000 (11:28 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 May 2017 13:43:11 +0000 (16:43 +0300)
iwlegacy firmware can crash when power save is configured. PS was
allowed in "dbdac2b iwlegacy: properly enable power saving" with belive
that user who enable PS is aware of that and can relate firmware crahes
with PS. However some distributions seems to enable PS without user
intervention, so warn about that.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/iwlegacy/common.c
drivers/net/wireless/intel/iwlegacy/common.h

index 140b6ea8f7cc48c9e3ea3908a3c274359ac9eaba..8d5acda92a9b819eb00e159790f796bbcbe1cf27 100644 (file)
@@ -5147,6 +5147,8 @@ set_ch_out:
 
        if (changed & (IEEE80211_CONF_CHANGE_PS | IEEE80211_CONF_CHANGE_IDLE)) {
                il->power_data.ps_disabled = !(conf->flags & IEEE80211_CONF_PS);
+               if (!il->power_data.ps_disabled)
+                       IL_WARN_ONCE("Enabling power save might cause firmware crashes\n");
                ret = il_power_update_mode(il, false);
                if (ret)
                        D_MAC80211("Error setting sleep level\n");
index 3bba521d2cd90649befb9b270c70f90699a8fb04..18c60c92e3a35c79338d55bf1dfeb8d9fcb7a2ff 100644 (file)
@@ -45,6 +45,7 @@ struct il_tx_queue;
 
 #define IL_ERR(f, a...) dev_err(&il->pci_dev->dev, f, ## a)
 #define IL_WARN(f, a...) dev_warn(&il->pci_dev->dev, f, ## a)
+#define IL_WARN_ONCE(f, a...) dev_warn_once(&il->pci_dev->dev, f, ## a)
 #define IL_INFO(f, a...) dev_info(&il->pci_dev->dev, f, ## a)
 
 #define RX_QUEUE_SIZE                         256