Patch "ice: Avoid RTNL lock when re-creating auxiliary device" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ice: Avoid RTNL lock when re-creating auxiliary device

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ice-avoid-rtnl-lock-when-re-creating-auxiliary-devic.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit dcabe6cf1e713e3aade7d021d406a11dd7e3efa3
Author: Dave Ertman <david.m.ertman@xxxxxxxxx>
Date:   Thu Jan 20 16:27:56 2022 -0800

    ice: Avoid RTNL lock when re-creating auxiliary device
    
    [ Upstream commit 5dbbbd01cbba831233c6ea9a3e6bfa133606d3c0 ]
    
    If a call to re-create the auxiliary device happens in a context that has
    already taken the RTNL lock, then the call flow that recreates auxiliary
    device can hang if there is another attempt to claim the RTNL lock by the
    auxiliary driver.
    
    To avoid this, any call to re-create auxiliary devices that comes from
    an source that is holding the RTNL lock (e.g. netdev notifier when
    interface exits a bond) should execute in a separate thread.  To
    accomplish this, add a flag to the PF that will be evaluated in the
    service task and dealt with there.
    
    Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA")
    Signed-off-by: Dave Ertman <david.m.ertman@xxxxxxxxx>
    Reviewed-by: Jonathan Toppins <jtoppins@xxxxxxxxxx>
    Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index fba8f021c397d..d119812755b7a 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -398,6 +398,7 @@ enum ice_pf_flags {
 	ICE_FLAG_VF_TRUE_PROMISC_ENA,
 	ICE_FLAG_MDD_AUTO_RESET_VF,
 	ICE_FLAG_LINK_LENIENT_MODE_ENA,
+	ICE_FLAG_PLUG_AUX_DEV,
 	ICE_PF_FLAGS_NBITS		/* must be last */
 };
 
@@ -692,7 +693,7 @@ static inline void ice_set_rdma_cap(struct ice_pf *pf)
 	if (pf->hw.func_caps.common_cap.rdma && pf->num_rdma_msix) {
 		set_bit(ICE_FLAG_RDMA_ENA, pf->flags);
 		set_bit(ICE_FLAG_AUX_ENA, pf->flags);
-		ice_plug_aux_dev(pf);
+		set_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags);
 	}
 }
 
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index cfddec96c91c1..ab2dea0d2c1ae 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2141,6 +2141,9 @@ static void ice_service_task(struct work_struct *work)
 		return;
 	}
 
+	if (test_and_clear_bit(ICE_FLAG_PLUG_AUX_DEV, pf->flags))
+		ice_plug_aux_dev(pf);
+
 	ice_clean_adminq_subtask(pf);
 	ice_check_media_subtask(pf);
 	ice_check_for_hang_subtask(pf);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux