Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: Yuho Choi <dbgh9129@gmail.com>,
	Sunil Goutham <sgoutham@marvell.com>,
	"Linu Cherian" <lcherian@marvell.com>,
	Geetha sowjanya <gakula@marvell.com>,
	hariprasad <hkelam@marvell.com>,
	Subbaraya Sundeep <sbhatta@marvell.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <nshettyj@marvell.com>
Subject: Re: [PATCH net-next v2] octeontx2-af: Fix PCI device reference leaks in debugfs
Date: Thu, 11 Jun 2026 10:45:47 -0700	[thread overview]
Message-ID: <20260611104547.22cedb69@kernel.org> (raw)
In-Reply-To: <aioblJqQctA_9U8y@rkannoth-OptiPlex-7090>

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)

  reply	other threads:[~2026-06-11 17:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08 16:55 [PATCH net-next v2] octeontx2-af: Fix PCI device reference leaks in debugfs Yuho Choi
2026-06-10 15:35 ` Jakub Kicinski
2026-06-11  2:21   ` Ratheesh Kannoth
2026-06-11 17:45     ` Jakub Kicinski [this message]
2026-06-11 19:03       ` 최유호

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260611104547.22cedb69@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dbgh9129@gmail.com \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nshettyj@marvell.com \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox