Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1383413

Re: [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM initialization

From Jarkko Nikula <jarkko.nikula@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM initialization
Date 2016-04-20 16:00 +0200
Message-ID <rq0PD-jH-9@gated-at.bofh.it> (permalink)
References <rnP2i-1K8-7@gated-at.bofh.it> <rnP2i-1K8-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 04/14/2016 03:53 PM, Jisheng Zhang wrote:
> When pm_runtime_enable() was being called, the device's usage counter
> was 0, causing the PM layer to runtime-suspend the device.  We then
> went on to call i2c_dw_probe() on a suspended device, which could hung.
>
> Fix this by incrementing the usage counter before pm_runtime_enable().
>
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> ---
>   drivers/i2c/busses/i2c-designware-platdrv.c | 14 +++++++++++++-
>   1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
> index d656657..00f9e99 100644
> --- a/drivers/i2c/busses/i2c-designware-platdrv.c
> +++ b/drivers/i2c/busses/i2c-designware-platdrv.c
> @@ -246,6 +246,7 @@ static int dw_i2c_plat_probe(struct platform_device *pdev)
>   	if (dev->pm_runtime_disabled) {
>   		pm_runtime_forbid(&pdev->dev);
>   	} else {
> +		pm_runtime_get_noresume(&pdev->dev);
>   		pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
>   		pm_runtime_use_autosuspend(&pdev->dev);
>   		pm_runtime_set_active(&pdev->dev);

pm_runtime_enable() here after pm_runtime_set_active() shouldn't suspend 
as far as I understand which made me thinking if there is some other 
issue that cause the symptoms what you are seeing? Like race with 
runtime PM or similar.

-- 
Jarkko

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM  initialization Jarkko Nikula <jarkko.nikula@linux.intel.com> - 2016-04-20 16:00 +0200
  Re: [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM  initialization Jisheng Zhang <jszhang@marvell.com> - 2016-04-21 05:20 +0200
    Re: [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM  initialization Jarkko Nikula <jarkko.nikula@linux.intel.com> - 2016-04-21 09:50 +0200
      Re: [PATCH 1/4] i2c: designware-platdrv: Fix runtime PM  initialization Jisheng Zhang <jszhang@marvell.com> - 2016-04-21 10:30 +0200

csiph-web