Skip to content

Commit

Permalink
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/tnguy/net-queue

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/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jul 25, 2023
2 parents ac2a7b1 + 91896c8 commit f029110
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/i40e/i40e_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

Expand Down
11 changes: 6 additions & 5 deletions drivers/net/ethernet/intel/iavf/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f029110

Please sign in to comment.