Skip to content

Commit

Permalink
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/iwlwifi/iwlwifi-fixes
  • Loading branch information
John W. Linville committed Aug 9, 2013
2 parents 5a6e0cf + 0573979 commit 4fec06a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 26 deletions.
5 changes: 4 additions & 1 deletion drivers/net/wireless/iwlwifi/dvm/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,7 +1068,10 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success)
if (test_bit(STATUS_EXIT_PENDING, &priv->status))
return;

if (test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
if (!test_and_clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->status))
return;

if (ctx->vif)
ieee80211_chswitch_done(ctx->vif, is_success);
}

Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/iwlwifi/iwl-prph.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,6 @@

#define APMG_PCIDEV_STT_VAL_L1_ACT_DIS (0x00000800)

#define APMG_RTC_INT_STT_RFKILL (0x10000000)

/* Device system time */
#define DEVICE_SYSTEM_TIME_REG 0xA0206C

Expand Down
33 changes: 23 additions & 10 deletions drivers/net/wireless/iwlwifi/mvm/time-event.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ static void iwl_mvm_roc_finished(struct iwl_mvm *mvm)
schedule_work(&mvm->roc_done_wk);
}

static bool iwl_mvm_te_check_disconnect(struct iwl_mvm *mvm,
struct ieee80211_vif *vif,
const char *errmsg)
{
if (vif->type != NL80211_IFTYPE_STATION)
return false;
if (vif->bss_conf.assoc && vif->bss_conf.dtim_period)
return false;
if (errmsg)
IWL_ERR(mvm, "%s\n", errmsg);
ieee80211_connection_loss(vif);
return true;
}

/*
* Handles a FW notification for an event that is known to the driver.
*
Expand All @@ -163,8 +177,13 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
* P2P Device discoveribility, while there are other higher priority
* events in the system).
*/
WARN_ONCE(!le32_to_cpu(notif->status),
"Failed to schedule time event\n");
if (WARN_ONCE(!le32_to_cpu(notif->status),
"Failed to schedule time event\n")) {
if (iwl_mvm_te_check_disconnect(mvm, te_data->vif, NULL)) {
iwl_mvm_te_clear_data(mvm, te_data);
return;
}
}

if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_END) {
IWL_DEBUG_TE(mvm,
Expand All @@ -180,14 +199,8 @@ static void iwl_mvm_te_handle_notif(struct iwl_mvm *mvm,
* By now, we should have finished association
* and know the dtim period.
*/
if (te_data->vif->type == NL80211_IFTYPE_STATION &&
(!te_data->vif->bss_conf.assoc ||
!te_data->vif->bss_conf.dtim_period)) {
IWL_ERR(mvm,
"No assocation and the time event is over already...\n");
ieee80211_connection_loss(te_data->vif);
}

iwl_mvm_te_check_disconnect(mvm, te_data->vif,
"No assocation and the time event is over already...");
iwl_mvm_te_clear_data(mvm, te_data);
} else if (le32_to_cpu(notif->action) & TE_NOTIF_HOST_EVENT_START) {
te_data->running = true;
Expand Down
8 changes: 0 additions & 8 deletions drivers/net/wireless/iwlwifi/pcie/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -888,14 +888,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)

iwl_op_mode_hw_rf_kill(trans->op_mode, hw_rfkill);
if (hw_rfkill) {
/*
* Clear the interrupt in APMG if the NIC is going down.
* Note that when the NIC exits RFkill (else branch), we
* can't access prph and the NIC will be reset in
* start_hw anyway.
*/
iwl_write_prph(trans, APMG_RTC_INT_STT_REG,
APMG_RTC_INT_STT_RFKILL);
set_bit(STATUS_RFKILL, &trans_pcie->status);
if (test_and_clear_bit(STATUS_HCMD_ACTIVE,
&trans_pcie->status))
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/wireless/iwlwifi/pcie/trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,16 +1502,16 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
spin_lock_init(&trans_pcie->reg_lock);
init_waitqueue_head(&trans_pcie->ucode_write_waitq);

/* W/A - seems to solve weird behavior. We need to remove this if we
* don't want to stay in L1 all the time. This wastes a lot of power */
pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
PCIE_LINK_STATE_CLKPM);

if (pci_enable_device(pdev)) {
err = -ENODEV;
goto out_no_pci;
}

/* W/A - seems to solve weird behavior. We need to remove this if we
* don't want to stay in L1 all the time. This wastes a lot of power */
pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
PCIE_LINK_STATE_CLKPM);

pci_set_master(pdev);

err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36));
Expand Down

0 comments on commit 4fec06a

Please sign in to comment.