All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Duan <fugang.duan@nxp.com>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>, "kjlu@umn.edu" <kjlu@umn.edu>
Cc: Markus Elfring <Markus.Elfring@web.de>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	dl-linux-imx <linux-imx@nxp.com>, Wolfram Sang <wsa@kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [EXT] [PATCH] [v3] i2c: imx-lpi2c: Fix runtime PM imbalance on error
Date: Mon, 1 Jun 2020 06:24:32 +0000	[thread overview]
Message-ID: <AM6PR0402MB3607C88AD2E6087000D62F29FF8A0@AM6PR0402MB3607.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200601061640.27632-1-dinghao.liu@zju.edu.cn>

From: Dinghao Liu <dinghao.liu@zju.edu.cn> Sent: Monday, June 1, 2020 2:17 PM
> pm_runtime_get_sync() increments the runtime PM usage counter even the
> call returns an error code. Thus a corresponding decrement is needed on the
> error handling path to keep the counter balanced.
> 
> Fix this by adding the missed function call.
> 
> Fixes: 13d6eb20fc79a ("i2c: imx-lpi2c: add runtime pm support")
> Co-developed-by: Markus Elfring <Markus.Elfring@web.de>
> Signed-off-by: Markus Elfring <Markus.Elfring@web.de>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
> ---
> 
> Changelog:
> 
> v2: - Use pm_runtime_put_noidle() instead of
>       pm_runtime_put_autosuspend().
> 
> v3: - Refine commit message.
> ---
>  drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c
> b/drivers/i2c/busses/i2c-imx-lpi2c.c
> index 94743ba581fe..bdee02dff284 100644
> --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> @@ -260,8 +260,10 @@ static int lpi2c_imx_master_enable(struct
> lpi2c_imx_struct *lpi2c_imx)
>         int ret;
> 
>         ret = pm_runtime_get_sync(lpi2c_imx->adapter.dev.parent);
> -       if (ret < 0)
> +       if (ret < 0) {
> +               pm_runtime_put_noidle(lpi2c_imx->adapter.dev.parent);
>                 return ret;
> +       }
> 
>         temp = MCR_RST;
>         writel(temp, lpi2c_imx->base + LPI2C_MCR);
> --
> 2.17.1


WARNING: multiple messages have this Message-ID
From: Andy Duan <fugang.duan@nxp.com>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>, "kjlu@umn.edu" <kjlu@umn.edu>
Cc: Aisheng Dong <aisheng.dong@nxp.com>,
	Fabio Estevam <festevam@gmail.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Wolfram Sang <wsa@kernel.org>,
	Markus Elfring <Markus.Elfring@web.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: RE: [EXT] [PATCH] [v3] i2c: imx-lpi2c: Fix runtime PM imbalance on error
Date: Mon, 1 Jun 2020 06:24:32 +0000	[thread overview]
Message-ID: <AM6PR0402MB3607C88AD2E6087000D62F29FF8A0@AM6PR0402MB3607.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200601061640.27632-1-dinghao.liu@zju.edu.cn>

From: Dinghao Liu <dinghao.liu@zju.edu.cn> Sent: Monday, June 1, 2020 2:17 PM
> pm_runtime_get_sync() increments the runtime PM usage counter even the
> call returns an error code. Thus a corresponding decrement is needed on the
> error handling path to keep the counter balanced.
> 
> Fix this by adding the missed function call.
> 
> Fixes: 13d6eb20fc79a ("i2c: imx-lpi2c: add runtime pm support")
> Co-developed-by: Markus Elfring <Markus.Elfring@web.de>
> Signed-off-by: Markus Elfring <Markus.Elfring@web.de>
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
> ---
> 
> Changelog:
> 
> v2: - Use pm_runtime_put_noidle() instead of
>       pm_runtime_put_autosuspend().
> 
> v3: - Refine commit message.
> ---
>  drivers/i2c/busses/i2c-imx-lpi2c.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c
> b/drivers/i2c/busses/i2c-imx-lpi2c.c
> index 94743ba581fe..bdee02dff284 100644
> --- a/drivers/i2c/busses/i2c-imx-lpi2c.c
> +++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
> @@ -260,8 +260,10 @@ static int lpi2c_imx_master_enable(struct
> lpi2c_imx_struct *lpi2c_imx)
>         int ret;
> 
>         ret = pm_runtime_get_sync(lpi2c_imx->adapter.dev.parent);
> -       if (ret < 0)
> +       if (ret < 0) {
> +               pm_runtime_put_noidle(lpi2c_imx->adapter.dev.parent);
>                 return ret;
> +       }
> 
>         temp = MCR_RST;
>         writel(temp, lpi2c_imx->base + LPI2C_MCR);
> --
> 2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-06-01  6:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01  6:16 Dinghao Liu
2020-06-01  6:16 ` Dinghao Liu
2020-06-01  6:24 ` Andy Duan [this message]
2020-06-01  6:24   ` [EXT] " Andy Duan
2020-06-01  6:42 ` [PATCH v3] i2c: imx-lpi2c: Fix runtime PM imbalance in lpi2c_imx_master_enable() Markus Elfring
2020-06-01  6:42   ` Markus Elfring
2020-06-01  6:42   ` Markus Elfring
2020-06-14  9:12 ` [PATCH] [v3] i2c: imx-lpi2c: Fix runtime PM imbalance on error Wolfram Sang
2020-06-14  9:12   ` Wolfram Sang
2020-06-14 12:08   ` dinghao.liu
2020-06-14 12:08     ` dinghao.liu
2020-06-15  6:33   ` Aisheng Dong
2020-06-15  6:33     ` Aisheng Dong
2020-06-15  7:06     ` Wolfram Sang
2020-06-15  7:06       ` Wolfram Sang
2020-06-15  7:40       ` Markus Elfring
2020-06-15  7:40         ` Markus Elfring

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=AM6PR0402MB3607C88AD2E6087000D62F29FF8A0@AM6PR0402MB3607.eurprd04.prod.outlook.com \
    --to=fugang.duan@nxp.com \
    --cc=Markus.Elfring@web.de \
    --cc=aisheng.dong@nxp.com \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kjlu@umn.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=wsa@kernel.org \
    --subject='RE: [EXT] [PATCH] [v3] i2c: imx-lpi2c: Fix runtime PM imbalance on error' \
    /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: link

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.