Skip to content

Commit 2d2d574

Browse files
Anshumali Gaurkuba-moo
authored andcommitted
octeontx2-af: Fix PF driver crash with kexec kernel booting
During a kexec reboot the hardware is not power-cycled, so AF state from the old kernel can persist into the new kernel. When AF and PF drivers are built as modules, the PF driver may probe before AF reinitializes the hardware. The PF driver treats the RVUM block revision as an indication that AF initialization is complete. If this value is left uncleared at shutdown, PF may incorrectly assume AF is ready and access stale hardware state, leading to a crash. Clear the RVUM block revision during AF shutdown to avoid PF mis-detecting AF readiness after kexec. Fixes: 54494aa ("octeontx2-af: Add Marvell OcteonTX2 RVU AF driver") Signed-off-by: Anshumali Gaur <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8fdb05d commit 2d2d574

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

  • drivers/net/ethernet/marvell/octeontx2/af

drivers/net/ethernet/marvell/octeontx2/af/rvu.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3632,11 +3632,22 @@ static void rvu_remove(struct pci_dev *pdev)
36323632
devm_kfree(&pdev->dev, rvu);
36333633
}
36343634

3635+
static void rvu_shutdown(struct pci_dev *pdev)
3636+
{
3637+
struct rvu *rvu = pci_get_drvdata(pdev);
3638+
3639+
if (!rvu)
3640+
return;
3641+
3642+
rvu_clear_rvum_blk_revid(rvu);
3643+
}
3644+
36353645
static struct pci_driver rvu_driver = {
36363646
.name = DRV_NAME,
36373647
.id_table = rvu_id_table,
36383648
.probe = rvu_probe,
36393649
.remove = rvu_remove,
3650+
.shutdown = rvu_shutdown,
36403651
};
36413652

36423653
static int __init rvu_init_module(void)

0 commit comments

Comments
 (0)