mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
net: hns3: Reset net device with rtnl_lock
Since current locking was not covering certain code where netdev was being accessed or manipulated, this patch fixes it. Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1b3725781a
commit
6d4fab3953
@ -2820,15 +2820,13 @@ static void hclge_clear_reset_cause(struct hclge_dev *hdev)
|
|||||||
static void hclge_reset(struct hclge_dev *hdev)
|
static void hclge_reset(struct hclge_dev *hdev)
|
||||||
{
|
{
|
||||||
/* perform reset of the stack & ae device for a client */
|
/* perform reset of the stack & ae device for a client */
|
||||||
|
rtnl_lock();
|
||||||
hclge_notify_client(hdev, HNAE3_DOWN_CLIENT);
|
hclge_notify_client(hdev, HNAE3_DOWN_CLIENT);
|
||||||
|
|
||||||
if (!hclge_reset_wait(hdev)) {
|
if (!hclge_reset_wait(hdev)) {
|
||||||
rtnl_lock();
|
|
||||||
hclge_notify_client(hdev, HNAE3_UNINIT_CLIENT);
|
hclge_notify_client(hdev, HNAE3_UNINIT_CLIENT);
|
||||||
hclge_reset_ae_dev(hdev->ae_dev);
|
hclge_reset_ae_dev(hdev->ae_dev);
|
||||||
hclge_notify_client(hdev, HNAE3_INIT_CLIENT);
|
hclge_notify_client(hdev, HNAE3_INIT_CLIENT);
|
||||||
rtnl_unlock();
|
|
||||||
|
|
||||||
hclge_clear_reset_cause(hdev);
|
hclge_clear_reset_cause(hdev);
|
||||||
} else {
|
} else {
|
||||||
@ -2838,6 +2836,7 @@ static void hclge_reset(struct hclge_dev *hdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
hclge_notify_client(hdev, HNAE3_UP_CLIENT);
|
hclge_notify_client(hdev, HNAE3_UP_CLIENT);
|
||||||
|
rtnl_unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hclge_reset_event(struct hnae3_handle *handle)
|
static void hclge_reset_event(struct hnae3_handle *handle)
|
||||||
|
Loading…
Reference in New Issue
Block a user