netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe)
@ 2025-02-24 19:06 Tony Nguyen
  2025-02-24 19:06 ` [PATCH net 1/5] ice: Fix deinitializing VF in error path Tony Nguyen
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Tony Nguyen @ 2025-02-24 19:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev; +Cc: Tony Nguyen

For ice:

Marcin moves incorrect call placement to clean up VF mailbox
tracking and changes call for configuring default VSI to allow
for existing rule.

For idpf:

Ahmed adds call to ensure IRQs are handled prior to cleanup.

For iavf:

Jake fixes a circular locking dependency.

For ixgbe:

Piotr corrects condition for determining media cage presence.

The following are changes since commit f15176b8b6e72ac30e14fd273282d2b72562d26b:
  net: dsa: rtl8366rb: Fix compilation problem
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE

Ahmed Zaki (1):
  idpf: synchronize pending IRQs after disable

Jacob Keller (1):
  iavf: fix circular lock dependency with netdev_lock

Marcin Szycik (2):
  ice: Fix deinitializing VF in error path
  ice: Avoid setting default Rx VSI twice in switchdev setup

Piotr Kwapulinski (1):
  ixgbe: fix media cage present detection for E610 device

 drivers/net/ethernet/intel/iavf/iavf_main.c         | 12 ++++++++----
 drivers/net/ethernet/intel/ice/ice_eswitch.c        |  3 +--
 drivers/net/ethernet/intel/ice/ice_sriov.c          |  5 +----
 drivers/net/ethernet/intel/ice/ice_vf_lib.c         |  8 ++++++++
 drivers/net/ethernet/intel/ice/ice_vf_lib_private.h |  1 +
 drivers/net/ethernet/intel/idpf/idpf_txrx.c         |  9 +++++++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c       |  2 +-
 7 files changed, 27 insertions(+), 13 deletions(-)

-- 
2.47.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH net 1/5] ice: Fix deinitializing VF in error path
  2025-02-24 19:06 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) Tony Nguyen
@ 2025-02-24 19:06 ` Tony Nguyen
  2025-02-24 19:06 ` [PATCH net 2/5] ice: Avoid setting default Rx VSI twice in switchdev setup Tony Nguyen
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Tony Nguyen @ 2025-02-24 19:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Marcin Szycik, anthony.l.nguyen, michal.swiatkowski,
	Sujai Buvaneswaran, Martyna Szapar-Mudlaw, Simon Horman

From: Marcin Szycik <marcin.szycik@linux.intel.com>

If ice_ena_vfs() fails after calling ice_create_vf_entries(), it frees
all VFs without removing them from snapshot PF-VF mailbox list, leading
to list corruption.

Reproducer:
  devlink dev eswitch set $PF1_PCI mode switchdev
  ip l s $PF1 up
  ip l s $PF1 promisc on
  sleep 1
  echo 1 > /sys/class/net/$PF1/device/sriov_numvfs
  sleep 1
  echo 1 > /sys/class/net/$PF1/device/sriov_numvfs

Trace (minimized):
  list_add corruption. next->prev should be prev (ffff8882e241c6f0), but was 0000000000000000. (next=ffff888455da1330).
  kernel BUG at lib/list_debug.c:29!
  RIP: 0010:__list_add_valid_or_report+0xa6/0x100
   ice_mbx_init_vf_info+0xa7/0x180 [ice]
   ice_initialize_vf_entry+0x1fa/0x250 [ice]
   ice_sriov_configure+0x8d7/0x1520 [ice]
   ? __percpu_ref_switch_mode+0x1b1/0x5d0
   ? __pfx_ice_sriov_configure+0x10/0x10 [ice]

Sometimes a KASAN report can be seen instead with a similar stack trace:
  BUG: KASAN: use-after-free in __list_add_valid_or_report+0xf1/0x100

VFs are added to this list in ice_mbx_init_vf_info(), but only removed
in ice_free_vfs(). Move the removing to ice_free_vf_entries(), which is
also being called in other places where VFs are being removed (including
ice_free_vfs() itself).

Fixes: 8cd8a6b17d27 ("ice: move VF overflow message count into struct ice_mbx_vf_info")
Reported-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Closes: https://lore.kernel.org/intel-wired-lan/PH0PR11MB50138B635F2E5CEB7075325D961F2@PH0PR11MB5013.namprd11.prod.outlook.com
Reviewed-by: Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@linux.intel.com>
Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_sriov.c          | 5 +----
 drivers/net/ethernet/intel/ice/ice_vf_lib.c         | 8 ++++++++
 drivers/net/ethernet/intel/ice/ice_vf_lib_private.h | 1 +
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c
index b83f99c01d91..8aabf7749aa5 100644
--- a/drivers/net/ethernet/intel/ice/ice_sriov.c
+++ b/drivers/net/ethernet/intel/ice/ice_sriov.c
@@ -36,6 +36,7 @@ static void ice_free_vf_entries(struct ice_pf *pf)
 
 	hash_for_each_safe(vfs->table, bkt, tmp, vf, entry) {
 		hash_del_rcu(&vf->entry);
+		ice_deinitialize_vf_entry(vf);
 		ice_put_vf(vf);
 	}
 }
@@ -193,10 +194,6 @@ void ice_free_vfs(struct ice_pf *pf)
 			wr32(hw, GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
 		}
 
-		/* clear malicious info since the VF is getting released */
-		if (!ice_is_feature_supported(pf, ICE_F_MBX_LIMIT))
-			list_del(&vf->mbx_info.list_entry);
-
 		mutex_unlock(&vf->cfg_lock);
 	}
 
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
index c7c0c2f50c26..815ad0bfe832 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c
@@ -1036,6 +1036,14 @@ void ice_initialize_vf_entry(struct ice_vf *vf)
 	mutex_init(&vf->cfg_lock);
 }
 
+void ice_deinitialize_vf_entry(struct ice_vf *vf)
+{
+	struct ice_pf *pf = vf->pf;
+
+	if (!ice_is_feature_supported(pf, ICE_F_MBX_LIMIT))
+		list_del(&vf->mbx_info.list_entry);
+}
+
 /**
  * ice_dis_vf_qs - Disable the VF queues
  * @vf: pointer to the VF structure
diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib_private.h b/drivers/net/ethernet/intel/ice/ice_vf_lib_private.h
index 0c7e77c0a09f..5392b0404986 100644
--- a/drivers/net/ethernet/intel/ice/ice_vf_lib_private.h
+++ b/drivers/net/ethernet/intel/ice/ice_vf_lib_private.h
@@ -24,6 +24,7 @@
 #endif
 
 void ice_initialize_vf_entry(struct ice_vf *vf);
+void ice_deinitialize_vf_entry(struct ice_vf *vf);
 void ice_dis_vf_qs(struct ice_vf *vf);
 int ice_check_vf_init(struct ice_vf *vf);
 enum virtchnl_status_code ice_err_to_virt_err(int err);
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net 2/5] ice: Avoid setting default Rx VSI twice in switchdev setup
  2025-02-24 19:06 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) Tony Nguyen
  2025-02-24 19:06 ` [PATCH net 1/5] ice: Fix deinitializing VF in error path Tony Nguyen
@ 2025-02-24 19:06 ` Tony Nguyen
  2025-02-24 19:06 ` [PATCH net 3/5] idpf: synchronize pending IRQs after disable Tony Nguyen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Tony Nguyen @ 2025-02-24 19:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Marcin Szycik, anthony.l.nguyen, michal.swiatkowski,
	Sujai Buvaneswaran, Martyna Szapar-Mudlaw, Simon Horman

From: Marcin Szycik <marcin.szycik@linux.intel.com>

As part of switchdev environment setup, uplink VSI is configured as
default for both Tx and Rx. Default Rx VSI is also used by promiscuous
mode. If promisc mode is enabled and an attempt to enter switchdev mode
is made, the setup will fail because Rx VSI is already configured as
default (rule exists).

Reproducer:
  devlink dev eswitch set $PF1_PCI mode switchdev
  ip l s $PF1 up
  ip l s $PF1 promisc on
  echo 1 > /sys/class/net/$PF1/device/sriov_numvfs

In switchdev setup, use ice_set_dflt_vsi() instead of plain
ice_cfg_dflt_vsi(), which avoids repeating setting default VSI for Rx if
it's already configured.

Fixes: 50d62022f455 ("ice: default Tx rule instead of to queue")
Reported-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Closes: https://lore.kernel.org/intel-wired-lan/PH0PR11MB50138B635F2E5CEB7075325D961F2@PH0PR11MB5013.namprd11.prod.outlook.com
Reviewed-by: Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@linux.intel.com>
Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_eswitch.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_eswitch.c b/drivers/net/ethernet/intel/ice/ice_eswitch.c
index fb527434b58b..d649c197cf67 100644
--- a/drivers/net/ethernet/intel/ice/ice_eswitch.c
+++ b/drivers/net/ethernet/intel/ice/ice_eswitch.c
@@ -38,8 +38,7 @@ static int ice_eswitch_setup_env(struct ice_pf *pf)
 	if (ice_vsi_add_vlan_zero(uplink_vsi))
 		goto err_vlan_zero;
 
-	if (ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, true,
-			     ICE_FLTR_RX))
+	if (ice_set_dflt_vsi(uplink_vsi))
 		goto err_def_rx;
 
 	if (ice_cfg_dflt_vsi(uplink_vsi->port_info, uplink_vsi->idx, true,
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net 3/5] idpf: synchronize pending IRQs after disable
  2025-02-24 19:06 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) Tony Nguyen
  2025-02-24 19:06 ` [PATCH net 1/5] ice: Fix deinitializing VF in error path Tony Nguyen
  2025-02-24 19:06 ` [PATCH net 2/5] ice: Avoid setting default Rx VSI twice in switchdev setup Tony Nguyen
@ 2025-02-24 19:06 ` Tony Nguyen
  2025-02-26  2:38   ` Jakub Kicinski
  2025-02-24 19:06 ` [PATCH net 4/5] iavf: fix circular lock dependency with netdev_lock Tony Nguyen
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Tony Nguyen @ 2025-02-24 19:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Ahmed Zaki, anthony.l.nguyen, willemb, Madhu Chittim,
	Simon Horman, Samuel Salin

From: Ahmed Zaki <ahmed.zaki@intel.com>

Wait for pending IRQ handler after it is disabled. This will ensure the IRQ
is cleanly freed afterwards.

Fixes: d4d558718266 ("idpf: initialize interrupts and enable vport")
Reviewed-by: Madhu Chittim <madhu.chittim@intel.com>
Suggested-by: Sudheer Mogilappagari <sudheer.mogilappagari@intel.com>
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/idpf/idpf_txrx.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index 9be6a6b59c4e..8006bd9a95f6 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -3592,10 +3592,15 @@ static void idpf_vport_intr_rel_irq(struct idpf_vport *vport)
 static void idpf_vport_intr_dis_irq_all(struct idpf_vport *vport)
 {
 	struct idpf_q_vector *q_vector = vport->q_vectors;
-	int q_idx;
+	int q_idx, vidx, irq_num;
+
+	for (q_idx = 0; q_idx < vport->num_q_vectors; q_idx++) {
+		vidx = vport->q_vector_idxs[q_idx];
+		irq_num = vport->adapter->msix_entries[vidx].vector;
 
-	for (q_idx = 0; q_idx < vport->num_q_vectors; q_idx++)
 		writel(0, q_vector[q_idx].intr_reg.dyn_ctl);
+		synchronize_irq(irq_num);
+	}
 }
 
 /**
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net 4/5] iavf: fix circular lock dependency with netdev_lock
  2025-02-24 19:06 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) Tony Nguyen
                   ` (2 preceding siblings ...)
  2025-02-24 19:06 ` [PATCH net 3/5] idpf: synchronize pending IRQs after disable Tony Nguyen
@ 2025-02-24 19:06 ` Tony Nguyen
  2025-02-24 19:06 ` [PATCH net 5/5] ixgbe: fix media cage present detection for E610 device Tony Nguyen
  2025-02-26  3:20 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) patchwork-bot+netdevbpf
  5 siblings, 0 replies; 9+ messages in thread
From: Tony Nguyen @ 2025-02-24 19:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Jacob Keller, anthony.l.nguyen, przemyslaw.kitszel,
	Rafal Romanowski

From: Jacob Keller <jacob.e.keller@intel.com>

We have recently seen reports of lockdep circular lock dependency warnings
when loading the iAVF driver:

[ 1504.790308] ======================================================
[ 1504.790309] WARNING: possible circular locking dependency detected
[ 1504.790310] 6.13.0 #net_next_rt.c2933b2befe2.el9 Not tainted
[ 1504.790311] ------------------------------------------------------
[ 1504.790312] kworker/u128:0/13566 is trying to acquire lock:
[ 1504.790313] ffff97d0e4738f18 (&dev->lock){+.+.}-{4:4}, at: register_netdevice+0x52c/0x710
[ 1504.790320]
[ 1504.790320] but task is already holding lock:
[ 1504.790321] ffff97d0e47392e8 (&adapter->crit_lock){+.+.}-{4:4}, at: iavf_finish_config+0x37/0x240 [iavf]
[ 1504.790330]
[ 1504.790330] which lock already depends on the new lock.
[ 1504.790330]
[ 1504.790330]
[ 1504.790330] the existing dependency chain (in reverse order) is:
[ 1504.790331]
[ 1504.790331] -> #1 (&adapter->crit_lock){+.+.}-{4:4}:
[ 1504.790333]        __lock_acquire+0x52d/0xbb0
[ 1504.790337]        lock_acquire+0xd9/0x330
[ 1504.790338]        mutex_lock_nested+0x4b/0xb0
[ 1504.790341]        iavf_finish_config+0x37/0x240 [iavf]
[ 1504.790347]        process_one_work+0x248/0x6d0
[ 1504.790350]        worker_thread+0x18d/0x330
[ 1504.790352]        kthread+0x10e/0x250
[ 1504.790354]        ret_from_fork+0x30/0x50
[ 1504.790357]        ret_from_fork_asm+0x1a/0x30
[ 1504.790361]
[ 1504.790361] -> #0 (&dev->lock){+.+.}-{4:4}:
[ 1504.790364]        check_prev_add+0xf1/0xce0
[ 1504.790366]        validate_chain+0x46a/0x570
[ 1504.790368]        __lock_acquire+0x52d/0xbb0
[ 1504.790370]        lock_acquire+0xd9/0x330
[ 1504.790371]        mutex_lock_nested+0x4b/0xb0
[ 1504.790372]        register_netdevice+0x52c/0x710
[ 1504.790374]        iavf_finish_config+0xfa/0x240 [iavf]
[ 1504.790379]        process_one_work+0x248/0x6d0
[ 1504.790381]        worker_thread+0x18d/0x330
[ 1504.790383]        kthread+0x10e/0x250
[ 1504.790385]        ret_from_fork+0x30/0x50
[ 1504.790387]        ret_from_fork_asm+0x1a/0x30
[ 1504.790389]
[ 1504.790389] other info that might help us debug this:
[ 1504.790389]
[ 1504.790389]  Possible unsafe locking scenario:
[ 1504.790389]
[ 1504.790390]        CPU0                    CPU1
[ 1504.790391]        ----                    ----
[ 1504.790391]   lock(&adapter->crit_lock);
[ 1504.790393]                                lock(&dev->lock);
[ 1504.790394]                                lock(&adapter->crit_lock);
[ 1504.790395]   lock(&dev->lock);
[ 1504.790397]
[ 1504.790397]  *** DEADLOCK ***

This appears to be caused by the change in commit 5fda3f35349b ("net: make
netdev_lock() protect netdev->reg_state"), which added a netdev_lock() in
register_netdevice.

The iAVF driver calls register_netdevice() from iavf_finish_config(), as a
final stage of its state machine post-probe. It currently takes the RTNL
lock, then the netdev lock, and then the device critical lock. This pattern
is used throughout the driver. Thus there is a strong dependency that the
crit_lock should not be acquired before the net device lock. The change to
register_netdevice creates an ABBA lock order violation because the iAVF
driver is holding the crit_lock while calling register_netdevice, which
then takes the netdev_lock.

It seems likely that future refactors could result in netdev APIs which
hold the netdev_lock while calling into the driver. This means that we
should not re-order the locks so that netdev_lock is acquired after the
device private crit_lock.

Instead, notice that we already release the netdev_lock prior to calling
the register_netdevice. This flow only happens during the early driver
initialization as we transition through the __IAVF_STARTUP,
__IAVF_INIT_VERSION_CHECK, __IAVF_INIT_GET_RESOURCES, etc.

Analyzing the places where we take crit_lock in the driver there are two
sources:

a) several of the work queue tasks including adminq_task, watchdog_task,
reset_task, and the finish_config task.

b) various callbacks which ultimately stem back to .ndo operations or
ethtool operations.

The latter cannot be triggered until after the netdevice registration is
completed successfully.

The iAVF driver uses alloc_ordered_workqueue, which is an unbound workqueue
that has a max limit of 1, and thus guarantees that only a single work item
on the queue is executing at any given time, so none of the other work
threads could be executing due to the ordered workqueue guarantees.

The iavf_finish_config() function also does not do anything else after
register_netdevice, unless it fails. It seems unlikely that the driver
private crit_lock is protecting anything that register_netdevice() itself
touches.

Thus, to fix this ABBA lock violation, lets simply release the
adapter->crit_lock as well as netdev_lock prior to calling
register_netdevice(). We do still keep holding the RTNL lock as required by
the function. If we do fail to register the netdevice, then we re-acquire
the adapter critical lock to finish the transition back to
__IAVF_INIT_CONFIG_ADAPTER.

This ensures every call where both netdev_lock and the adapter->crit_lock
are acquired under the same ordering.

Fixes: afc664987ab3 ("eth: iavf: extend the netdev_lock usage")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 852e5b62f0a5..6faa62bced3a 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -1983,7 +1983,7 @@ static int iavf_reinit_interrupt_scheme(struct iavf_adapter *adapter, bool runni
 static void iavf_finish_config(struct work_struct *work)
 {
 	struct iavf_adapter *adapter;
-	bool netdev_released = false;
+	bool locks_released = false;
 	int pairs, err;
 
 	adapter = container_of(work, struct iavf_adapter, finish_config);
@@ -2012,19 +2012,22 @@ static void iavf_finish_config(struct work_struct *work)
 		netif_set_real_num_tx_queues(adapter->netdev, pairs);
 
 		if (adapter->netdev->reg_state != NETREG_REGISTERED) {
+			mutex_unlock(&adapter->crit_lock);
 			netdev_unlock(adapter->netdev);
-			netdev_released = true;
+			locks_released = true;
 			err = register_netdevice(adapter->netdev);
 			if (err) {
 				dev_err(&adapter->pdev->dev, "Unable to register netdev (%d)\n",
 					err);
 
 				/* go back and try again.*/
+				mutex_lock(&adapter->crit_lock);
 				iavf_free_rss(adapter);
 				iavf_free_misc_irq(adapter);
 				iavf_reset_interrupt_capability(adapter);
 				iavf_change_state(adapter,
 						  __IAVF_INIT_CONFIG_ADAPTER);
+				mutex_unlock(&adapter->crit_lock);
 				goto out;
 			}
 		}
@@ -2040,9 +2043,10 @@ static void iavf_finish_config(struct work_struct *work)
 	}
 
 out:
-	mutex_unlock(&adapter->crit_lock);
-	if (!netdev_released)
+	if (!locks_released) {
+		mutex_unlock(&adapter->crit_lock);
 		netdev_unlock(adapter->netdev);
+	}
 	rtnl_unlock();
 }
 
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH net 5/5] ixgbe: fix media cage present detection for E610 device
  2025-02-24 19:06 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) Tony Nguyen
                   ` (3 preceding siblings ...)
  2025-02-24 19:06 ` [PATCH net 4/5] iavf: fix circular lock dependency with netdev_lock Tony Nguyen
@ 2025-02-24 19:06 ` Tony Nguyen
  2025-02-26  3:20 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) patchwork-bot+netdevbpf
  5 siblings, 0 replies; 9+ messages in thread
From: Tony Nguyen @ 2025-02-24 19:06 UTC (permalink / raw)
  To: davem, kuba, pabeni, edumazet, andrew+netdev, netdev
  Cc: Piotr Kwapulinski, anthony.l.nguyen, Dan Carpenter,
	Michal Swiatkowski, Przemek Kitszel, Simon Horman, Bharath R

From: Piotr Kwapulinski <piotr.kwapulinski@intel.com>

The commit 23c0e5a16bcc ("ixgbe: Add link management support for E610
device") introduced incorrect checking of media cage presence for E610
device. Fix it.

Fixes: 23c0e5a16bcc ("ixgbe: Add link management support for E610 device")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/e7d73b32-f12a-49d1-8b60-1ef83359ec13@stanley.mountain/
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Bharath R <bharath.r@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
index 683c668672d6..cb07ecd8937d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c
@@ -1122,7 +1122,7 @@ static bool ixgbe_is_media_cage_present(struct ixgbe_hw *hw)
 	 * returns error (ENOENT), then no cage present. If no cage present then
 	 * connection type is backplane or BASE-T.
 	 */
-	return ixgbe_aci_get_netlist_node(hw, cmd, NULL, NULL);
+	return !ixgbe_aci_get_netlist_node(hw, cmd, NULL, NULL);
 }
 
 /**
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH net 3/5] idpf: synchronize pending IRQs after disable
  2025-02-24 19:06 ` [PATCH net 3/5] idpf: synchronize pending IRQs after disable Tony Nguyen
@ 2025-02-26  2:38   ` Jakub Kicinski
  2025-02-26 18:16     ` Tony Nguyen
  0 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2025-02-26  2:38 UTC (permalink / raw)
  To: Tony Nguyen
  Cc: davem, pabeni, edumazet, andrew+netdev, netdev, Ahmed Zaki,
	willemb, Madhu Chittim, Simon Horman, Samuel Salin

On Mon, 24 Feb 2025 11:06:43 -0800 Tony Nguyen wrote:
> From: Ahmed Zaki <ahmed.zaki@intel.com>
> 
> Wait for pending IRQ handler after it is disabled. This will ensure the IRQ
> is cleanly freed afterwards.

No real explanation of the race in the commit message, no comment 
in the code. More info needed here.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe)
  2025-02-24 19:06 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) Tony Nguyen
                   ` (4 preceding siblings ...)
  2025-02-24 19:06 ` [PATCH net 5/5] ixgbe: fix media cage present detection for E610 device Tony Nguyen
@ 2025-02-26  3:20 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-02-26  3:20 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, pabeni, edumazet, andrew+netdev, netdev

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 24 Feb 2025 11:06:40 -0800 you wrote:
> For ice:
> 
> Marcin moves incorrect call placement to clean up VF mailbox
> tracking and changes call for configuring default VSI to allow
> for existing rule.
> 
> For idpf:
> 
> [...]

Here is the summary with links:
  - [net,1/5] ice: Fix deinitializing VF in error path
    https://git.kernel.org/netdev/net/c/79990cf5e7ad
  - [net,2/5] ice: Avoid setting default Rx VSI twice in switchdev setup
    https://git.kernel.org/netdev/net/c/5c07be96d8b3
  - [net,3/5] idpf: synchronize pending IRQs after disable
    (no matching commit)
  - [net,4/5] iavf: fix circular lock dependency with netdev_lock
    (no matching commit)
  - [net,5/5] ixgbe: fix media cage present detection for E610 device
    https://git.kernel.org/netdev/net/c/b1e44b4aecb5

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net 3/5] idpf: synchronize pending IRQs after disable
  2025-02-26  2:38   ` Jakub Kicinski
@ 2025-02-26 18:16     ` Tony Nguyen
  0 siblings, 0 replies; 9+ messages in thread
From: Tony Nguyen @ 2025-02-26 18:16 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: davem, pabeni, edumazet, andrew+netdev, netdev, Ahmed Zaki,
	willemb, Madhu Chittim, Simon Horman, Samuel Salin

On 2/25/2025 6:38 PM, Jakub Kicinski wrote:
> On Mon, 24 Feb 2025 11:06:43 -0800 Tony Nguyen wrote:
>> From: Ahmed Zaki <ahmed.zaki@intel.com>
>>
>> Wait for pending IRQ handler after it is disabled. This will ensure the IRQ
>> is cleanly freed afterwards.
> 
> No real explanation of the race in the commit message, no comment
> in the code. More info needed here.

We'll rework this. I saw the other patches in the series were taken so 
will resubmit this appropriately.

Thanks,
Tony

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-02-26 18:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-24 19:06 [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) Tony Nguyen
2025-02-24 19:06 ` [PATCH net 1/5] ice: Fix deinitializing VF in error path Tony Nguyen
2025-02-24 19:06 ` [PATCH net 2/5] ice: Avoid setting default Rx VSI twice in switchdev setup Tony Nguyen
2025-02-24 19:06 ` [PATCH net 3/5] idpf: synchronize pending IRQs after disable Tony Nguyen
2025-02-26  2:38   ` Jakub Kicinski
2025-02-26 18:16     ` Tony Nguyen
2025-02-24 19:06 ` [PATCH net 4/5] iavf: fix circular lock dependency with netdev_lock Tony Nguyen
2025-02-24 19:06 ` [PATCH net 5/5] ixgbe: fix media cage present detection for E610 device Tony Nguyen
2025-02-26  3:20 ` [PATCH net 0/5][pull request] Intel Wired LAN Driver Updates 2025-02-24 (ice, idpf, iavf, ixgbe) patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).