Commit fa2648a3 authored by Tony Lindgren's avatar Tony Lindgren Committed by Kalle Valo

wlcore: Add support for runtime PM

We can update wlcore to use PM runtime by adding functions for
wlcore_runtime_suspend() and wlcore_runtime_resume() and replacing
calls to wl1271_ps_elp_wakeup() and wl1271_ps_elp_sleep() with calls
to pm_runtime_get_sync() and pm_runtime_put().

Note that the new wlcore_runtime_suspend() and wlcore_runtime_resume()
functions are based on simplified versions of wl1271_ps_elp_sleep() and
wl1271_ps_elp_wakeup().

We don't want to use the old functions as we can now take advantage of
the runtime PM usage count. And we don't need the old elp_work at all.
And we can also remove WL1271_FLAG_ELP_REQUESTED that is no longer needed.

Pretty much the only place where we are not just converting the existing
functions is wl1271_op_suspend() where we add pm_runtime_put_noidle()
to keep the calls paired.

As the next step is to implement runtime PM autosuspend, let's not add
wrapper functions for the generic runtime PM calls. We would be getting
rid of any wrapper functions anyways.

After autoidle we should be able to start using Linux generic wakeirqs
for the padconf interrupt.
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 02edf813
......@@ -20,6 +20,8 @@
*
*/
#include <linux/pm_runtime.h>
#include "../wlcore/debugfs.h"
#include "../wlcore/wlcore.h"
#include "../wlcore/debug.h"
......@@ -276,15 +278,17 @@ static ssize_t radar_detection_write(struct file *file,
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wl18xx_cmd_radar_detection_debug(wl, channel);
if (ret < 0)
count = ret;
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
......@@ -315,15 +319,17 @@ static ssize_t dynamic_fw_traces_write(struct file *file,
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wl18xx_acx_dynamic_fw_traces(wl);
if (ret < 0)
count = ret;
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
......@@ -374,9 +380,11 @@ static ssize_t radar_debug_mode_write(struct file *file,
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
wl12xx_for_each_wlvif_ap(wl, wlvif) {
wlcore_cmd_generic_cfg(wl, wlvif,
......@@ -384,7 +392,7 @@ static ssize_t radar_debug_mode_write(struct file *file,
wl->radar_debug_mode, 0);
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
......
......@@ -31,7 +31,6 @@
#include "wlcore.h"
#include "debug.h"
#include "wl12xx_80211.h"
#include "ps.h"
#include "hw_ops.h"
int wl1271_acx_wake_up_conditions(struct wl1271 *wl, struct wl12xx_vif *wlvif,
......
......@@ -23,6 +23,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/spi/spi.h>
#include <linux/etherdevice.h>
#include <linux/ieee80211.h>
......@@ -35,7 +36,6 @@
#include "wl12xx_80211.h"
#include "cmd.h"
#include "event.h"
#include "ps.h"
#include "tx.h"
#include "hw_ops.h"
......@@ -192,9 +192,12 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
timeout_time = jiffies + msecs_to_jiffies(WL1271_EVENT_TIMEOUT);
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
return ret;
}
do {
if (time_after(jiffies, timeout_time)) {
......@@ -227,7 +230,7 @@ int wlcore_cmd_wait_for_event_or_timeout(struct wl1271 *wl,
} while (!event);
out:
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
kfree(events_vector);
return ret;
}
......
......@@ -26,6 +26,7 @@
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include "wlcore.h"
#include "debug.h"
......@@ -65,9 +66,11 @@ void wl1271_debugfs_update_stats(struct wl1271 *wl)
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
if (!wl->plt &&
time_after(jiffies, wl->stats.fw_stats_update +
......@@ -76,7 +79,7 @@ void wl1271_debugfs_update_stats(struct wl1271 *wl)
wl->stats.fw_stats_update = jiffies;
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......@@ -118,14 +121,17 @@ static void chip_op_handler(struct wl1271 *wl, unsigned long value,
return;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
return;
}
chip_op = arg;
chip_op(wl);
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
}
......@@ -292,9 +298,11 @@ static ssize_t dynamic_ps_timeout_write(struct file *file,
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
/* In case we're already in PSM, trigger it again to set new timeout
* immediately without waiting for re-association
......@@ -305,7 +313,7 @@ static ssize_t dynamic_ps_timeout_write(struct file *file,
wl1271_ps_set_mode(wl, wlvif, STATION_AUTO_PS_MODE);
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......@@ -359,9 +367,11 @@ static ssize_t forced_ps_write(struct file *file,
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
/* In case we're already in PSM, trigger it again to switch mode
* immediately without waiting for re-association
......@@ -374,7 +384,7 @@ static ssize_t forced_ps_write(struct file *file,
wl1271_ps_set_mode(wl, wlvif, ps_mode);
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......@@ -838,15 +848,17 @@ static ssize_t rx_streaming_interval_write(struct file *file,
wl->conf.rx_streaming.interval = value;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
wl12xx_for_each_wlvif_sta(wl, wlvif) {
wl1271_recalc_rx_streaming(wl, wlvif);
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
......@@ -893,15 +905,17 @@ static ssize_t rx_streaming_always_write(struct file *file,
wl->conf.rx_streaming.always = value;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
wl12xx_for_each_wlvif_sta(wl, wlvif) {
wl1271_recalc_rx_streaming(wl, wlvif);
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
......@@ -940,15 +954,17 @@ static ssize_t beacon_filtering_write(struct file *file,
mutex_lock(&wl->mutex);
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
wl12xx_for_each_wlvif(wl, wlvif) {
ret = wl1271_acx_beacon_filter_opt(wl, wlvif, !!value);
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
......@@ -1019,16 +1035,18 @@ static ssize_t sleep_auth_write(struct file *file,
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wl1271_acx_sleep_auth(wl, value);
if (ret < 0)
goto out_sleep;
out_sleep:
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
return count;
......@@ -1083,7 +1101,7 @@ static ssize_t dev_mem_read(struct file *file,
* Don't fail if elp_wakeup returns an error, so the device's memory
* could be read even if the FW crashed
*/
wl1271_ps_elp_wakeup(wl);
pm_runtime_get_sync(wl->dev);
/* store current partition and switch partition */
memcpy(&old_part, &wl->curr_part, sizeof(old_part));
......@@ -1102,7 +1120,7 @@ static ssize_t dev_mem_read(struct file *file,
goto part_err;
part_err:
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
skip_read:
mutex_unlock(&wl->mutex);
......@@ -1164,7 +1182,7 @@ static ssize_t dev_mem_write(struct file *file, const char __user *user_buf,
* Don't fail if elp_wakeup returns an error, so the device's memory
* could be read even if the FW crashed
*/
wl1271_ps_elp_wakeup(wl);
pm_runtime_get_sync(wl->dev);
/* store current partition and switch partition */
memcpy(&old_part, &wl->curr_part, sizeof(old_part));
......@@ -1183,7 +1201,7 @@ static ssize_t dev_mem_write(struct file *file, const char __user *user_buf,
goto part_err;
part_err:
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
skip_write:
mutex_unlock(&wl->mutex);
......@@ -1247,8 +1265,9 @@ static ssize_t fw_logger_write(struct file *file,
}
mutex_lock(&wl->mutex);
ret = wl1271_ps_elp_wakeup(wl);
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
count = ret;
goto out;
}
......@@ -1257,7 +1276,7 @@ static ssize_t fw_logger_write(struct file *file,
ret = wl12xx_cmd_config_fwlog(wl);
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......
This diff is collapsed.
......@@ -26,152 +26,6 @@
#include "tx.h"
#include "debug.h"
#define WL1271_WAKEUP_TIMEOUT 500
#define ELP_ENTRY_DELAY 30
#define ELP_ENTRY_DELAY_FORCE_PS 5
void wl1271_elp_work(struct work_struct *work)
{
struct delayed_work *dwork;
struct wl1271 *wl;
struct wl12xx_vif *wlvif;
int ret;
dwork = to_delayed_work(work);
wl = container_of(dwork, struct wl1271, elp_work);
wl1271_debug(DEBUG_PSM, "elp work");
mutex_lock(&wl->mutex);
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
/* our work might have been already cancelled */
if (unlikely(!test_bit(WL1271_FLAG_ELP_REQUESTED, &wl->flags)))
goto out;
if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags))
goto out;
wl12xx_for_each_wlvif(wl, wlvif) {
if (!test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags) &&
test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
goto out;
}
wl1271_debug(DEBUG_PSM, "chip to elp");
ret = wlcore_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG, ELPCTRL_SLEEP);
if (ret < 0) {
wl12xx_queue_recovery_work(wl);
goto out;
}
set_bit(WL1271_FLAG_IN_ELP, &wl->flags);
out:
mutex_unlock(&wl->mutex);
}
/* Routines to toggle sleep mode while in ELP */
void wl1271_ps_elp_sleep(struct wl1271 *wl)
{
struct wl12xx_vif *wlvif;
u32 timeout;
/* We do not enter elp sleep in PLT mode */
if (wl->plt)
return;
if (wl->sleep_auth != WL1271_PSM_ELP)
return;
/* we shouldn't get consecutive sleep requests */
if (WARN_ON(test_and_set_bit(WL1271_FLAG_ELP_REQUESTED, &wl->flags)))
return;
wl12xx_for_each_wlvif(wl, wlvif) {
if (!test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags) &&
test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
return;
}
timeout = wl->conf.conn.forced_ps ?
ELP_ENTRY_DELAY_FORCE_PS : ELP_ENTRY_DELAY;
ieee80211_queue_delayed_work(wl->hw, &wl->elp_work,
msecs_to_jiffies(timeout));
}
EXPORT_SYMBOL_GPL(wl1271_ps_elp_sleep);
int wl1271_ps_elp_wakeup(struct wl1271 *wl)
{
DECLARE_COMPLETION_ONSTACK(compl);
unsigned long flags;
int ret;
unsigned long start_time = jiffies;
bool pending = false;
/*
* we might try to wake up even if we didn't go to sleep
* before (e.g. on boot)
*/
if (!test_and_clear_bit(WL1271_FLAG_ELP_REQUESTED, &wl->flags))
return 0;
/* don't cancel_sync as it might contend for a mutex and deadlock */
cancel_delayed_work(&wl->elp_work);
if (!test_bit(WL1271_FLAG_IN_ELP, &wl->flags))
return 0;
wl1271_debug(DEBUG_PSM, "waking up chip from elp");
/*
* The spinlock is required here to synchronize both the work and
* the completion variable in one entity.
*/
spin_lock_irqsave(&wl->wl_lock, flags);
if (test_bit(WL1271_FLAG_IRQ_RUNNING, &wl->flags))
pending = true;
else
wl->elp_compl = &compl;
spin_unlock_irqrestore(&wl->wl_lock, flags);
ret = wlcore_raw_write32(wl, HW_ACCESS_ELP_CTRL_REG, ELPCTRL_WAKE_UP);
if (ret < 0) {
wl12xx_queue_recovery_work(wl);
goto err;
}
if (!pending) {
ret = wait_for_completion_timeout(
&compl, msecs_to_jiffies(WL1271_WAKEUP_TIMEOUT));
if (ret == 0) {
wl1271_error("ELP wakeup timeout!");
wl12xx_queue_recovery_work(wl);
ret = -ETIMEDOUT;
goto err;
}
}
clear_bit(WL1271_FLAG_IN_ELP, &wl->flags);
wl1271_debug(DEBUG_PSM, "wakeup time: %u ms",
jiffies_to_msecs(jiffies - start_time));
goto out;
err:
spin_lock_irqsave(&wl->wl_lock, flags);
wl->elp_compl = NULL;
spin_unlock_irqrestore(&wl->wl_lock, flags);
return ret;
out:
return 0;
}
EXPORT_SYMBOL_GPL(wl1271_ps_elp_wakeup);
int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif,
enum wl1271_cmd_ps_mode mode)
{
......
......@@ -29,9 +29,6 @@
int wl1271_ps_set_mode(struct wl1271 *wl, struct wl12xx_vif *wlvif,
enum wl1271_cmd_ps_mode mode);
void wl1271_ps_elp_sleep(struct wl1271 *wl);
int wl1271_ps_elp_wakeup(struct wl1271 *wl);
void wl1271_elp_work(struct work_struct *work);
void wl12xx_ps_link_start(struct wl1271 *wl, struct wl12xx_vif *wlvif,
u8 hlid, bool clean_queues);
void wl12xx_ps_link_end(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid);
......
......@@ -22,13 +22,13 @@
*/
#include <linux/ieee80211.h>
#include <linux/pm_runtime.h>
#include "wlcore.h"
#include "debug.h"
#include "cmd.h"
#include "scan.h"
#include "acx.h"
#include "ps.h"
#include "tx.h"
void wl1271_scan_complete_work(struct work_struct *work)
......@@ -67,16 +67,18 @@ void wl1271_scan_complete_work(struct work_struct *work)
wl->scan.req = NULL;
wl->scan_wlvif = NULL;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) {
/* restore hardware connection monitoring template */
wl1271_cmd_build_ap_probe_req(wl, wlvif, wlvif->probereq);
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
if (wl->scan.failed) {
wl1271_info("Scan completed due to error.");
......
......@@ -19,9 +19,11 @@
*
*/
#include <linux/pm_runtime.h>
#include "acx.h"
#include "wlcore.h"
#include "debug.h"
#include "ps.h"
#include "sysfs.h"
static ssize_t wl1271_sysfs_show_bt_coex_state(struct device *dev,
......@@ -68,12 +70,14 @@ static ssize_t wl1271_sysfs_store_bt_coex_state(struct device *dev,
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
wl1271_acx_sg_enable(wl, wl->sg_enabled);
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......
......@@ -22,13 +22,13 @@
*/
#include "testmode.h"
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <net/genetlink.h>
#include "wlcore.h"
#include "debug.h"
#include "acx.h"
#include "ps.h"
#include "io.h"
#define WL1271_TM_MAX_DATA_LENGTH 1024
......@@ -97,9 +97,11 @@ static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[])
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wl1271_cmd_test(wl, buf, buf_len, answer);
if (ret < 0) {
......@@ -141,7 +143,7 @@ static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[])
}
out_sleep:
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......@@ -169,9 +171,11 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[])
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
if (!cmd) {
......@@ -205,7 +209,7 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[])
out_free:
kfree(cmd);
out_sleep:
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......
......@@ -24,6 +24,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/etherdevice.h>
#include <linux/pm_runtime.h>
#include <linux/spinlock.h>
#include "wlcore.h"
......@@ -868,9 +869,11 @@ void wl1271_tx_work(struct work_struct *work)
int ret;
mutex_lock(&wl->mutex);
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wlcore_tx_work_locked(wl);
if (ret < 0) {
......@@ -878,7 +881,7 @@ void wl1271_tx_work(struct work_struct *work)
goto out;
}
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
}
......
......@@ -8,12 +8,13 @@
* version 2 as published by the Free Software Foundation.
*/
#include <linux/pm_runtime.h>
#include <net/mac80211.h>
#include <net/netlink.h>
#include "wlcore.h"
#include "debug.h"
#include "ps.h"
#include "hw_ops.h"
#include "vendor_cmd.h"
......@@ -55,14 +56,16 @@ wlcore_vendor_cmd_smart_config_start(struct wiphy *wiphy,
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wlcore_smart_config_start(wl,
nla_get_u32(tb[WLCORE_VENDOR_ATTR_GROUP_ID]));
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......@@ -87,13 +90,15 @@ wlcore_vendor_cmd_smart_config_stop(struct wiphy *wiphy,
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wlcore_smart_config_stop(wl);
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......@@ -131,16 +136,18 @@ wlcore_vendor_cmd_smart_config_set_group_key(struct wiphy *wiphy,
goto out;
}
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
ret = pm_runtime_get_sync(wl->dev);
if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
goto out;
}
ret = wlcore_smart_config_set_group_key(wl,
nla_get_u32(tb[WLCORE_VENDOR_ATTR_GROUP_ID]),
nla_len(tb[WLCORE_VENDOR_ATTR_GROUP_KEY]),
nla_data(tb[WLCORE_VENDOR_ATTR_GROUP_KEY]));
wl1271_ps_elp_sleep(wl);
pm_runtime_put(wl->dev);
out:
mutex_unlock(&wl->mutex);
......
......@@ -348,7 +348,6 @@ struct wl1271 {
enum nl80211_band band;
struct completion *elp_compl;
struct delayed_work elp_work;
/* in dBm */
int power_level;
......
......@@ -233,7 +233,6 @@ enum wl12xx_flags {
WL1271_FLAG_TX_QUEUE_STOPPED,
WL1271_FLAG_TX_PENDING,
WL1271_FLAG_IN_ELP,
WL1271_FLAG_ELP_REQUESTED,
WL1271_FLAG_IRQ_RUNNING,
WL1271_FLAG_FW_TX_BUSY,
WL1271_FLAG_DUMMY_PACKET_PENDING,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment