]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: hns3: fix kernel crash when devlink reload during pf initialization
authorYonglong Liu <liuyonglong@huawei.com>
Mon, 25 Mar 2024 12:43:10 +0000 (20:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:43 +0000 (16:35 +0200)
commit1b550dae55901c2cc9075d6a7155a71b4f516e86
treee9307cfa223ae6af14f4444d1b5f232c3fb56b57
parentb033da1461c1dd5a3a1ef868b2680cfe06331b0d
net: hns3: fix kernel crash when devlink reload during pf initialization

[ Upstream commit 93305b77ffcb042f1538ecc383505e87d95aa05a ]

The devlink reload process will access the hardware resources,
but the register operation is done before the hardware is initialized.
So, processing the devlink reload during initialization may lead to kernel
crash. This patch fixes this by taking devl_lock during initialization.

Fixes: b741269b2759 ("net: hns3: add support for registering devlink for PF")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c