From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Jisheng Zhang <jszhang@marvell.com>,
mika.westerberg@linux.intel.com, wsa@the-dreams.de
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare
Date: Wed, 20 Apr 2016 17:16:00 +0300 [thread overview]
Message-ID: <1461161760.6620.306.camel@linux.intel.com> (raw)
In-Reply-To: <57177C32.4090000@linux.intel.com>
On Wed, 2016-04-20 at 15:55 +0300, Jarkko Nikula wrote:
> On 04/14/2016 03:53 PM, Jisheng Zhang wrote:
> >
> > If i2c_dw_probe() fail, we should call i2c_dw_plat_prepare_clk() to
> > disable and unprepare the clk, otherwise the clk enable and prepare
> > is left unbalanced.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > ---
> > drivers/i2c/busses/i2c-designware-platdrv.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
> > b/drivers/i2c/busses/i2c-designware-platdrv.c
> > index 00f9e99..1488cea 100644
> > --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> > +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> > @@ -268,6 +268,8 @@ rpm_disable:
> > pm_runtime_put_noidle(&pdev->dev);
> > }
> >
> > + i2c_dw_plat_prepare_clk(dev, false);
> > +
> > return r;
> > }
> >
> This is a bit unclear to me does devm_clk_get take care of clk
> disabling
> in case of probe error or driver removal?
>
> I see Andy's 1cb715ca4694 ("i2c-designware: move to managed functions
> (devm_*)") removed it but at quick look drivers/clk/clk-devres.c:
> devm_clk_release() calls only clk_put and I don't see disable is done
> down the path.
The following is a mistake of the mentioned patch.
- clk_disable_unprepare(dev->clk);
I did at the same mistake in dw_dmac driver which had been fixed later
in the commit 8be4f523b480 ("dmaengine: dw: fix regression in dw_probe()
function").
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
WARNING: multiple messages have this Message-ID (diff)
From: andriy.shevchenko@linux.intel.com (Andy Shevchenko)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare
Date: Wed, 20 Apr 2016 17:16:00 +0300 [thread overview]
Message-ID: <1461161760.6620.306.camel@linux.intel.com> (raw)
In-Reply-To: <57177C32.4090000@linux.intel.com>
On Wed, 2016-04-20 at 15:55 +0300, Jarkko Nikula wrote:
> On 04/14/2016 03:53 PM, Jisheng Zhang wrote:
> >
> > If i2c_dw_probe() fail, we should call i2c_dw_plat_prepare_clk() to
> > disable and unprepare the clk, otherwise the clk enable and prepare
> > is left unbalanced.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> > ---
> > ? drivers/i2c/busses/i2c-designware-platdrv.c | 2 ++
> > ? 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c
> > b/drivers/i2c/busses/i2c-designware-platdrv.c
> > index 00f9e99..1488cea 100644
> > --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> > +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> > @@ -268,6 +268,8 @@ rpm_disable:
> > ?? pm_runtime_put_noidle(&pdev->dev);
> > ?? }
> >
> > + i2c_dw_plat_prepare_clk(dev, false);
> > +
> > ?? return r;
> > ? }
> >
> This is a bit unclear to me does devm_clk_get take care of clk
> disabling?
> in case of probe error or driver removal?
>
> I see Andy's 1cb715ca4694 ("i2c-designware: move to managed functions?
> (devm_*)") removed it but at quick look drivers/clk/clk-devres.c:?
> devm_clk_release() calls only clk_put and I don't see disable is done?
> down the path.
The following is a mistake of the mentioned patch.
-???????clk_disable_unprepare(dev->clk);
I did at the same mistake in dw_dmac driver which had been fixed later
in the commit 8be4f523b480 ("dmaengine: dw: fix regression in dw_probe()
function").
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
next prev parent reply other threads:[~2016-04-20 14:15 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 12:53 [PATCH 0/4] i2c: designware: runtime pm fix and improve Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-14 12:53 ` [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM initialization Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-20 13:53 ` Jarkko Nikula
2016-04-20 13:53 ` Jarkko Nikula
2016-04-21 3:08 ` Jisheng Zhang
2016-04-21 3:08 ` Jisheng Zhang
2016-04-21 3:08 ` Jisheng Zhang
2016-04-21 7:48 ` Jarkko Nikula
2016-04-21 7:48 ` Jarkko Nikula
2016-04-21 8:15 ` Jisheng Zhang
2016-04-21 8:15 ` Jisheng Zhang
2016-04-21 8:15 ` Jisheng Zhang
2016-04-14 12:53 ` [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-20 12:55 ` Jarkko Nikula
2016-04-20 12:55 ` Jarkko Nikula
2016-04-20 14:16 ` Andy Shevchenko [this message]
2016-04-20 14:16 ` Andy Shevchenko
2016-04-21 2:40 ` Jisheng Zhang
2016-04-21 2:40 ` Jisheng Zhang
2016-04-21 2:40 ` Jisheng Zhang
2016-04-21 7:39 ` Jarkko Nikula
2016-04-21 7:39 ` Jarkko Nikula
2016-04-21 8:19 ` Jisheng Zhang
2016-04-21 8:19 ` Jisheng Zhang
2016-04-21 8:19 ` Jisheng Zhang
2016-04-14 12:53 ` [PATCH 3/4] i2c: designware-pcidrv: enable RuntimePM before registering to the core Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-20 13:03 ` Jarkko Nikula
2016-04-20 13:03 ` Jarkko Nikula
2016-04-14 12:53 ` [PATCH 4/4] i2c: designware: remove runtime suspend prevention during registration Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
2016-04-14 12:53 ` Jisheng Zhang
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=1461161760.6620.306.camel@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jszhang@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=wsa@the-dreams.de \
/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
Be 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.