mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Ruoyu Wang" <ruoyuw560@gmail.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Alexandru Ardelean" <alexandru.ardelean@analog.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: gyro: mpu3050: Fix runtime PM leak on trigger errors
Date: Sat, 22 Aug 2026 23:17:45 +0100	[thread overview]
Message-ID: <20260822231745.18219605@jic23-huawei> (raw)
In-Reply-To: <aoK4VOdjFchVJWn0@ashevche-desk.local>

On Mon, 17 Aug 2026 10:29:24 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Fri, Aug 14, 2026 at 09:41:11PM +0800, Ruoyu Wang wrote:
> > The first user of the MPU-3050 data-ready trigger takes a runtime PM
> > reference before configuring the FIFO, sample engine and interrupt. If
> > any of those operations fails, iio_trigger_attach_poll_func() tears down
> > its IRQ resources without calling set_trigger_state(false). The buffer
> > error path then releases only its preenable reference, leaving the
> > trigger's reference held and preventing runtime suspend.
> > 
> > Use pm_runtime_resume_and_get() so a resume failure does not leave a
> > usage count behind. Route later setup failures through a common unwind
> > that clears hw_irq_trigger and drops the trigger's reference. Successful
> > enable and disable behavior is unchanged.
> > 
> > This issue was found by a static analysis checker and confirmed by
> > manual source review.  
> 
> Why not using the respective PM_RUNTIME_ACQUIRE*() macros?
> 

That is only applicable in one location.  Nice to have though but
will need combining with a guard(mutex)();



  reply	other threads:[~2026-08-22 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 13:41 Ruoyu Wang
2026-08-14 20:05 ` Linus Walleij
2026-08-17  7:29 ` Andy Shevchenko
2026-08-22 22:17   ` Jonathan Cameron [this message]
2026-08-22 22:23 ` Jonathan Cameron

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=20260822231745.18219605@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=alexandru.ardelean@analog.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=ruoyuw560@gmail.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®