From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Rajat Jain <rajatja@google.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
Wolfram Sang <wsa@kernel.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org, dtor@google.com
Cc: rajatxjain@gmail.com, dbasehore@chromium.org
Subject: Re: [PATCH 0/3] i2c: Enable async resume for i2c devices
Date: Fri, 22 Oct 2021 14:50:54 +0300 [thread overview]
Message-ID: <f3bdb094-cd7d-dc44-e5f2-808395c42932@linux.intel.com> (raw)
In-Reply-To: <20211022022859.1888836-1-rajatja@google.com>
On 10/22/21 5:28 AM, Rajat Jain wrote:
> PM Core allows buses and drivers to specify if they'd like their devices
> to suspend/resume synchronously or asynchronously. When resuming:
>
> 1) SYNCHRONOUS DEVICES:
> - All synchronous devices (system wide!) are resumed in a single thread,
> serially i.e. one after the other. So their resume latencies add up,
> and also, this results in unnecessary and unnatural waiting order.
>
> In my current system (total resume time ~895ms) and this is the trend
> on almost all chromebooks in the past 3-4 years (we carry patch3 in
> our tree already, without which it would be even more worse):
> https://rajatxjain.github.io/public_shared/resume_before_patches.html
> As you can see I2C devices do not even begin to resume until 450ms,
> waiting unnaturally for another device i915 to finish resuming:
>
> I2C touchscreen device (resume latency = 374 ms) - asynchronous
> -> (waiting on) I2C adapter resume (synchronous)
> -> (waiting on) Designware resume (synchronous)
> -> (waiting on) intel_backlight resume (synchronous)
> -> (waiting on) its PARENT i915 resume (asynchronous resume
> time = 376ms)
> As you can see the two biggest resume routines are both run serially
> after one another (even though they don't have any real dependency)
> thus increasing the system critical resume path. If we can run them
> concurrently, we can cut down the system resume time considerably.
>
> 2) ASYNCHRONOUS DEVICES:
> - On the other hand, all asynchronous devices's resume routines are
> scheduled so they can run in parallel with other asynchronous
> routines. PM core still ensures for both async/sync devices that:
> - All parent child relations are honored.
> - Any device dependencies are honored. Device dependencies between
> any 2 unrelated devices can be specified using device_link_add().
> - Async resume devices are sychnronized at the end of each
> suspend/resume phase, before moving onto next.
>
> With these patches in place, the I2C devices can resume in parallel
> with i915:
> https://rajatxjain.github.io/public_shared/resume_after_patch.html
>
> As far as I understand, the only reason we might not want a device to be
> marked for asynchronous resume is if we suspect it cannot handle
> concurrent resume with other devices, which does not look to be the
> case.
>
> This patchset marks the designware, the I2c adapters, and the i2c
> clients for asynchronous suspend/resume. In case it helps to gain any
> confidence, the patch 3 (for i2c clients) has been included and shipping
> on all our chromebooks for the past 3+ years, and has not shown any
> issues. The designware and i2c adapters should be easier.
>
> Derek Basehore (1):
> i2c: enable async suspend/resume on i2c client devices
>
> Rajat Jain (2):
> i2c: designware: Enable async suspend / resume of designware devices
> i2c: enable async suspend/resume for i2c adapters
>
I did a quick test to these three patches on one system. It has i2c-hid
compatible touchpanel and touchpad on separate I2C buses. Nothing
exploded but I don't know does it qualify as comprehensive test for
Tested-by. Perhaps it's good idea to try do changes here expose any
regressions on some use cases and systems? At least it brings good
improvements to resume time according to your measurements.
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
prev parent reply other threads:[~2021-10-22 11:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 2:28 [PATCH 0/3] i2c: Enable async resume for i2c devices Rajat Jain
2021-10-22 2:28 ` [PATCH 1/3] i2c: designware: Enable async suspend / resume of designware devices Rajat Jain
2021-10-22 11:37 ` Jarkko Nikula
2021-10-22 16:53 ` Dmitry Torokhov
2021-10-22 2:28 ` [PATCH 2/3] i2c: enable async suspend/resume for i2c adapters Rajat Jain
2021-10-22 2:28 ` [PATCH 3/3] i2c: enable async suspend/resume on i2c client devices Rajat Jain
2021-10-22 11:50 ` Jarkko Nikula [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=f3bdb094-cd7d-dc44-e5f2-808395c42932@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dbasehore@chromium.org \
--cc=dtor@google.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rajatja@google.com \
--cc=rajatxjain@gmail.com \
--cc=wsa@kernel.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).