Commit ab589ac2 authored by Minghao Chi's avatar Minghao Chi Committed by Kalle Valo

wlcore: main: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()

Using pm_runtime_resume_and_get is more appropriate
for simplifing code
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarMinghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220412091742.2533527-1-chi.minghao@zte.com.cn
parent dc4246ef
...@@ -141,11 +141,9 @@ static void wl1271_rx_streaming_enable_work(struct work_struct *work) ...@@ -141,11 +141,9 @@ static void wl1271_rx_streaming_enable_work(struct work_struct *work)
if (!wl->conf.rx_streaming.interval) if (!wl->conf.rx_streaming.interval)
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl1271_set_rx_streaming(wl, wlvif, true); ret = wl1271_set_rx_streaming(wl, wlvif, true);
if (ret < 0) if (ret < 0)
...@@ -174,11 +172,9 @@ static void wl1271_rx_streaming_disable_work(struct work_struct *work) ...@@ -174,11 +172,9 @@ static void wl1271_rx_streaming_disable_work(struct work_struct *work)
if (!test_bit(WLVIF_FLAG_RX_STREAMING_STARTED, &wlvif->flags)) if (!test_bit(WLVIF_FLAG_RX_STREAMING_STARTED, &wlvif->flags))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl1271_set_rx_streaming(wl, wlvif, false); ret = wl1271_set_rx_streaming(wl, wlvif, false);
if (ret) if (ret)
...@@ -223,11 +219,9 @@ static void wlcore_rc_update_work(struct work_struct *work) ...@@ -223,11 +219,9 @@ static void wlcore_rc_update_work(struct work_struct *work)
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
if (ieee80211_vif_is_mesh(vif)) { if (ieee80211_vif_is_mesh(vif)) {
ret = wl1271_acx_set_ht_capabilities(wl, &wlvif->rc_ht_cap, ret = wl1271_acx_set_ht_capabilities(wl, &wlvif->rc_ht_cap,
...@@ -537,11 +531,9 @@ static int wlcore_irq_locked(struct wl1271 *wl) ...@@ -537,11 +531,9 @@ static int wlcore_irq_locked(struct wl1271 *wl)
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
while (!done && loopcount--) { while (!done && loopcount--) {
smp_mb__after_atomic(); smp_mb__after_atomic();
...@@ -838,11 +830,9 @@ static void wl12xx_read_fwlog_panic(struct wl1271 *wl) ...@@ -838,11 +830,9 @@ static void wl12xx_read_fwlog_panic(struct wl1271 *wl)
* Do not send a stop fwlog command if the fw is hanged or if * Do not send a stop fwlog command if the fw is hanged or if
* dbgpins are used (due to some fw bug). * dbgpins are used (due to some fw bug).
*/ */
error = pm_runtime_get_sync(wl->dev); error = pm_runtime_resume_and_get(wl->dev);
if (error < 0) { if (error < 0)
pm_runtime_put_noidle(wl->dev);
return; return;
}
if (!wl->watchdog_recovery && if (!wl->watchdog_recovery &&
wl->conf.fwlog.output != WL12XX_FWLOG_OUTPUT_DBG_PINS) wl->conf.fwlog.output != WL12XX_FWLOG_OUTPUT_DBG_PINS)
wl12xx_cmd_stop_fwlog(wl); wl12xx_cmd_stop_fwlog(wl);
...@@ -937,11 +927,9 @@ static void wl1271_recovery_work(struct work_struct *work) ...@@ -937,11 +927,9 @@ static void wl1271_recovery_work(struct work_struct *work)
if (wl->state == WLCORE_STATE_OFF || wl->plt) if (wl->state == WLCORE_STATE_OFF || wl->plt)
goto out_unlock; goto out_unlock;
error = pm_runtime_get_sync(wl->dev); error = pm_runtime_resume_and_get(wl->dev);
if (error < 0) { if (error < 0)
wl1271_warning("Enable for recovery failed"); wl1271_warning("Enable for recovery failed");
pm_runtime_put_noidle(wl->dev);
}
wlcore_disable_interrupts_nosync(wl); wlcore_disable_interrupts_nosync(wl);
if (!test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags)) { if (!test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags)) {
...@@ -1741,9 +1729,8 @@ static int __maybe_unused wl1271_op_suspend(struct ieee80211_hw *hw, ...@@ -1741,9 +1729,8 @@ static int __maybe_unused wl1271_op_suspend(struct ieee80211_hw *hw,
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0) {
pm_runtime_put_noidle(wl->dev);
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
return ret; return ret;
} }
...@@ -1855,11 +1842,9 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw) ...@@ -1855,11 +1842,9 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
goto out_sleep; goto out_sleep;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl12xx_for_each_wlvif(wl, wlvif) { wl12xx_for_each_wlvif(wl, wlvif) {
if (wlcore_is_p2p_mgmt(wlvif)) if (wlcore_is_p2p_mgmt(wlvif))
...@@ -2060,11 +2045,9 @@ static void wlcore_channel_switch_work(struct work_struct *work) ...@@ -2060,11 +2045,9 @@ static void wlcore_channel_switch_work(struct work_struct *work)
vif = wl12xx_wlvif_to_vif(wlvif); vif = wl12xx_wlvif_to_vif(wlvif);
ieee80211_chswitch_done(vif, false); ieee80211_chswitch_done(vif, false);
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl12xx_cmd_stop_channel_switch(wl, wlvif); wl12xx_cmd_stop_channel_switch(wl, wlvif);
...@@ -2131,11 +2114,9 @@ static void wlcore_pending_auth_complete_work(struct work_struct *work) ...@@ -2131,11 +2114,9 @@ static void wlcore_pending_auth_complete_work(struct work_struct *work)
if (!time_after(time_spare, wlvif->pending_auth_reply_time)) if (!time_after(time_spare, wlvif->pending_auth_reply_time))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
/* cancel the ROC if active */ /* cancel the ROC if active */
wlcore_update_inconn_sta(wl, wlvif, NULL, false); wlcore_update_inconn_sta(wl, wlvif, NULL, false);
...@@ -2591,11 +2572,9 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ...@@ -2591,11 +2572,9 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
* Call runtime PM only after possible wl12xx_init_fw() above * Call runtime PM only after possible wl12xx_init_fw() above
* is done. Otherwise we do not have interrupts enabled. * is done. Otherwise we do not have interrupts enabled.
*/ */
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out_unlock; goto out_unlock;
}
if (wl12xx_need_fw_change(wl, vif_count, true)) { if (wl12xx_need_fw_change(wl, vif_count, true)) {
wl12xx_force_active_psm(wl); wl12xx_force_active_psm(wl);
...@@ -2691,11 +2670,9 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl, ...@@ -2691,11 +2670,9 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
if (!test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags)) { if (!test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags)) {
/* disable active roles */ /* disable active roles */
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto deinit; goto deinit;
}
if (wlvif->bss_type == BSS_TYPE_STA_BSS || if (wlvif->bss_type == BSS_TYPE_STA_BSS ||
wlvif->bss_type == BSS_TYPE_IBSS) { wlvif->bss_type == BSS_TYPE_IBSS) {
...@@ -3129,11 +3106,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed) ...@@ -3129,11 +3106,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
/* configure each interface */ /* configure each interface */
wl12xx_for_each_wlvif(wl, wlvif) { wl12xx_for_each_wlvif(wl, wlvif) {
...@@ -3213,11 +3188,9 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw, ...@@ -3213,11 +3188,9 @@ static void wl1271_op_configure_filter(struct ieee80211_hw *hw,
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl12xx_for_each_wlvif(wl, wlvif) { wl12xx_for_each_wlvif(wl, wlvif) {
if (wlcore_is_p2p_mgmt(wlvif)) if (wlcore_is_p2p_mgmt(wlvif))
...@@ -3470,11 +3443,9 @@ static int wlcore_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, ...@@ -3470,11 +3443,9 @@ static int wlcore_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
goto out_wake_queues; goto out_wake_queues;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out_wake_queues; goto out_wake_queues;
}
ret = wlcore_hw_set_key(wl, cmd, vif, sta, key_conf); ret = wlcore_hw_set_key(wl, cmd, vif, sta, key_conf);
...@@ -3622,11 +3593,9 @@ static void wl1271_op_set_default_key_idx(struct ieee80211_hw *hw, ...@@ -3622,11 +3593,9 @@ static void wl1271_op_set_default_key_idx(struct ieee80211_hw *hw,
goto out_unlock; goto out_unlock;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out_unlock; goto out_unlock;
}
wlvif->default_key = key_idx; wlvif->default_key = key_idx;
...@@ -3659,11 +3628,9 @@ void wlcore_regdomain_config(struct wl1271 *wl) ...@@ -3659,11 +3628,9 @@ void wlcore_regdomain_config(struct wl1271 *wl)
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_autosuspend(wl->dev);
goto out; goto out;
}
ret = wlcore_cmd_regdomain_config_locked(wl); ret = wlcore_cmd_regdomain_config_locked(wl);
if (ret < 0) { if (ret < 0) {
...@@ -3706,11 +3673,9 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw, ...@@ -3706,11 +3673,9 @@ static int wl1271_op_hw_scan(struct ieee80211_hw *hw,
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
/* fail if there is any role in ROC */ /* fail if there is any role in ROC */
if (find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES) { if (find_first_bit(wl->roc_map, WL12XX_MAX_ROLES) < WL12XX_MAX_ROLES) {
...@@ -3749,11 +3714,9 @@ static void wl1271_op_cancel_hw_scan(struct ieee80211_hw *hw, ...@@ -3749,11 +3714,9 @@ static void wl1271_op_cancel_hw_scan(struct ieee80211_hw *hw,
if (wl->scan.state == WL1271_SCAN_STATE_IDLE) if (wl->scan.state == WL1271_SCAN_STATE_IDLE)
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
if (wl->scan.state != WL1271_SCAN_STATE_DONE) { if (wl->scan.state != WL1271_SCAN_STATE_DONE) {
ret = wl->ops->scan_stop(wl, wlvif); ret = wl->ops->scan_stop(wl, wlvif);
...@@ -3800,11 +3763,9 @@ static int wl1271_op_sched_scan_start(struct ieee80211_hw *hw, ...@@ -3800,11 +3763,9 @@ static int wl1271_op_sched_scan_start(struct ieee80211_hw *hw,
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl->ops->sched_scan_start(wl, wlvif, req, ies); ret = wl->ops->sched_scan_start(wl, wlvif, req, ies);
if (ret < 0) if (ret < 0)
...@@ -3834,11 +3795,9 @@ static int wl1271_op_sched_scan_stop(struct ieee80211_hw *hw, ...@@ -3834,11 +3795,9 @@ static int wl1271_op_sched_scan_stop(struct ieee80211_hw *hw,
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl->ops->sched_scan_stop(wl, wlvif); wl->ops->sched_scan_stop(wl, wlvif);
...@@ -3862,11 +3821,9 @@ static int wl1271_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value) ...@@ -3862,11 +3821,9 @@ static int wl1271_op_set_frag_threshold(struct ieee80211_hw *hw, u32 value)
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl1271_acx_frag_threshold(wl, value); ret = wl1271_acx_frag_threshold(wl, value);
if (ret < 0) if (ret < 0)
...@@ -3894,11 +3851,9 @@ static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value) ...@@ -3894,11 +3851,9 @@ static int wl1271_op_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl12xx_for_each_wlvif(wl, wlvif) { wl12xx_for_each_wlvif(wl, wlvif) {
ret = wl1271_acx_rts_threshold(wl, wlvif, value); ret = wl1271_acx_rts_threshold(wl, wlvif, value);
...@@ -4653,11 +4608,9 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw, ...@@ -4653,11 +4608,9 @@ static void wl1271_op_bss_info_changed(struct ieee80211_hw *hw,
if (unlikely(!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags))) if (unlikely(!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags)))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
if ((changed & BSS_CHANGED_TXPOWER) && if ((changed & BSS_CHANGED_TXPOWER) &&
bss_conf->txpower != wlvif->power_level) { bss_conf->txpower != wlvif->power_level) {
...@@ -4714,11 +4667,9 @@ static void wlcore_op_change_chanctx(struct ieee80211_hw *hw, ...@@ -4714,11 +4667,9 @@ static void wlcore_op_change_chanctx(struct ieee80211_hw *hw,
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl12xx_for_each_wlvif(wl, wlvif) { wl12xx_for_each_wlvif(wl, wlvif) {
struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif); struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
...@@ -4771,11 +4722,9 @@ static int wlcore_op_assign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -4771,11 +4722,9 @@ static int wlcore_op_assign_vif_chanctx(struct ieee80211_hw *hw,
if (unlikely(!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags))) if (unlikely(!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags)))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wlvif->band = ctx->def.chan->band; wlvif->band = ctx->def.chan->band;
wlvif->channel = channel; wlvif->channel = channel;
...@@ -4823,11 +4772,9 @@ static void wlcore_op_unassign_vif_chanctx(struct ieee80211_hw *hw, ...@@ -4823,11 +4772,9 @@ static void wlcore_op_unassign_vif_chanctx(struct ieee80211_hw *hw,
if (unlikely(!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags))) if (unlikely(!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags)))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
if (wlvif->radar_enabled) { if (wlvif->radar_enabled) {
wl1271_debug(DEBUG_MAC80211, "Stop radar detection"); wl1271_debug(DEBUG_MAC80211, "Stop radar detection");
...@@ -4893,11 +4840,9 @@ wlcore_op_switch_vif_chanctx(struct ieee80211_hw *hw, ...@@ -4893,11 +4840,9 @@ wlcore_op_switch_vif_chanctx(struct ieee80211_hw *hw,
mutex_lock(&wl->mutex); mutex_lock(&wl->mutex);
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
for (i = 0; i < n_vifs; i++) { for (i = 0; i < n_vifs; i++) {
struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vifs[i].vif); struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vifs[i].vif);
...@@ -4939,11 +4884,9 @@ static int wl1271_op_conf_tx(struct ieee80211_hw *hw, ...@@ -4939,11 +4884,9 @@ static int wl1271_op_conf_tx(struct ieee80211_hw *hw,
if (!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags)) if (!test_bit(WLVIF_FLAG_INITIALIZED, &wlvif->flags))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
/* /*
* the txop is confed in units of 32us by the mac80211, * the txop is confed in units of 32us by the mac80211,
...@@ -4987,11 +4930,9 @@ static u64 wl1271_op_get_tsf(struct ieee80211_hw *hw, ...@@ -4987,11 +4930,9 @@ static u64 wl1271_op_get_tsf(struct ieee80211_hw *hw,
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl12xx_acx_tsf_info(wl, wlvif, &mactime); ret = wl12xx_acx_tsf_info(wl, wlvif, &mactime);
if (ret < 0) if (ret < 0)
...@@ -5306,11 +5247,9 @@ static int wl12xx_op_sta_state(struct ieee80211_hw *hw, ...@@ -5306,11 +5247,9 @@ static int wl12xx_op_sta_state(struct ieee80211_hw *hw,
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl12xx_update_sta_state(wl, wlvif, sta, old_state, new_state); ret = wl12xx_update_sta_state(wl, wlvif, sta, old_state, new_state);
...@@ -5364,11 +5303,9 @@ static int wl1271_op_ampdu_action(struct ieee80211_hw *hw, ...@@ -5364,11 +5303,9 @@ static int wl1271_op_ampdu_action(struct ieee80211_hw *hw,
ba_bitmap = &wl->links[hlid].ba_bitmap; ba_bitmap = &wl->links[hlid].ba_bitmap;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl1271_debug(DEBUG_MAC80211, "mac80211 ampdu: Rx tid %d action %d", wl1271_debug(DEBUG_MAC80211, "mac80211 ampdu: Rx tid %d action %d",
tid, action); tid, action);
...@@ -5476,11 +5413,9 @@ static int wl12xx_set_bitrate_mask(struct ieee80211_hw *hw, ...@@ -5476,11 +5413,9 @@ static int wl12xx_set_bitrate_mask(struct ieee80211_hw *hw,
if (wlvif->bss_type == BSS_TYPE_STA_BSS && if (wlvif->bss_type == BSS_TYPE_STA_BSS &&
!test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) { !test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags)) {
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
wl1271_set_band_rate(wl, wlvif); wl1271_set_band_rate(wl, wlvif);
wlvif->basic_rate = wlvif->basic_rate =
...@@ -5518,11 +5453,9 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw, ...@@ -5518,11 +5453,9 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw,
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
/* TODO: change mac80211 to pass vif as param */ /* TODO: change mac80211 to pass vif as param */
...@@ -5612,11 +5545,9 @@ static void wlcore_op_channel_switch_beacon(struct ieee80211_hw *hw, ...@@ -5612,11 +5545,9 @@ static void wlcore_op_channel_switch_beacon(struct ieee80211_hw *hw,
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl->ops->channel_switch(wl, wlvif, &ch_switch); ret = wl->ops->channel_switch(wl, wlvif, &ch_switch);
if (ret) if (ret)
...@@ -5667,11 +5598,9 @@ static int wlcore_op_remain_on_channel(struct ieee80211_hw *hw, ...@@ -5667,11 +5598,9 @@ static int wlcore_op_remain_on_channel(struct ieee80211_hw *hw,
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = wl12xx_start_dev(wl, wlvif, chan->band, channel); ret = wl12xx_start_dev(wl, wlvif, chan->band, channel);
if (ret < 0) if (ret < 0)
...@@ -5724,11 +5653,9 @@ static int wlcore_roc_completed(struct wl1271 *wl) ...@@ -5724,11 +5653,9 @@ static int wlcore_roc_completed(struct wl1271 *wl)
goto out; goto out;
} }
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out; goto out;
}
ret = __wlcore_roc_completed(wl); ret = __wlcore_roc_completed(wl);
...@@ -5810,11 +5737,9 @@ static void wlcore_op_sta_statistics(struct ieee80211_hw *hw, ...@@ -5810,11 +5737,9 @@ static void wlcore_op_sta_statistics(struct ieee80211_hw *hw,
if (unlikely(wl->state != WLCORE_STATE_ON)) if (unlikely(wl->state != WLCORE_STATE_ON))
goto out; goto out;
ret = pm_runtime_get_sync(wl->dev); ret = pm_runtime_resume_and_get(wl->dev);
if (ret < 0) { if (ret < 0)
pm_runtime_put_noidle(wl->dev);
goto out_sleep; goto out_sleep;
}
ret = wlcore_acx_average_rssi(wl, wlvif, &rssi_dbm); ret = wlcore_acx_average_rssi(wl, wlvif, &rssi_dbm);
if (ret < 0) if (ret < 0)
......
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