Re: [PATCH v2] crypto: marvell/octeontx - clean up VF resources when DOWN fails

From: Herbert Xu

Date: Fri Oct 16 2026 - 08:22:15 EST


On Sun, Oct 11, 2026 at 04:34:56PM -0400, Myeonghun Pak wrote:
> A failed DOWN mailbox notification makes otx_cptvf_remove() skip all
> local cleanup. The driver core still completes unbind and releases the
> devm-allocated cptvf, leaving the raw IRQ handlers registered with that
> object as their argument. The sysfs group, crypto device-table entry,
> software queues and PCI resources also remain uncleaned.
>
> Keep the notification error diagnostic, but run local cleanup regardless
> of the PF response. The PF only acknowledges DOWN; it does not disable the
> VF queue. Disable the VQ locally and poll its INFLIGHT count for up to one
> second before releasing the DMA command queues. Warn if the queue does
> not become idle, but continue local teardown. Clear PCI bus mastering
> before freeing resources. Remove both IRQ handlers before killing the
> tasklet and releasing its resources.
>
> This issue was identified during our ongoing static-analysis research
> while reviewing kernel code.
>
> Fixes: 10b4f09491bf ("crypto: marvell - add the Virtual Function driver for CPT")
> Cc: stable@xxxxxxxxxxxxxxx
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
> Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
> ---
> Changes in v2:
> - Disable the local VQ and poll INFLIGHT for up to one second before
> freeing DMA command queues.
> - Warn on an idle timeout and continue local cleanup.
> - Clear PCI bus mastering before releasing resources.
>
> v1: https://lore.kernel.org/r/20261004042634.1130247-1-mhun512@xxxxxxxxx
> Review: https://sashiko.dev/#/patchset/20261004042634.1130247-1-mhun512%40gmail.com
>
> .../crypto/marvell/octeontx/otx_cptvf_main.c | 44 ++++++++++++-------
> 1 file changed, 29 insertions(+), 15 deletions(-)

Please address the Sashiko review:

https://sashiko.dev/#/patchset/20261011203456.1879639-1-mhun512%40gmail.com

Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt