From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 51F9CC48BE8 for ; Wed, 16 Jun 2021 12:52:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AD9261166 for ; Wed, 16 Jun 2021 12:52:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232550AbhFPMyK (ORCPT ); Wed, 16 Jun 2021 08:54:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:55964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233076AbhFPMyH (ORCPT ); Wed, 16 Jun 2021 08:54:07 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E6D766023D; Wed, 16 Jun 2021 12:51:58 +0000 (UTC) Date: Wed, 16 Jun 2021 13:54:00 +0100 From: Jonathan Cameron To: Mauro Carvalho Chehab Cc: linux-iio@vger.kernel.org, Jonathan Cameron , Matt Ranostay Subject: Re: [PATCH v2 4/6] iio: prox: pulsed-light-v2: Fix misbalance runtime pm in error path Message-ID: <20210616135400.7c93f0ed@jic23-huawei> In-Reply-To: <20210616091842.7caae83e@coco.lan> References: <20210516162103.1332291-1-jic23@kernel.org> <20210516162103.1332291-5-jic23@kernel.org> <20210616091842.7caae83e@coco.lan> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Wed, 16 Jun 2021 09:18:42 +0200 Mauro Carvalho Chehab wrote: > Em Sun, 16 May 2021 17:21:01 +0100 > Jonathan Cameron escreveu: > > > From: Jonathan Cameron > > > > There is one path in which we don't do a runtime pm put and so > > leave the device enabled for ever more. > > > > Reported-by: Mauro Carvalho Chehab > > Fixes: 4ac4e086fd8c ("iio: pulsedlight-lidar-lite: add runtime PM") > > Signed-off-by: Jonathan Cameron > > Cc: Matt Ranostay > > I was unable to apply it on the top of next-20210615, although > the patch looks good to me. > > Reviewed-by: Mauro Carvalho Chehab Ah. This crossed with another fix for the same issue. I'll take another look at whether the alternate fix works as well as this and revisit this one at a future date. Thanks, Jonathan > > > --- > > drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > index 822a68ae5e03..ecaeb1e11007 100644 > > --- a/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > +++ b/drivers/iio/proximity/pulsedlight-lidar-lite-v2.c > > @@ -164,7 +164,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"); > > - return ret; > > + goto err; > > } > > > > while (tries--) { > > @@ -188,6 +188,7 @@ static int lidar_get_measurement(struct lidar_data *data, u16 *reg) > > } > > ret = -EIO; > > } > > +err: > > pm_runtime_mark_last_busy(&client->dev); > > pm_runtime_put_autosuspend(&client->dev); > > > > > > Thanks, > Mauro