From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Gao Pan <b54642-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
B20596-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
b38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org,
u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org
Subject: Re: [Patch V3] i2c: imx: add runtime pm support to improve the performance
Date: Tue, 11 Aug 2015 17:04:50 +0200 [thread overview]
Message-ID: <20150811150450.GC1525@katana> (raw)
In-Reply-To: <1438565394-4599-1-git-send-email-b54642-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]
On Mon, Aug 03, 2015 at 09:29:54AM +0800, Gao Pan wrote:
> In our former i2c driver, i2c clk is enabled and disabled in
> xfer function, which contributes to power saving. However,
> the clk enable process brings a busy wait delay until the core
> is stable. As a result, the performance is sacrificed.
>
> To weigh the power consumption and i2c bus performance, runtime
> pm is the good solution for it. The clk is enabled when a i2c
> transfer starts, and disabled after a specifically defined delay.
>
> Without the patch the test case (many eeprom reads) executes with approx:
> real 1m7.735s
> user 0m0.488s
> sys 0m20.040s
>
> With the patch the same test case (many eeprom reads) executes with approx:
> real 0m54.241s
> user 0m0.440s
> sys 0m5.920s
>
> From the test result, the patch get better performance.
>
> ---
> V2:
> As Uwe Kleine-König's suggestion, the version do below changes:
> - call clk_prepare_enable in probe to avoid never enabling clock
> if CONFIG_PM is disabled
> - enable clock before request IRQ in probe
> - remove the pm staff in i2c_imx_isr
>
> V3:
> - pm_runtime_get_sync returns < 0 as error
>
> Signed-off-by: Fugang Duan <B38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
> Signed-off-by: Gao Pan <b54642-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
The signed-off lines should be before the "---" line.
Applied to for-next, thanks!
> ---
A second "---" line is not a good idea. Many workflow scripts will
break.
> static struct platform_driver i2c_imx_driver = {
> - .probe = i2c_imx_probe,
> - .remove = i2c_imx_remove,
> - .driver = {
> + .probe = i2c_imx_probe,
> + .remove = i2c_imx_remove,
> + .driver = {
> .name = DRIVER_NAME,
> + .pm = I2C_IMX_PM_OPS,
> .of_match_table = i2c_imx_dt_ids,
> },
> .id_table = imx_i2c_devtype,
I fixed this to use one space as an indentation and no tabs. Experience
shows this is more future-proof.
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2015-08-11 15:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-03 1:29 [Patch V3] i2c: imx: add runtime pm support to improve the performance Gao Pan
[not found] ` <1438565394-4599-1-git-send-email-b54642-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2015-08-11 15:04 ` Wolfram Sang [this message]
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=20150811150450.GC1525@katana \
--to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=B20596-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=b38611-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=b54642-KZfg59tc24xl57MIdRCFDg@public.gmane.org \
--cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).