mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Manush Prajwal <manushprajwal555@gmail.com>
Cc: xingyu.wu@starfivetech.com, ziv.xu@starfivetech.com,
	wim@linux-watchdog.org, linux-kernel@vger.kernel.org,
	linux-watchdog@vger.kernel.org
Subject: Re: [PATCH v2] watchdog: starfive: fix runtime PM usage counter leak in pm_start
Date: Thu, 27 Aug 2026 06:59:27 -0700	[thread overview]
Message-ID: <6cefb263-7f9c-4be5-aff2-6e1a66bdd4b5@roeck-us.net> (raw)
In-Reply-To: <6a8b157b.8e75e0cb.2cc15f.4aae@mx.google.com>

On Sun, Aug 23, 2026 at 09:14:59PM +0530, Manush Prajwal wrote:
> starfive_wdt_pm_start() calls pm_runtime_get_sync() and returns its
> error code directly on failure. Per Documentation/power/runtime_pm.rst,
> pm_runtime_get_sync() does not drop the usage counter on error, so the
> caller is expected to release the reference itself. The early return
> here skips that, leaking a runtime PM usage count on wdd->parent on
> every failed resume, which prevents the device from being suspended
> correctly afterwards.
> 
> Fix it by calling pm_runtime_put_noidle() before returning, mirroring
> the same balance the counterpart starfive_wdt_pm_stop() already
> maintains with pm_runtime_put_sync().
> 
> v1 only balanced the pm_runtime_get_sync() failure path. As Guenter
> Roeck and the Sashiko AI review both pointed out, the same leak
> remains if the subsequent starfive_wdt_start() call fails: the
> runtime PM reference acquired by pm_runtime_get_sync() would still be
> held while returning an error, again leaving the device unable to
> suspend. Drop the reference on that failure path too.
> 
> Signed-off-by: manushprajwal <manushprajwal555@gmail.com>

checkpatch says:

WARNING: From:/Signed-off-by: email name mismatch: 'From: Manush Prajwal <manushprajwal555@gmail.com>' != 'Signed-off-by: manushprajwal <manushprajwal555@gmail.com>'

... which means that I can not apply this patch. Please fix and resend.

Thanks,
Guenter

      parent reply	other threads:[~2026-08-27 13:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23 15:44 Manush Prajwal
2026-08-23 16:45 ` Markus Elfring
2026-08-27 13:59 ` Guenter Roeck [this message]

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=6cefb263-7f9c-4be5-aff2-6e1a66bdd4b5@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=manushprajwal555@gmail.com \
    --cc=wim@linux-watchdog.org \
    --cc=xingyu.wu@starfivetech.com \
    --cc=ziv.xu@starfivetech.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

all inboxes | Powered by JetHome®