From: Heiner Kallweit <hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Gao Pan <b54642-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
Subject: i2c imx: suspicious use of runtime PM calls
Date: Sat, 22 Aug 2015 23:42:18 +0200 [thread overview]
Message-ID: <55D8ECBA.6050505@gmail.com> (raw)
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
next reply other threads:[~2015-08-22 21:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-22 21:42 Heiner Kallweit [this message]
[not found] ` <55D8ECBA.6050505-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-08-24 5:08 ` i2c imx: suspicious use of runtime PM calls Gao Pandy
[not found] ` <CY1PR0301MB0858E9E871CC1D399F45B1B3CF620-YrwGdl+PljlUWoKpOwApjpwN6zqB+hSMnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2015-08-24 12:09 ` Wolfram Sang
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=55D8ECBA.6050505@gmail.com \
--to=hkallweit1-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=b54642-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/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.