Re: [PATCH net-next v2] octeontx2-af: Fix PCI device reference leaks in debugfs

From: Ratheesh Kannoth

Date: Thu Jun 11 2026 - 21:50:08 EST


On 2026-06-11 at 23:15:47, Jakub Kicinski (kuba@xxxxxxxxxx) wrote:
> On Thu, 11 Jun 2026 07:51:08 +0530 Ratheesh Kannoth wrote:
> > > Review question sort of based on a Sashiko comment - this is part of
> > > the rvu device driver, AFAIU, does anything prevent the AF from getting
> > > removed (via sysfs for instance) while this code is using its priv?
> >
> > RVU AF driver's teardown sequence prevents the race here. In
> > rvu_remove(), the very first call is rvu_dbg_exit(rvu),
> > which calls debugfs_remove_recursive() on the debugfs root.
> > ASFAIK, debugfs_remove_recursive() will block until all active
> > readers (i.e., any in-progress seq_file read callbacks like
> > cgx_print_stats(), cgx_print_dmac_flt(), and
> > cgx_print_fwdata()) have completed before the removal
> > proceeds. Only after rvu_dbg_exit() returns does
> > rvu_remove() proceed to free the rvu structure.
> >
> > A better approach would be to pass the rvu object(rvu structure has pdev field) while
> > creating the debugfs file itself, e.g.:
> >
> > RVU_DEBUG_SEQ_FOPS(cgx_dmac_flt, cgx_dmac_flt_display, s/NULL/rvu);
> >
> > This would eliminate the pci_get_device() lookup entirely. We
> > will post this as a code clean-up patch to net-next.
>
> Oh, that's much better, somehow I assumed that this dance is necessary
> because we are accessing a different PCI device.
>
> Also, since you're actively working upstream and nobody else on the CC
> list responded - should you perhaps be added to maintainers for this
> driver so that you're CCed on patches? (instead of one of the useless
> ones)

Thank you for the feedback, and I would be glad to be added to the
MAINTAINERS file for the RVU driver to help with reviews and tracking
moving forward.

Regarding the review coverage from our side, a few of
listed maintainers have transitioned out of the organization, and the
remaining team members have been tightly coupled with some critical internal
deliverables recently. However, we absolutely recognize the importance of
consistent upstream engagement. Moving forward, we are aligning our
internal focus to ensure we actively participate in review cycles and
maintain a steady presence on the list.

I will prepare and submit a formal patch to update the MAINTAINERS file.

Regarding the code cleanup discussed above, we will get the net-next patch
ready to replace the pci_get_device() lookup with the direct rvu context
pass.

Thanks again for your guidance and support.