Commit 360c4658 authored by Michal Swiatkowski's avatar Michal Swiatkowski Committed by Tony Nguyen
Browse files

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: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: default avatarMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Reviewed-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent dc898f7e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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 @@ int ice_init_hw(struct ice_hw *hw)

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);
}
+0 −4
Original line number Diff line number Diff line
@@ -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
	 */
+0 −8
Original line number Diff line number Diff line
@@ -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
	 */