From: Johan Hovold <johan@kernel.org>
To: Nicolas Dufresne <nicolas@ndufresne.ca>
Cc: Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
Houlong Wei <houlong.wei@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
linux-media@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] media: mediatek: amend vpu_get_plat_device() documentation
Date: Fri, 12 Dec 2025 11:21:41 +0900 [thread overview]
Message-ID: <aTt8NSV4SP2ojKvi@hovoldconsulting.com> (raw)
In-Reply-To: <78aeb9303f3d57a28b2edc3b6b2b2f45498ee3fd.camel@ndufresne.ca>
[-- Attachment #1: Type: text/plain, Size: 2513 bytes --]
On Wed, Dec 10, 2025 at 10:58:41AM -0500, Nicolas Dufresne wrote:
> Le mercredi 10 décembre 2025 à 12:21 +0900, Johan Hovold a écrit :
> > On Tue, Dec 09, 2025 at 03:43:30PM -0500, Nicolas Dufresne wrote:
> > > Le mardi 28 octobre 2025 à 11:04 +0100, Johan Hovold a écrit :
> > > > Add a comment to the vpu_get_plat_device() documentation to make it
> > > > clear that the VPU platform device is returned with an incremented
> > > > reference count (which needs to be dropped after use).
> > > > @@ -120,7 +120,7 @@ int vpu_ipi_send(struct platform_device *pdev,
> > > > * device for using VPU API.
> > > > *
> > > > * Return: Return NULL if it is failed.
> > > > - * otherwise it is VPU's platform device
> > > > + * otherwise it is VPU's platform device with incremented reference count
> > >
> > > I picked this patch but rewrote with what felt like better and dense.
> > >
> > > - * Return: Return NULL if it is failed.
> > > - * otherwise it is VPU's platform device
> > > + * Return: a reference to the VPU's platform device, or NULL on failure.
> > >
> > > hope its ok with you,
> >
> > Sure, my only concern is that just saying "reference" is too subtle,
> > that's why I explicitly mentioned the refcount.
>
> For me everyone should read "a reference" as a kref based reference counted
> structure. A quick grep across out documentation, this is the vast majority of
> the wording. Though, I spent limited time looking.
It should be sufficient but given how many people miss this it may still
be worth being more explicit.
> > Btw, why is patch 2/2 marked obsolete? That leak is still there both on
> > probe errors (which I saw someone else posted a fix for) and on driver
> > unbind.
>
> I had two patches fixing the same thing, it just happen that I ended up picking
> the other one first
Ah, I had missed that and the fix is not in linux-next yet either so
without a reply it wasn't obvious.
> and liked you documentation fix, except it was replicating
> obvious weird english such as "if it is failed", and documenting the error
> before the expected outcome (opposite of my preference, not sure there is any
> rules or guidelines).
Yeah, I considered rewriting the whole comment too but given that the
surrounding comments used similar language I just amended what was
there.
But I'm totally fine with the update you did.
> https://lore.kernel.org/all/20251008090156.14224-1-haoxiang_li2024@163.com/
Johan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-12-12 2:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 10:04 [PATCH v2 0/2] media: mediatek: fix VPU device leaks on probe Johan Hovold
2025-10-28 10:04 ` [PATCH v2 1/2] media: mediatek: mdp: fix device leak " Johan Hovold
2025-10-28 10:04 ` [PATCH v2 2/2] media: mediatek: amend vpu_get_plat_device() documentation Johan Hovold
2025-12-09 20:43 ` Nicolas Dufresne
2025-12-10 3:21 ` Johan Hovold
2025-12-10 15:58 ` Nicolas Dufresne
2025-12-12 2:21 ` Johan Hovold [this message]
2025-11-05 8:07 ` [PATCH v2 0/2] media: mediatek: fix VPU device leaks on probe Johan Hovold
2025-11-05 12:31 ` AngeloGioacchino Del Regno
2025-11-20 13:14 ` Johan Hovold
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=aTt8NSV4SP2ojKvi@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=houlong.wei@mediatek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=minghsiu.tsai@mediatek.com \
--cc=nicolas@ndufresne.ca \
--cc=tiffany.lin@mediatek.com \
--cc=yunfei.dong@mediatek.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