Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Joshua Crofts" <joshua.crofts1@gmail.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/8] iio: magnetometer: ak8975: switch to using managed resources
Date: Mon, 11 May 2026 19:17:41 +0100	[thread overview]
Message-ID: <20260511191741.5f45d6f3@jic23-huawei> (raw)
In-Reply-To: <af7oKgtzyFmPogJJ@ashevche-desk.local>

On Sat, 9 May 2026 10:54:18 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Sat, May 09, 2026 at 09:47:25AM +0200, Joshua Crofts wrote:
> > On Sat, 9 May 2026 at 08:52, Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:  
> > > On Fri, May 08, 2026 at 03:51:06PM +0200, Joshua Crofts wrote:  
> > > > On Fri, 8 May 2026 at 11:58, Andy Shevchenko
> > > > <andriy.shevchenko@linux.intel.com> wrote:  
> > > > > On Thu, May 07, 2026 at 04:35:52PM +0200, Joshua Crofts via B4 Relay wrote:  
> 
> ...
> 
> > > > > > +     /* Only power down if currently active */
> > > > > > +     if (pm_runtime_status_suspended(dev))  
> > > > >
> > > > > Is this one a correct one?
> > > > > We also have pm_runtime_suspended(), which is different.  
> > > >
> > > > As we only require the status of the device and not the power.disable_depth,
> > > > pm_runtime_status_suspended() seems adequate.  
> > >
> > > Last time I have checked the code on this I remember that probably this one
> > > doesn't guarantee that immediately after returning to the caller the device is
> > > still in a suspend status.
> > >
> > > The difference between two as documentation said is in "...if runtime PM
> > > is enabled for @dev..." for the pm_runtime_suspended(). So the
> > > pm_runtime_suspended() is stricter in that sense.  
> > 
> > Okay, if you prefer pm_runtime_suspended() then I have no issue with it.
> > I can amend the series version this time.  
> 
> It's not about my preference (I am fine with either call), it's about
> understanding the code flow and what does fit better in _this_ case.
> 

https://sashiko.dev/#/patchset/20260509191907.24734-1-macroalpha82%40gmail.com

See patch 5 review.  I haven't checked the details but looks like this
dance might not work and we need to figure out something more clever.

This particular example 'might' be fine as we don't end up with
pm_runtime_set_suspended_action() being registered.

May be fine but needs more careful analysis :(

I'm a little concerned we get some stale state because in the 'early'
set active approach used here we don't undo the pm_runtime_set_active()
anywhere.


  reply	other threads:[~2026-05-11 18:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07 14:35 [PATCH 0/8] iio: magnetometer: ak8975: driver cleanup Joshua Crofts via B4 Relay
2026-05-07 14:35 ` [PATCH 1/8] iio: magnetometer: ak8975: modernize polling loops with iopoll() macros Joshua Crofts via B4 Relay
2026-05-09  8:48   ` Nuno Sá
2026-05-07 14:35 ` [PATCH 2/8] iio: magnetometer: ak8975: check if gpiod read was successful Joshua Crofts via B4 Relay
2026-05-09  8:49   ` Nuno Sá
2026-05-07 14:35 ` [PATCH 3/8] iio: magnetometer: ak8975: switch to using managed resources Joshua Crofts via B4 Relay
2026-05-08  9:58   ` Andy Shevchenko
2026-05-08 13:51     ` Joshua Crofts
2026-05-09  6:52       ` Andy Shevchenko
2026-05-09  7:47         ` Joshua Crofts
2026-05-09  7:54           ` Andy Shevchenko
2026-05-11 18:17             ` Jonathan Cameron [this message]
2026-05-09  9:03   ` Nuno Sá
2026-05-09 13:32     ` Joshua Crofts
2026-05-12  8:07       ` Nuno Sá
2026-05-12  8:12         ` Joshua Crofts
2026-05-12  8:23           ` Andy Shevchenko
2026-05-12 11:15             ` Jonathan Cameron
2026-05-09 17:15     ` Andy Shevchenko
2026-05-11  7:04       ` Joshua Crofts
2026-05-11 13:12         ` Jonathan Cameron
2026-05-07 14:35 ` [PATCH 4/8] iio: magnetometer: ak8975: consistently use 'data' parameter Joshua Crofts via B4 Relay
2026-05-09  9:04   ` Nuno Sá
2026-05-07 14:35 ` [PATCH 5/8] iio: magnetometer: ak8975: unify messages with help of dev_err_probe() Joshua Crofts via B4 Relay
2026-05-09  9:05   ` Nuno Sá
2026-05-07 14:35 ` [PATCH 6/8] iio: magnetometer: ak8975: use temporary variable for struct device Joshua Crofts via B4 Relay
2026-05-09  9:06   ` Nuno Sá
2026-05-07 14:35 ` [PATCH 7/8] iio: magnetometer: ak8975: add scan mask index enum Joshua Crofts via B4 Relay
2026-05-09  9:07   ` Nuno Sá
2026-05-07 14:35 ` [PATCH 8/8] iio: magnetometer: ak8975: make use of the macros from bits.h Joshua Crofts via B4 Relay
2026-05-09  9:09   ` Nuno Sá
2026-05-09  9:15     ` Joshua Crofts
2026-05-09 17:16     ` Andy Shevchenko
2026-05-08  7:39 ` [PATCH 0/8] iio: magnetometer: ak8975: driver cleanup Andy Shevchenko
2026-05-08  8:59   ` Joshua Crofts
2026-05-08  9:19     ` Andy Shevchenko
2026-05-08 13:34       ` Jonathan Cameron
2026-05-08 13:45         ` Joshua Crofts

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=20260511191741.5f45d6f3@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=joshua.crofts1@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.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