aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/pcie/trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie/trans.c')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 939c2f78df58..38f51b04217e 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -492,10 +492,11 @@ static void iwl_tx_queue_free(struct iwl_trans *trans, int txq_id)
492 iwl_tx_queue_unmap(trans, txq_id); 492 iwl_tx_queue_unmap(trans, txq_id);
493 493
494 /* De-alloc array of command/tx buffers */ 494 /* De-alloc array of command/tx buffers */
495
496 if (txq_id == trans_pcie->cmd_queue) 495 if (txq_id == trans_pcie->cmd_queue)
497 for (i = 0; i < txq->q.n_window; i++) 496 for (i = 0; i < txq->q.n_window; i++) {
498 kfree(txq->entries[i].cmd); 497 kfree(txq->entries[i].cmd);
498 kfree(txq->entries[i].copy_cmd);
499 }
499 500
500 /* De-alloc circular buffer of TFDs */ 501 /* De-alloc circular buffer of TFDs */
501 if (txq->q.n_bd) { 502 if (txq->q.n_bd) {
@@ -896,6 +897,7 @@ static int iwl_set_hw_ready(struct iwl_trans *trans)
896static int iwl_prepare_card_hw(struct iwl_trans *trans) 897static int iwl_prepare_card_hw(struct iwl_trans *trans)
897{ 898{
898 int ret; 899 int ret;
900 int t = 0;
899 901
900 IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n"); 902 IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n");
901 903
@@ -908,17 +910,15 @@ static int iwl_prepare_card_hw(struct iwl_trans *trans)
908 iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, 910 iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
909 CSR_HW_IF_CONFIG_REG_PREPARE); 911 CSR_HW_IF_CONFIG_REG_PREPARE);
910 912
911 ret = iwl_poll_bit(trans, CSR_HW_IF_CONFIG_REG, 913 do {
912 ~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 914 ret = iwl_set_hw_ready(trans);
913 CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000); 915 if (ret >= 0)
916 return 0;
914 917
915 if (ret < 0) 918 usleep_range(200, 1000);
916 return ret; 919 t += 200;
920 } while (t < 150000);
917 921
918 /* HW should be ready by now, check again. */
919 ret = iwl_set_hw_ready(trans);
920 if (ret >= 0)
921 return 0;
922 return ret; 922 return ret;
923} 923}
924 924
@@ -1769,7 +1769,7 @@ void iwl_dump_csr(struct iwl_trans *trans)
1769#define DEBUGFS_ADD_FILE(name, parent, mode) do { \ 1769#define DEBUGFS_ADD_FILE(name, parent, mode) do { \
1770 if (!debugfs_create_file(#name, mode, parent, trans, \ 1770 if (!debugfs_create_file(#name, mode, parent, trans, \
1771 &iwl_dbgfs_##name##_ops)) \ 1771 &iwl_dbgfs_##name##_ops)) \
1772 return -ENOMEM; \ 1772 goto err; \
1773} while (0) 1773} while (0)
1774 1774
1775/* file operation */ 1775/* file operation */
@@ -2033,6 +2033,10 @@ static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans,
2033 DEBUGFS_ADD_FILE(fh_reg, dir, S_IRUSR); 2033 DEBUGFS_ADD_FILE(fh_reg, dir, S_IRUSR);
2034 DEBUGFS_ADD_FILE(fw_restart, dir, S_IWUSR); 2034 DEBUGFS_ADD_FILE(fw_restart, dir, S_IWUSR);
2035 return 0; 2035 return 0;
2036
2037err:
2038 IWL_ERR(trans, "failed to create the trans debugfs entry\n");
2039 return -ENOMEM;
2036} 2040}
2037#else 2041#else
2038static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans, 2042static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans,