Commit f0291103 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2023-07-21 (i40e, iavf)

This series contains updates to i40e and iavf drivers.

Wang Ming corrects an error check on i40e.

Jake unlocks crit_lock on allocation failure to prevent deadlock and
stops re-enabling of interrupts when it's not intended for iavf.

* '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue:
  iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED
  iavf: fix potential deadlock on allocation failure
  i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
====================

Link: https://lore.kernel.org/r/20230721155812.1292752-1-anthony.l.nguyen@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents ac2a7b13 91896c8a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1839,7 +1839,7 @@ void i40e_dbg_pf_exit(struct i40e_pf *pf)
void i40e_dbg_init(void)
{
	i40e_dbg_root = debugfs_create_dir(i40e_driver_name, NULL);
	if (!i40e_dbg_root)
	if (IS_ERR(i40e_dbg_root))
		pr_info("init of debugfs failed\n");
}

+6 −5
Original line number Diff line number Diff line
@@ -3250,9 +3250,6 @@ static void iavf_adminq_task(struct work_struct *work)
	u32 val, oldval;
	u16 pending;

	if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
		goto out;

	if (!mutex_trylock(&adapter->crit_lock)) {
		if (adapter->state == __IAVF_REMOVE)
			return;
@@ -3261,10 +3258,13 @@ static void iavf_adminq_task(struct work_struct *work)
		goto out;
	}

	if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED)
		goto unlock;

	event.buf_len = IAVF_MAX_AQ_BUF_SIZE;
	event.msg_buf = kzalloc(event.buf_len, GFP_KERNEL);
	if (!event.msg_buf)
		goto out;
		goto unlock;

	do {
		ret = iavf_clean_arq_element(hw, &event, &pending);
@@ -3279,7 +3279,6 @@ static void iavf_adminq_task(struct work_struct *work)
		if (pending != 0)
			memset(event.msg_buf, 0, IAVF_MAX_AQ_BUF_SIZE);
	} while (pending);
	mutex_unlock(&adapter->crit_lock);

	if (iavf_is_reset_in_progress(adapter))
		goto freedom;
@@ -3323,6 +3322,8 @@ static void iavf_adminq_task(struct work_struct *work)

freedom:
	kfree(event.msg_buf);
unlock:
	mutex_unlock(&adapter->crit_lock);
out:
	/* re-enable Admin queue interrupt cause */
	iavf_misc_irq_enable(adapter);