From: Sonny Rao <sonnyrao-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
"Ben Dooks (embedded platforms)"
<ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org>
Subject: Re: [RFC][PATCH] Enable async suspend/resume of i2c devices
Date: Wed, 6 Apr 2011 01:16:07 -0700 [thread overview]
Message-ID: <BANLkTimaRdRNOYM43AhjrU70o=GL0Q-D-A@mail.gmail.com> (raw)
In-Reply-To: <20110406095240.410b4e7e-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
On Wed, Apr 6, 2011 at 12:52 AM, Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org> wrote:
> On Wed, 6 Apr 2011 06:23:35 +0100, Mark Brown wrote:
>> On Mon, Apr 04, 2011 at 08:47:01PM -0700, Sonny Rao wrote:
>> > This improves our resume time when we have devices on an i2c bus
>> > that are slow to resume. In particular we have a light sensor that
>> > adds about 50ms of resume time on one device. We have to enable it
>> > both on the i2c master and i2c client side and then we get fully async
>> > suspend/resume. I suspect we'll see nice gains on systems with more
>> > i2c devices and will test that out soon.
>> >
>> > Signed-off-by: Sonny Rao <sonnyrao-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
>>
>> It'd probably help if the patch explained why this is safe - my
>> immediate question is why if it's safe to just unconditionally enable
>> async suspend for all I2C clients and adaptors it's not safe to do so
>> for all devices of all types?
>
> I have exactly the same concern. From
> Documentation/ABI/testing/sysfs-devices-power:
>
> It generally is unsafe to permit the asynchronous suspend/resume
> of a device unless it is certain that all of the PM dependencies
> of the device are known to the PM core. However, for some
> devices this attribute is set to "enabled" by bus type code or
> device drivers and in that cases it should be safe to leave the
> default value.
>
> As I don't see any code being added to guarantee that "all of the PM
> dependencies of the device are known to the PM core", I am skeptical
> about the general correctness of the proposed change.
>
> On the other hand, a quick grep on the kernel tree shows that the scsi,
> usb and pci subsystem enable async suspend unconditionally for all
> devices. This seems quite contradictory with the quoted statement
> above. Rafael, can you please clarify? Is the attribute description too
> alarmist, or are the subsystems too optimistic? ;)
Yeah, this is sort of why I made the change at this level.
I originally wrote a patch which just enabled it for the particular
sensor, but it didn't match with the other uses of that function
in the kernel which did things to entire subsystems like you
point out. So, I re-wrote it in the optimistic hope that this was safe
just like USB/PCI/SCSI seem to be.
> Original post for reference:
> http://marc.info/?l=linux-i2c&m=130206741920878&w=2
>
> Sonny, on how many systems did you test it? In particular, did you test
> it on several TV cards (which use I2C a lot and sometimes in complex
> setups)?
It has only been tested on my x86 system with the light sensor and
lightly tested on an ARM system with about 6-7 i2c devices. I was hoping
the change would help the ARM systems because they make much
heavier use of i2c than the x86 system. I haven't tested on anything
like multiple TV cards because I don't have such a setup -- the ARM
boxes with several i2c devices is the most complex user of i2c I have
at the moment.
Sonny
next prev parent reply other threads:[~2011-04-06 8:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 3:47 [RFC][PATCH] Enable async suspend/resume of i2c devices Sonny Rao
[not found] ` <BANLkTik7i0VQpJb+enUd9c4-XvZQ1S57fQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-06 5:23 ` Mark Brown
[not found] ` <20110406052335.GA25578-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2011-04-06 6:51 ` Sonny Rao
2011-04-06 7:52 ` Jean Delvare
[not found] ` <20110406095240.410b4e7e-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-04-06 8:16 ` Sonny Rao [this message]
[not found] ` <BANLkTimaRdRNOYM43AhjrU70o=GL0Q-D-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-06 8:23 ` Jean Delvare
2011-04-06 14:49 ` [linux-pm] " Alan Stern
[not found] ` <Pine.LNX.4.44L0.1104061043220.1907-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2011-04-06 22:31 ` Mark Brown
[not found] ` <20110406223123.GA5297-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-04-06 23:08 ` Sonny Rao
[not found] ` <BANLkTikApnXBtP7c=QLEvM9ye=_YZiSSqw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-07 5:22 ` Rafael J. Wysocki
[not found] ` <201104070722.44771.rjw-KKrjLPT3xs0@public.gmane.org>
2011-04-07 6:45 ` Sonny Rao
2011-04-07 7:55 ` Jean Delvare
[not found] ` <20110407095513.4c0b708e-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-04-07 8:00 ` Mark Brown
[not found] ` <20110407080042.GF14519-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-04-07 8:25 ` Jean Delvare
[not found] ` <20110407102544.4c34dfeb-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2011-04-07 14:34 ` Alan Stern
2011-04-07 8:19 ` Sonny Rao
[not found] ` <BANLkTikDc6QhtK6F5VTX4iCkT0CAiXvztg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-07 8:33 ` Jean Delvare
2011-04-07 5:18 ` Rafael J. Wysocki
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='BANLkTimaRdRNOYM43AhjrU70o=GL0Q-D-A@mail.gmail.com' \
--to=sonnyrao-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
--cc=ben-linux-elnMNo+KYs3YtjvyW6yDsg@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=rjw-KKrjLPT3xs0@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).