From: Michal Swiatkowski Date: Tue, 12 Aug 2025 04:23:29 +0000 (+0200) Subject: ice: check for PF number outside the fwlog code X-Git-Tag: v6.18-rc1~132^2~177^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=360c46582e88acf57c935e76015f9fc894ab6599;p=thirdparty%2Flinux.git ice: check for PF number outside the fwlog code Fwlog can be supported only on PF 0. Check this before calling init/deinit functions. Reviewed-by: Przemek Kitszel Signed-off-by: Michal Swiatkowski Tested-by: Rinitha S (A Contingent worker at Intel) Reviewed-by: Aleksandr Loktionov Reviewed-by: Simon Horman Signed-off-by: Tony Nguyen --- diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 16765c2da4bd4..e73585d90eaad 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1002,6 +1002,10 @@ static int __fwlog_init(struct ice_hw *hw) }; int err; + /* only support fw log commands on PF 0 */ + if (hw->bus.func) + return -EINVAL; + err = ice_debugfs_pf_init(pf); if (err) return err; @@ -1186,6 +1190,10 @@ err_unroll_cqinit: static void __fwlog_deinit(struct ice_hw *hw) { + /* only support fw log commands on PF 0 */ + if (hw->bus.func) + return; + ice_debugfs_pf_deinit(hw->back); ice_fwlog_deinit(hw, &hw->fwlog); } diff --git a/drivers/net/ethernet/intel/ice/ice_debugfs.c b/drivers/net/ethernet/intel/ice/ice_debugfs.c index b9849d1ef9288..ca1e74082d579 100644 --- a/drivers/net/ethernet/intel/ice/ice_debugfs.c +++ b/drivers/net/ethernet/intel/ice/ice_debugfs.c @@ -588,10 +588,6 @@ void ice_debugfs_fwlog_init(struct ice_pf *pf) struct dentry **fw_modules; int i; - /* only support fw log commands on PF 0 */ - if (pf->hw.bus.func) - return; - /* allocate space for this first because if it fails then we don't * need to unwind */ diff --git a/drivers/net/ethernet/intel/ice/ice_fwlog.c b/drivers/net/ethernet/intel/ice/ice_fwlog.c index f7dbcb5e11aaa..2ed631e933b21 100644 --- a/drivers/net/ethernet/intel/ice/ice_fwlog.c +++ b/drivers/net/ethernet/intel/ice/ice_fwlog.c @@ -242,10 +242,6 @@ static void ice_fwlog_set_supported(struct ice_fwlog *fwlog) int ice_fwlog_init(struct ice_hw *hw, struct ice_fwlog *fwlog, struct ice_fwlog_api *api) { - /* only support fw log commands on PF 0 */ - if (hw->bus.func) - return -EINVAL; - fwlog->api = *api; ice_fwlog_set_supported(fwlog); @@ -296,10 +292,6 @@ void ice_fwlog_deinit(struct ice_hw *hw, struct ice_fwlog *fwlog) struct ice_pf *pf = hw->back; int status; - /* only support fw log commands on PF 0 */ - if (hw->bus.func) - return; - /* make sure FW logging is disabled to not put the FW in a weird state * for the next driver load */