]> www.infradead.org Git - users/hch/block.git/commitdiff
ice: Fix debugfs with devlink reload
authorWojciech Drewek <wojciech.drewek@intel.com>
Mon, 5 Feb 2024 13:03:57 +0000 (14:03 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 12 Feb 2024 18:12:42 +0000 (10:12 -0800)
During devlink reload it is needed to remove debugfs entries
correlated with only one PF. ice_debugfs_exit() removes all
entries created by ice driver so we can't use it.

Introduce ice_debugfs_pf_deinit() in order to release PF's
debugfs entries. Move ice_debugfs_exit() call to ice_module_exit(),
it makes more sense since ice_debugfs_init() is called in
ice_module_init() and not in ice_probe().

Signed-off-by: Wojciech Drewek <wojciech.drewek@intel.com>
Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel)
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice.h
drivers/net/ethernet/intel/ice/ice_debugfs.c
drivers/net/ethernet/intel/ice/ice_fwlog.c
drivers/net/ethernet/intel/ice/ice_main.c

index 118e8483572012b9101c78bb186b005a8badfc51..365c03d1c4622340f119a072ef73127a44203b13 100644 (file)
@@ -896,6 +896,7 @@ static inline bool ice_is_adq_active(struct ice_pf *pf)
 }
 
 void ice_debugfs_fwlog_init(struct ice_pf *pf);
+void ice_debugfs_pf_deinit(struct ice_pf *pf);
 void ice_debugfs_init(void);
 void ice_debugfs_exit(void);
 void ice_pf_fwlog_update_module(struct ice_pf *pf, int log_level, int module);
index 85aa31dd86b1134e4fc3ec355daeb6d396bab2c5..d252d98218d084e9782d899d4f854c0bf7101622 100644 (file)
@@ -644,6 +644,16 @@ err_create_module_files:
        kfree(fw_modules);
 }
 
+/**
+ * ice_debugfs_pf_deinit - cleanup PF's debugfs
+ * @pf: pointer to the PF struct
+ */
+void ice_debugfs_pf_deinit(struct ice_pf *pf)
+{
+       debugfs_remove_recursive(pf->ice_debugfs_pf);
+       pf->ice_debugfs_pf = NULL;
+}
+
 /**
  * ice_debugfs_init - create root directory for debugfs entries
  */
index 92b5dac481cdec61d9c175b6d156638034b637c4..4fd15387a7e5b5a1acc7b02265296c9da8a19ddf 100644 (file)
@@ -188,6 +188,8 @@ void ice_fwlog_deinit(struct ice_hw *hw)
        if (hw->bus.func)
                return;
 
+       ice_debugfs_pf_deinit(hw->back);
+
        /* make sure FW logging is disabled to not put the FW in a weird state
         * for the next driver load
         */
index 85a996ad2c1fccf2422442ea7ce9ca37af24b9d6..9c2c8637b4a7951bffbb6246cfc99517ad1ac266 100644 (file)
@@ -5276,8 +5276,6 @@ static void ice_remove(struct pci_dev *pdev)
                msleep(100);
        }
 
-       ice_debugfs_exit();
-
        if (test_bit(ICE_FLAG_SRIOV_ENA, pf->flags)) {
                set_bit(ICE_VF_RESETS_DISABLED, pf->state);
                ice_free_vfs(pf);
@@ -5783,6 +5781,7 @@ module_init(ice_module_init);
 static void __exit ice_module_exit(void)
 {
        pci_unregister_driver(&ice_driver);
+       ice_debugfs_exit();
        destroy_workqueue(ice_wq);
        destroy_workqueue(ice_lag_wq);
        pr_info("module unloaded\n");