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

From: Jijie Shao
Date: Mon Mar 25 2024 - 11:30:34 EST



on 2024/3/19 19:17, Jiri Pirko wrote:
Mon, Mar 18, 2024 at 02:29:47PM CET, shaojijie@xxxxxxxxxx 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, if process the devlink reload during initialization, may lead to kernel
crash. This patch fixes this by checking whether the NIC is initialized.
Fix your locking, you should take devl_lock during your init. That would
disallow reload to race with it.

pw-bot: cr

Thanks,

We have fixed this in v4.

Jijie Shao