public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* i2c imx: suspicious use of runtime PM calls
@ 2015-08-22 21:42 Heiner Kallweit
       [not found] ` <55D8ECBA.6050505-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Heiner Kallweit @ 2015-08-22 21:42 UTC (permalink / raw)
  To: Gao Pan; +Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Wolfram Sang

Just by chance I stumbled across this driver and the recently added runtime PM code.
Two things in i2c_imx_probe look suspicious to me:

- You activate the I2C clock and then initialize runtime PM with

    pm_runtime_enable(&pdev->dev);
    pm_runtime_set_autosuspend_delay(&pdev->dev, I2C_PM_TIMEOUT);
    pm_runtime_use_autosuspend(&pdev->dev);

  Seems like a call to pm_runtime_set_active is missing to tell runtime PM
  that the device is in status "active" now.

- You use pm_runtime_put_autosuspend (which decrements the ref count) but you don't
  get a reference before. I think you would have to use pm_runtime_get_... before
  or use pm_runtime_autosuspend.

Regards, Heiner

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-24 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-22 21:42 i2c imx: suspicious use of runtime PM calls Heiner Kallweit
     [not found] ` <55D8ECBA.6050505-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-08-24  5:08   ` Gao Pandy
     [not found]     ` <CY1PR0301MB0858E9E871CC1D399F45B1B3CF620-YrwGdl+PljlUWoKpOwApjpwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-08-24 12:09       ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox