]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: iwlwifi: add support for the devcoredump
authorPagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Wed, 11 Jun 2025 19:26:21 +0000 (22:26 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 25 Jun 2025 07:57:32 +0000 (10:57 +0300)
This handler will be used by upcoming changes to trigger
firmware dumps from devcoredump through trans layer.

Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250611222325.bb38efe6700d.I9c666440dd1eac13ac52a2c2d533224c36fea2a6@changeid
drivers/net/wireless/intel/iwlwifi/iwl-op-mode.h
drivers/net/wireless/intel/iwlwifi/pcie/drv.c

index 5dc299296d6ddc72b2961950052aadad6a86b7ab..a146d0e399f226105389a146db3f015cfa8e5c43 100644 (file)
@@ -147,6 +147,8 @@ struct iwl_fw_error_dump_mode {
  *     Op_mode needs to reset its internal state because the device did not
  *     survive the system state transition. The firmware is no longer running,
  *     etc...
+ * @dump: Op_mode needs to collect the firmware dump upon this handler
+ *     being called.
  */
 struct iwl_op_mode_ops {
        struct iwl_op_mode *(*start)(struct iwl_trans *trans,
@@ -174,6 +176,7 @@ struct iwl_op_mode_ops {
                           enum iwl_fw_ini_time_point tp_id,
                           union iwl_dbg_tlv_tp_data *tp_data);
        void (*device_powered_off)(struct iwl_op_mode *op_mode);
+       void (*dump)(struct iwl_op_mode *op_mode);
 };
 
 int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops);
@@ -286,4 +289,11 @@ static inline void iwl_op_mode_device_powered_off(struct iwl_op_mode *op_mode)
        op_mode->ops->device_powered_off(op_mode);
 }
 
+static inline void iwl_op_mode_dump(struct iwl_op_mode *op_mode)
+{
+       if (!op_mode || !op_mode->ops || !op_mode->ops->dump)
+               return;
+       op_mode->ops->dump(op_mode);
+}
+
 #endif /* __iwl_op_mode_h__ */
index 44e19b27f36a193ff551300366c4f0e0b384567a..a42a6da5d2ea92b8818f1cc5b634bb3677a241cb 100644 (file)
@@ -1564,12 +1564,21 @@ static const struct dev_pm_ops iwl_dev_pm_ops = {
 
 #endif /* CONFIG_PM_SLEEP */
 
+static void iwl_pci_dump(struct device *device)
+{
+       struct pci_dev *pdev = to_pci_dev(device);
+       struct iwl_trans *trans = pci_get_drvdata(pdev);
+
+       iwl_op_mode_dump(trans->op_mode);
+}
+
 static struct pci_driver iwl_pci_driver = {
        .name = DRV_NAME,
        .id_table = iwl_hw_card_ids,
        .probe = iwl_pci_probe,
        .remove = iwl_pci_remove,
        .driver.pm = IWL_PM_OPS,
+       .driver.coredump = iwl_pci_dump,
 };
 
 int __must_check iwl_pci_register_driver(void)