mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Sean Nyekjaer" <sean@geanix.com>,
	"Jean-Baptiste Maneyrol" <jean-baptiste.maneyrol@tdk.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,
	"Jean-Baptiste Maneyrol" <jmaneyrol@invensense.com>,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH v2 1/5] iio: imu: inv_icm42600: Simplify pm_runtime setup
Date: Sat, 9 Aug 2025 19:06:09 +0100	[thread overview]
Message-ID: <20250809190609.4fef9df7@jic23-huawei> (raw)
In-Reply-To: <CAHp75VdKNE0xD8xbJQ2RSCA=_MB9DMZtXRTCNkpdKdv8vW-Q-w@mail.gmail.com>

On Fri, 8 Aug 2025 23:37:51 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Fri, Aug 8, 2025 at 5:58 PM Sean Nyekjaer <sean@geanix.com> wrote:
> >
> > Rework the power management in inv_icm42600_core_probe() to use
> > devm_pm_runtime_set_active_enabled(), which simplifies the runtime PM
> > setup by handling activation and enabling in one step.
> > Remove the separate inv_icm42600_disable_pm callback, as it's no longer
> > needed with the devm-managed approach.
> > Using devm_pm_runtime_enable() also fixes the missing disable of
> > autosuspend.
> > Update inv_icm42600_disable_vddio_reg() to only disable the regulator if
> > the device is not suspended i.e. powered-down, preventing unbalanced
> > disables.
> > Also remove redundant error msg on regulator_disable(), the regulator
> > framework already emits an error message when regulator_disable() fails.
> >
> > This simplifies the PM setup and avoids manipulating the usage counter
> > unnecessarily.  
> 
> ...
> 
> > +       struct device *dev = regmap_get_device(st->map);
> >
> > +       if (!pm_runtime_status_suspended(dev))
> > +               regulator_disable(st->vddio_supply);  
> 
> I would rather use positive conditional as it seems to me more scalable
Hi Andy,
> 

To potentially save time when Sean looks at this.  I don't follow. Do you mean
something like
	if (pm_runtime_status_suspended(dev))
		return;

	regulator_disable(st->vddio_supply);

?

If so I'm not seeing why we'd want this to scale as it's a single use
devm_set_action_or_reset() callback doing just one thing.

Jonathan

> >  }  
> 
> 


  reply	other threads:[~2025-08-09 18:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-08 15:57 [PATCH v2 0/5] iio: imu: inv_icm42600: pm_runtime fixes + various changes Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 1/5] iio: imu: inv_icm42600: Simplify pm_runtime setup Sean Nyekjaer
2025-08-08 21:37   ` Andy Shevchenko
2025-08-09 18:06     ` Jonathan Cameron [this message]
2025-08-09 20:27       ` Andy Shevchenko
2025-08-11 14:21         ` Sean Nyekjaer
2025-08-11 14:24           ` Andy Shevchenko
2025-08-25 15:14           ` Sean Nyekjaer
2025-08-30 14:45             ` Jonathan Cameron
2025-08-08 15:57 ` [PATCH v2 2/5] iio: imu: inv_icm42600: Drop redundant pm_runtime reinitialization in resume Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 3/5] iio: imu: inv_icm42600: Avoid configuring if already pm_runtime suspended Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 4/5] iio: imu: inv_icm42600: Use devm_regulator_get_enable() for vdd regulator Sean Nyekjaer
2025-08-08 15:57 ` [PATCH v2 5/5] iio: imu: inv_icm42600: use guard() to release mutexes Sean Nyekjaer
2025-08-08 21:52   ` Andy Shevchenko
2025-08-11 11:47     ` Sean Nyekjaer

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=20250809190609.4fef9df7@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jean-baptiste.maneyrol@tdk.com \
    --cc=jmaneyrol@invensense.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=sean@geanix.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®