diff options
| author | Sai Krishna <saikrishnag@marvell.com> | 2026-08-21 15:53:37 +0530 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-08-24 12:07:13 -0700 |
| commit | 3b11a77f69980932c3924054d66e565c9a135747 (patch) | |
| tree | cbcbe1e278a3e64e3f984b7f515793f3db517c62 /tools/perf/scripts/python | |
| parent | b09a0503c755b6609fad59a84cc7f05b6843a03c (diff) | |
| download | linux-3b11a77f69980932c3924054d66e565c9a135747.tar.gz linux-3b11a77f69980932c3924054d66e565c9a135747.zip | |
octeontx2-af: fix cn20k mailbox lifetime on repeated rvu_mbox_init()
rvu_mbox_init() is called separately for AF-PF mailboxes during probe
and for AF-VF mailboxes when SR-IOV is enabled. Each call used to
allocate a new ng_rvu object, leaking the first allocation when the
pointer was overwritten on the second call.
Sharing one ng_rvu across both paths exposed several teardown bugs:
the error path freed all cn20k mailbox DMA and kfree()d ng_rvu even
when only the failing init type should be unwound, leaving live AF-PF
mailbox memory in use after an AF-VF init failure. mutex_init() was
also re-run on the AF-VF path while AF-PF mailbox handlers could still
hold rvu->mbox_lock. Probe and SR-IOV failure paths did not release
cn20k mailbox DMA either, since cleanup only happened in rvu_remove().
Allocate ng_rvu once with devm_kzalloc(), initialize mbox_lock in the
same block, unwind only the mailbox memory for the failing init type,
and free cn20k mailbox DMA from the probe and pci_enable_sriov()
error paths.
Fixes: e53ee4acb220 ("octeontx2-af: CN20k basic mbox operations and structures")
Signed-off-by: Sai Krishna <saikrishnag@marvell.com>
Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260821102337.2989169-1-rkannoth@marvell.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
