All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
@ 2021-04-07  4:59 Dinghao Liu
  2021-04-07  7:40 ` Andy Shevchenko
  2021-04-11 15:11 ` Jonathan Cameron
  0 siblings, 2 replies; 3+ messages in thread
From: Dinghao Liu @ 2021-04-07  4:59 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Alexandru Ardelean, Matt Ranostay, Andy Shevchenko, linux-iio,
	linux-kernel

When lidar_write_control() fails, a pairing PM usage counter
decrement is needed to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
index c685f10b5ae4..cc206bfa09c7 100644
--- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
+++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
@@ -160,6 +160,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg)
 	ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE);
 	if (ret < 0) {
 		dev_err(&client->dev, "cannot send start measurement command");
+		pm_runtime_put_noidle(&client->dev);
 		return ret;
 	}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
  2021-04-07  4:59 [PATCH] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error Dinghao Liu
@ 2021-04-07  7:40 ` Andy Shevchenko
  2021-04-11 15:11 ` Jonathan Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-04-07  7:40 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: Kangjie Lu, Jonathan Cameron, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Alexandru Ardelean, Matt Ranostay,
	linux-iio, Linux Kernel Mailing List

On Wed, Apr 7, 2021 at 7:59 AM Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:
>
> When lidar_write_control() fails, a pairing PM usage counter
> decrement is needed to keep the counter balanced.

FWIW,
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> ---
>  drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> index c685f10b5ae4..cc206bfa09c7 100644
> --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> @@ -160,6 +160,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg)
>         ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE);
>         if (ret < 0) {
>                 dev_err(&client->dev, "cannot send start measurement command");
> +               pm_runtime_put_noidle(&client->dev);
>                 return ret;
>         }
>
> --
> 2.17.1
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error
  2021-04-07  4:59 [PATCH] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error Dinghao Liu
  2021-04-07  7:40 ` Andy Shevchenko
@ 2021-04-11 15:11 ` Jonathan Cameron
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2021-04-11 15:11 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: kjlu, Lars-Peter Clausen, Peter Meerwald-Stadler,
	Alexandru Ardelean, Matt Ranostay, Andy Shevchenko, linux-iio,
	linux-kernel

On Wed,  7 Apr 2021 12:59:35 +0800
Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:

> When lidar_write_control() fails, a pairing PM usage counter
> decrement is needed to keep the counter balanced.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Hi, patch content looks good but it needs a fixes tag so we know how far to backport it.
Please add for v2.

Thanks,

Jonathan

> ---
>  drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> index c685f10b5ae4..cc206bfa09c7 100644
> --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c
> @@ -160,6 +160,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg)
>  	ret = lidar_write_control(data, LIDAR_REG_CONTROL_ACQUIRE);
>  	if (ret < 0) {
>  		dev_err(&client->dev, "cannot send start measurement command");
> +		pm_runtime_put_noidle(&client->dev);
>  		return ret;
>  	}
>  


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-11 15:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  4:59 [PATCH] iio: proximity: pulsedlight: Fix rumtime PM imbalance on error Dinghao Liu
2021-04-07  7:40 ` Andy Shevchenko
2021-04-11 15:11 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.