Patch "net: hns3: fix a deadlock problem when config TC during resetting" has been added to the 5.10-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

    net: hns3: fix a deadlock problem when config TC during resetting

to the 5.10-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:
     net-hns3-fix-a-deadlock-problem-when-config-tc-durin.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 691bcd5288dcae39d44447e16a7393adb9e27846
Author: Jie Wang <wangjie125@xxxxxxxxxx>
Date:   Tue Aug 13 22:10:22 2024 +0800

    net: hns3: fix a deadlock problem when config TC during resetting
    
    [ Upstream commit be5e816d00a506719e9dbb1a9c861c5ced30a109 ]
    
    When config TC during the reset process, may cause a deadlock, the flow is
    as below:
                                 pf reset start
                                     │
                                     ▼
                                  ......
    setup tc                         │
        │                            ▼
        ▼                      DOWN: napi_disable()
    napi_disable()(skip)             │
        │                            │
        ▼                            ▼
      ......                      ......
        │                            │
        ▼                            │
    napi_enable()                    │
                                     ▼
                               UINIT: netif_napi_del()
                                     │
                                     ▼
                                  ......
                                     │
                                     ▼
                               INIT: netif_napi_add()
                                     │
                                     ▼
                                  ......                 global reset start
                                     │                      │
                                     ▼                      ▼
                               UP: napi_enable()(skip)    ......
                                     │                      │
                                     ▼                      ▼
                                  ......                 napi_disable()
    
    In reset process, the driver will DOWN the port and then UINIT, in this
    case, the setup tc process will UP the port before UINIT, so cause the
    problem. Adds a DOWN process in UINIT to fix it.
    
    Fixes: bb6b94a896d4 ("net: hns3: Add reset interface implementation in client")
    Signed-off-by: Jie Wang <wangjie125@xxxxxxxxxx>
    Signed-off-by: Jijie Shao <shaojijie@xxxxxxxxxx>
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index f8275534205a7..9ff5179b4d879 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -4536,6 +4536,9 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
 	struct hns3_nic_priv *priv = netdev_priv(netdev);
 	int ret;
 
+	if (!test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
+		hns3_nic_net_stop(netdev);
+
 	if (!test_and_clear_bit(HNS3_NIC_STATE_INITED, &priv->state)) {
 		netdev_warn(netdev, "already uninitialized\n");
 		return 0;




[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