Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1383354
| From | Jarkko Nikula <jarkko.nikula@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare |
| Date | 2016-04-20 15:00 +0200 |
| Message-ID | <rpZTz-834-13@gated-at.bofh.it> (permalink) |
| References | <rnP2i-1K8-7@gated-at.bofh.it> <rnP2i-1K8-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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.
--
Jarkko
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Jarkko Nikula <jarkko.nikula@linux.intel.com> - 2016-04-20 15:00 +0200
Re: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-04-20 16:20 +0200
Re: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Jisheng Zhang <jszhang@marvell.com> - 2016-04-21 04:50 +0200
Re: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Jarkko Nikula <jarkko.nikula@linux.intel.com> - 2016-04-21 09:50 +0200
Re: [PATCH 2/4] i2c: designware-platdrv: fix unbalanced clk enable and prepare Jisheng Zhang <jszhang@marvell.com> - 2016-04-21 10:30 +0200
csiph-web