From: Rui Miguel Silva <rmfrfs@gmail.com> To: Dinghao Liu <dinghao.liu@zju.edu.cn> Cc: kjlu@umn.edu, Steve Longerbeam <slongerbeam@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Mauro Carvalho Chehab <mchehab@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] media: imx: imx7-mipi-csis: Fix runtime PM imbalance in mipi_csis_s_stream Date: Fri, 9 Apr 2021 09:53:17 +0100 [thread overview] Message-ID: <20210409085317.ycj273fqwbmowfqb@arch-thunder.localdomain> (raw) In-Reply-To: <20210409082225.22461-1-dinghao.liu@zju.edu.cn> Hi Liu, Many thanks for the patch. On Fri, Apr 09, 2021 at 04:22:25PM +0800, Dinghao Liu wrote: > When v4l2_subdev_call() fails, a pairing PM usage counter > decrement is needed to keep the counter balanced. It's the > same for the following error paths in case 'enable' is on. > > Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> LGTM Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> ------ Cheers, Rui > --- > > Changelog: > > v2: - Use pm_runtime_put() to balance the refcount. > --- > drivers/staging/media/imx/imx7-mipi-csis.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c > index a01a7364b4b9..6f3e8a15e7c4 100644 > --- a/drivers/staging/media/imx/imx7-mipi-csis.c > +++ b/drivers/staging/media/imx/imx7-mipi-csis.c > @@ -628,7 +628,7 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable) > } > ret = v4l2_subdev_call(state->src_sd, core, s_power, 1); > if (ret < 0) > - return ret; > + goto pm_put; > } > > mutex_lock(&state->lock); > @@ -657,7 +657,8 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable) > > unlock: > mutex_unlock(&state->lock); > - if (!enable) > +pm_put: > + if (!enable || (ret < 0)) > pm_runtime_put(&state->pdev->dev); > > return ret; > -- > 2.17.1 > >
WARNING: multiple messages have this Message-ID (diff)
From: Rui Miguel Silva <rmfrfs@gmail.com> To: Dinghao Liu <dinghao.liu@zju.edu.cn> Cc: kjlu@umn.edu, Steve Longerbeam <slongerbeam@gmail.com>, Philipp Zabel <p.zabel@pengutronix.de>, Mauro Carvalho Chehab <mchehab@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] media: imx: imx7-mipi-csis: Fix runtime PM imbalance in mipi_csis_s_stream Date: Fri, 9 Apr 2021 09:53:17 +0100 [thread overview] Message-ID: <20210409085317.ycj273fqwbmowfqb@arch-thunder.localdomain> (raw) In-Reply-To: <20210409082225.22461-1-dinghao.liu@zju.edu.cn> Hi Liu, Many thanks for the patch. On Fri, Apr 09, 2021 at 04:22:25PM +0800, Dinghao Liu wrote: > When v4l2_subdev_call() fails, a pairing PM usage counter > decrement is needed to keep the counter balanced. It's the > same for the following error paths in case 'enable' is on. > > Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> LGTM Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> ------ Cheers, Rui > --- > > Changelog: > > v2: - Use pm_runtime_put() to balance the refcount. > --- > drivers/staging/media/imx/imx7-mipi-csis.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c > index a01a7364b4b9..6f3e8a15e7c4 100644 > --- a/drivers/staging/media/imx/imx7-mipi-csis.c > +++ b/drivers/staging/media/imx/imx7-mipi-csis.c > @@ -628,7 +628,7 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable) > } > ret = v4l2_subdev_call(state->src_sd, core, s_power, 1); > if (ret < 0) > - return ret; > + goto pm_put; > } > > mutex_lock(&state->lock); > @@ -657,7 +657,8 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable) > > unlock: > mutex_unlock(&state->lock); > - if (!enable) > +pm_put: > + if (!enable || (ret < 0)) > pm_runtime_put(&state->pdev->dev); > > return ret; > -- > 2.17.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-04-09 8:53 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-09 8:22 [PATCH] [v2] media: imx: imx7-mipi-csis: Fix runtime PM imbalance in mipi_csis_s_stream Dinghao Liu 2021-04-09 8:22 ` Dinghao Liu 2021-04-09 8:53 ` Rui Miguel Silva [this message] 2021-04-09 8:53 ` Rui Miguel Silva
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=20210409085317.ycj273fqwbmowfqb@arch-thunder.localdomain \ --to=rmfrfs@gmail.com \ --cc=dinghao.liu@zju.edu.cn \ --cc=festevam@gmail.com \ --cc=gregkh@linuxfoundation.org \ --cc=kernel@pengutronix.de \ --cc=kjlu@umn.edu \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-imx@nxp.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-media@vger.kernel.org \ --cc=linux-staging@lists.linux.dev \ --cc=mchehab@kernel.org \ --cc=p.zabel@pengutronix.de \ --cc=s.hauer@pengutronix.de \ --cc=shawnguo@kernel.org \ --cc=slongerbeam@gmail.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.