Re: [PATCH V4 net 2/3] net: hns3: fix kernel crash when devlink reload during pf initialization

From: Simon Horman
Date: Tue Mar 26 2024 - 07:22:53 EST


On Mon, Mar 25, 2024 at 08:43:10PM +0800, Jijie Shao wrote:
> From: Yonglong Liu <liuyonglong@xxxxxxxxxx>
>
> 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@xxxxxxxxxx>
> Signed-off-by: Jijie Shao <shaojijie@xxxxxxxxxx>

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>