wifi: iwlwifi: pcie: move wait_command_queue into PCIe
authorJohannes Berg <johannes.berg@intel.com>
Sat, 3 May 2025 19:44:23 +0000 (22:44 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 7 May 2025 03:08:00 +0000 (06:08 +0300)
There's no reason for this to be declared in the transport
struct, so move the item to the PCIe struct.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250503224231.793f625c5c2d.I64ebb402255d84c2ad045a65e5a4e4891ead5b26@changeid
drivers/net/wireless/intel/iwlwifi/iwl-trans.c
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
drivers/net/wireless/intel/iwlwifi/pcie/rx.c
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
drivers/net/wireless/intel/iwlwifi/pcie/tx.c

index 1c669fb0a5b63de2fb45a58884fdb08c6f04ba87..aaade854b8b778830bdcd093ce8679d8cf57a26c 100644 (file)
@@ -310,9 +310,6 @@ int iwl_trans_init(struct iwl_trans *trans)
        if (!trans->dev_cmd_pool)
                return -ENOMEM;
 
-       /* Initialize the wait queue for commands */
-       init_waitqueue_head(&trans->wait_command_queue);
-
        return 0;
 }
 
index 387a54fa728c711161ab413de80881c16efd9d95..3a3bc5d4f4058b6f0f176dc706c4a8ad20d8649e 100644 (file)
@@ -854,7 +854,6 @@ struct iwl_txq {
  * @command_groups: pointer to command group name list array
  * @command_groups_size: array size of @command_groups
  * @wide_cmd_header: true when ucode supports wide command header format
- * @wait_command_queue: wait queue for sync commands
  * @num_rx_queues: number of RX queues allocated by the transport;
  *     the transport must set this before calling iwl_drv_start()
  * @iml_len: the length of the image loader
@@ -934,7 +933,6 @@ struct iwl_trans {
        int command_groups_size;
        bool wide_cmd_header;
 
-       wait_queue_head_t wait_command_queue;
        u8 num_rx_queues;
 
        size_t iml_len;
index 6eee20ffbfc8f9f0c3ca02bc48c0218483361c64..259ad96c012d4d898030b7790ad22d1958e87321 100644 (file)
@@ -424,6 +424,7 @@ struct iwl_pcie_txqs {
  *     or unknown (-1, so can still use it as a boolean safely)
  * @me_recheck_wk: worker to recheck WiAMT/CSME presence
  * @invalid_tx_cmd: invalid TX command buffer
+ * @wait_command_queue: wait queue for sync commands
  */
 struct iwl_trans_pcie {
        struct iwl_rxq *rxq;
@@ -528,6 +529,8 @@ struct iwl_trans_pcie {
        struct delayed_work me_recheck_wk;
 
        struct iwl_dma_ptr invalid_tx_cmd;
+
+       wait_queue_head_t wait_command_queue;
 };
 
 static inline struct iwl_trans_pcie *
index b619a77f81f1eab5c815a32ddb264e514eb04330..d3c72cf0a5f4e19ad5171e73e9d2659a79ad215b 100644 (file)
@@ -1691,7 +1691,7 @@ static void iwl_pcie_irq_handle_error(struct iwl_trans *trans)
                            APMG_PS_CTRL_VAL_RESET_REQ))) {
                clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status);
                iwl_op_mode_wimax_active(trans->op_mode);
-               wake_up(&trans->wait_command_queue);
+               wake_up(&trans_pcie->wait_command_queue);
                return;
        }
 
@@ -1706,7 +1706,7 @@ static void iwl_pcie_irq_handle_error(struct iwl_trans *trans)
        iwl_trans_fw_error(trans, IWL_ERR_TYPE_IRQ);
 
        clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status);
-       wake_up(&trans->wait_command_queue);
+       wake_up(&trans_pcie->wait_command_queue);
 }
 
 static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans)
@@ -1821,7 +1821,7 @@ void iwl_pcie_handle_rfkill_irq(struct iwl_trans *trans, bool from_irq)
                                       &trans->status))
                        IWL_DEBUG_RF_KILL(trans,
                                          "Rfkill while SYNC HCMD in flight\n");
-               wake_up(&trans->wait_command_queue);
+               wake_up(&trans_pcie->wait_command_queue);
        } else {
                clear_bit(STATUS_RFKILL_HW, &trans->status);
                if (trans_pcie->opmode_down)
index bd6b87e4f6e6a01f27cfd4e31d292b85ff32e24a..d055aab581f51f68d7bb253969dcd1e872edb8df 100644 (file)
@@ -3828,6 +3828,9 @@ iwl_trans_pcie_alloc(struct pci_dev *pdev,
 
        trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
 
+       /* Initialize the wait queue for commands */
+       init_waitqueue_head(&trans_pcie->wait_command_queue);
+
        if (trans->trans_cfg->gen2) {
                trans_pcie->txqs.tfd.addr_size = 64;
                trans_pcie->txqs.tfd.max_tbs = IWL_TFH_NUM_TBS;
index c728722533a8b303a9363770529ea29e457b6a2b..51a80a0f1688bb6fea18a6fe86721d8f7f8e2be6 100644 (file)
@@ -1686,7 +1686,7 @@ void iwl_pcie_hcmd_complete(struct iwl_trans *trans,
                clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status);
                IWL_DEBUG_INFO(trans, "Clearing HCMD_ACTIVE for command %s\n",
                               iwl_get_cmd_string(trans, cmd_id));
-               wake_up(&trans->wait_command_queue);
+               wake_up(&trans_pcie->wait_command_queue);
        }
 
        meta->flags = 0;
@@ -2581,7 +2581,7 @@ static int iwl_trans_pcie_send_hcmd_sync(struct iwl_trans *trans,
                return ret;
        }
 
-       ret = wait_event_timeout(trans->wait_command_queue,
+       ret = wait_event_timeout(trans_pcie->wait_command_queue,
                                 !test_bit(STATUS_SYNC_HCMD_ACTIVE,
                                           &trans->status),
                                 HOST_COMPLETE_TIMEOUT);