OSDN Git Service

iwlwifi: pcie: remove some more d0i3 code from the transport
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Thu, 6 Jun 2019 09:07:30 +0000 (12:07 +0300)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 6 Sep 2019 12:31:17 +0000 (15:31 +0300)
CMD_SEND_IN_IDLE, CMD_MAKE_TRANS_IDLE and CMD_WAKE_UP_TRANS
are not used. Remove them.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
drivers/net/wireless/intel/iwlwifi/pcie/tx.c

index 7c63706..687eced 100644 (file)
@@ -159,10 +159,6 @@ static inline u32 iwl_rx_packet_payload_len(const struct iwl_rx_packet *pkt)
  * @CMD_ASYNC: Return right away and don't wait for the response
  * @CMD_WANT_SKB: Not valid with CMD_ASYNC. The caller needs the buffer of
  *     the response. The caller needs to call iwl_free_resp when done.
- * @CMD_SEND_IN_IDLE: The command should be sent even when the trans is idle.
- * @CMD_MAKE_TRANS_IDLE: The command response should mark the trans as idle.
- * @CMD_WAKE_UP_TRANS: The command response should wake up the trans
- *     (i.e. mark it as non-idle).
  * @CMD_WANT_ASYNC_CALLBACK: the op_mode's async callback function must be
  *     called after this command completes. Valid only with CMD_ASYNC.
  */
@@ -170,10 +166,7 @@ enum CMD_MODE {
        CMD_ASYNC               = BIT(0),
        CMD_WANT_SKB            = BIT(1),
        CMD_SEND_IN_RFKILL      = BIT(2),
-       CMD_SEND_IN_IDLE        = BIT(3),
-       CMD_MAKE_TRANS_IDLE     = BIT(4),
-       CMD_WAKE_UP_TRANS       = BIT(5),
-       CMD_WANT_ASYNC_CALLBACK = BIT(6),
+       CMD_WANT_ASYNC_CALLBACK = BIT(3),
 };
 
 #define DEF_CMD_PAYLOAD_SIZE 320
@@ -659,11 +652,6 @@ enum iwl_plat_pm_mode {
        IWL_PLAT_PM_MODE_D3,
 };
 
-/* Max time to wait for trans to become idle/non-idle on d0i3
- * enter/exit (in msecs).
- */
-#define IWL_TRANS_IDLE_TIMEOUT 2000
-
 /* Max time to wait for nmi interrupt */
 #define IWL_TRANS_NMI_TIMEOUT (HZ / 4)
 
index b5534fc..97f9f0a 100644 (file)
@@ -558,7 +558,6 @@ struct iwl_trans_pcie {
        bool ucode_write_complete;
        wait_queue_head_t ucode_write_waitq;
        wait_queue_head_t wait_command_queue;
-       wait_queue_head_t d0i3_waitq;
 
        u8 page_offs, dev_cmd_offs;
 
@@ -581,7 +580,6 @@ struct iwl_trans_pcie {
        /*protect hw register */
        spinlock_t reg_lock;
        bool cmd_hold_nic_awake;
-       bool ref_cmd_in_flight;
 
 #ifdef CONFIG_IWLWIFI_DEBUGFS
        struct cont_rec fw_mon_data;
index ad0c255..081a3a3 100644 (file)
@@ -3590,8 +3590,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
        /* Initialize the wait queue for commands */
        init_waitqueue_head(&trans_pcie->wait_command_queue);
 
-       init_waitqueue_head(&trans_pcie->d0i3_waitq);
-
        if (trans_pcie->msix_enabled) {
                ret = iwl_pcie_init_msix_handler(pdev, trans_pcie);
                if (ret)
index 5f52bf8..e65d4ef 100644 (file)
@@ -926,16 +926,6 @@ static int iwl_pcie_gen2_send_hcmd_sync(struct iwl_trans *trans,
 
        IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n", cmd_str);
 
-       if (pm_runtime_suspended(&trans_pcie->pci_dev->dev)) {
-               ret = wait_event_timeout(trans_pcie->d0i3_waitq,
-                                pm_runtime_active(&trans_pcie->pci_dev->dev),
-                                msecs_to_jiffies(IWL_TRANS_IDLE_TIMEOUT));
-               if (!ret) {
-                       IWL_ERR(trans, "Timeout exiting D0i3 before hcmd\n");
-                       return -ETIMEDOUT;
-               }
-       }
-
        cmd_idx = iwl_pcie_gen2_enqueue_hcmd(trans, cmd);
        if (cmd_idx < 0) {
                ret = cmd_idx;
index 4535619..9432374 100644 (file)
@@ -1858,20 +1858,6 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans,
                wake_up(&trans_pcie->wait_command_queue);
        }
 
-       if (meta->flags & CMD_MAKE_TRANS_IDLE) {
-               IWL_DEBUG_INFO(trans, "complete %s - mark trans as idle\n",
-                              iwl_get_cmd_string(trans, cmd->hdr.cmd));
-               set_bit(STATUS_TRANS_IDLE, &trans->status);
-               wake_up(&trans_pcie->d0i3_waitq);
-       }
-
-       if (meta->flags & CMD_WAKE_UP_TRANS) {
-               IWL_DEBUG_INFO(trans, "complete %s - clear trans idle flag\n",
-                              iwl_get_cmd_string(trans, cmd->hdr.cmd));
-               clear_bit(STATUS_TRANS_IDLE, &trans->status);
-               wake_up(&trans_pcie->d0i3_waitq);
-       }
-
        meta->flags = 0;
 
        spin_unlock_bh(&txq->lock);
@@ -1918,16 +1904,6 @@ static int iwl_pcie_send_hcmd_sync(struct iwl_trans *trans,
        IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n",
                       iwl_get_cmd_string(trans, cmd->id));
 
-       if (pm_runtime_suspended(&trans_pcie->pci_dev->dev)) {
-               ret = wait_event_timeout(trans_pcie->d0i3_waitq,
-                                pm_runtime_active(&trans_pcie->pci_dev->dev),
-                                msecs_to_jiffies(IWL_TRANS_IDLE_TIMEOUT));
-               if (!ret) {
-                       IWL_ERR(trans, "Timeout exiting D0i3 before hcmd\n");
-                       return -ETIMEDOUT;
-               }
-       }
-
        cmd_idx = iwl_pcie_enqueue_hcmd(trans, cmd);
        if (cmd_idx < 0) {
                ret = cmd_idx;