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] [day] [month] [year] [list]
Message-ID: <20260131164135.35f07a27@jic23-huawei>
Date: Sat, 31 Jan 2026 16:41:35 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: Antoniu Miclaus <antoniu.miclaus@...log.com>
Cc: Linus Walleij <linusw@...nel.org>, 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>
Subject: Re: [PATCH] iio: gyro: mpu3050-i2c: use pm_runtime_resume_and_get()

On Fri, 30 Jan 2026 17:32:26 +0200
Antoniu Miclaus <antoniu.miclaus@...log.com> wrote:

> Use pm_runtime_resume_and_get() in bypass_select() and return its
> result directly. Unlike pm_runtime_get_sync(), it doesn't increment
> the refcount on failure.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@...log.com>

Please always put a cover letter on anything with more than one patch.
Provides both a nice name for the series in patchwork etc and a 
single place to reply.

Are these fixes?  What is side effect of the wrong ref count?

> ---
>  drivers/iio/gyro/mpu3050-i2c.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/gyro/mpu3050-i2c.c b/drivers/iio/gyro/mpu3050-i2c.c
> index 092878f2c886..6549b22e643d 100644
> --- a/drivers/iio/gyro/mpu3050-i2c.c
> +++ b/drivers/iio/gyro/mpu3050-i2c.c
> @@ -19,8 +19,7 @@ static int mpu3050_i2c_bypass_select(struct i2c_mux_core *mux, u32 chan_id)
>  	struct mpu3050 *mpu3050 = i2c_mux_priv(mux);
>  
>  	/* Just power up the device, that is all that is needed */
> -	pm_runtime_get_sync(mpu3050->dev);
> -	return 0;
> +	return pm_runtime_resume_and_get(mpu3050->dev);
>  }
>  
>  static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ