lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250809190609.4fef9df7@jic23-huawei>
Date: Sat, 9 Aug 2025 19:06:09 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Sean Nyekjaer <sean@...nix.com>, Jean-Baptiste Maneyrol
 <jean-baptiste.maneyrol@....com>, David Lechner <dlechner@...libre.com>,
 Nuno Sá <nuno.sa@...log.com>, Andy Shevchenko
 <andy@...nel.org>, linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
 Jean-Baptiste Maneyrol <jmaneyrol@...ensense.com>, Jonathan Cameron
 <Jonathan.Cameron@...wei.com>
Subject: Re: [PATCH v2 1/5] iio: imu: inv_icm42600: Simplify pm_runtime
 setup

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

> On Fri, Aug 8, 2025 at 5:58 PM Sean Nyekjaer <sean@...nix.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

> >  }  
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ