All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] PM / ACPI / i2c: Fix system suspend and deploy runtime PM centric path for ACPI
@ 2017-06-21 19:21 ` Ulf Hansson
  0 siblings, 0 replies; 84+ messages in thread
From: Ulf Hansson @ 2017-06-21 19:21 UTC (permalink / raw)
  To: Wolfram Sang, Rafael J . Wysocki, Len Brown, linux-acpi, linux-pm
  Cc: Kevin Hilman, Jarkko Nikula, Andy Shevchenko, Mika Westerberg,
	Jisheng Zhang, John Stultz, Guodong Xu, Sumit Semwal,
	Haojian Zhuang, linux-arm-kernel, linux-i2c, Ulf Hansson

The i2c designware platform driver, drivers/i2c/busses/i2c-designware-platdrv.c,
currently suffers from a regression, which easily can be triggerd during system
suspend/resume.

In particular the regression concerns those SoCs, which doesn't have the i2c
device being attached to the ACPI PM domain.

The regression, introduced in commit 8503ff166504 ("i2c: designware: Avoid
unnecessary resuming during system suspend"), takes advantage of the so called
direct_complete path during system sleep, which works well when using the ACPI
PM domain, however as stated, that's not the case for other SoCs.

In this series, patch 1, takes a very simplistic approach to solve the problem
and the change is limited to the i2c driver itself. The aim with this change is
to make it acceptable as a fix for v4.2+.

However, patch 1 is unfortunate also reverting back to the old behaviour,
avoiding the direct_complete path, by always runtime resuming the device in the
device_prepare() phase during system sleep. In many cases this is a waste,
especially when the device could have remained runtime suspended during the
entire system sleep sequence.

The rest of the changes in this series, addresses the above problem, avoiding
to runtime resume the device unless it's really needed. One could have tried
out other local hacks, limited to the i2c driver, but I believe the problem
could exist for other drivers/devices as well, thus I aim for a more generic
solution.

In principle, this series enables the proven runtime PM centric approach to
implement system sleep in the i2c driver. However, to do that the ACPI PM
domain have to collaborate and understand this behaviour. Therefore a number of
changes, patch 2 to patch 8, makes the needed changes to the ACPI PM domain.
In the last change, patch9, the i2c driver converts to the runtime PM centric
approach.

It shall be noted, the behaviour of the ACPI PM domain should remain intact,
still taking benefit of using the direct_complete path during system sleep,
except for those devices that explicitly request it not to.

This series has been tested on an ARM64 Hikey board, not having its i2c device
attach to the ACPI PM domain. This means that the ACPI changes has so far only
been compile tested. Any help in testing on relevant Intel SoCs is greatly
appreciated and so is of course review comments.

The series is based upon Rafael's pm tree and linux-next branch. It's also
available at the following git:

git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc.git acpi_pm_i2c_rpm_path

Kind regards
Ulf Hansson


Ulf Hansson (9):
  i2c: designware: Fix system suspend
  PM / ACPI: Restore acpi_subsys_complete()
  PM / Sleep: Remove pm_complete_with_resume_check()
  PM / ACPI: Split code validating need for runtime resume in
    ->prepare()
  PM / ACPI: Split acpi_lpss_suspend_late|resume_early()
  PM / ACPI: Provide option to disable direct_complete for ACPI devices
  PM / ACPI: Enable the runtime PM centric approach for system sleep
  PM / ACPI: Avoid runtime resuming device in
    acpi_subsys_suspend|freeze()
  i2c: designware: Deploy the runtime PM centric approach for system
    sleep

 drivers/acpi/acpi_lpss.c                    |  81 ++++++++++----
 drivers/acpi/device_pm.c                    | 164 ++++++++++++++++++++++++----
 drivers/base/power/generic_ops.c            |  23 ----
 drivers/i2c/busses/i2c-designware-platdrv.c |  32 ++----
 include/acpi/acpi_bus.h                     |   1 +
 include/linux/acpi.h                        |   4 +
 include/linux/pm.h                          |   1 -
 7 files changed, 219 insertions(+), 87 deletions(-)

-- 
2.7.4


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

end of thread, other threads:[~2017-09-12  9:44 UTC | newest]

Thread overview: 84+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-21 19:21 [PATCH 0/9] PM / ACPI / i2c: Fix system suspend and deploy runtime PM centric path for ACPI Ulf Hansson
2017-06-21 19:21 ` Ulf Hansson
2017-06-21 19:21 ` [PATCH 1/9] i2c: designware: Fix system suspend Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 23:31   ` Rafael J. Wysocki
2017-06-21 23:31     ` Rafael J. Wysocki
2017-06-22 10:49     ` Mika Westerberg
2017-06-22 10:49       ` Mika Westerberg
2017-06-22 11:16       ` Jarkko Nikula
2017-06-22 11:16         ` Jarkko Nikula
2017-06-27  7:55         ` Jarkko Nikula
2017-06-27  7:55           ` Jarkko Nikula
2017-06-28 14:01           ` Ulf Hansson
2017-06-28 14:01             ` Ulf Hansson
2017-06-28 14:51             ` Rafael J. Wysocki
2017-06-28 14:51               ` Rafael J. Wysocki
2017-06-28 15:06               ` Ulf Hansson
2017-06-28 15:06                 ` Ulf Hansson
2017-06-22 14:41       ` Rafael J. Wysocki
2017-06-22 14:41         ` Rafael J. Wysocki
2017-06-22 21:37         ` Ulf Hansson
2017-06-22 21:37           ` Ulf Hansson
2017-06-22 22:01           ` Rafael J. Wysocki
2017-06-22 22:01             ` Rafael J. Wysocki
2017-06-26 16:49             ` Ulf Hansson
2017-06-26 16:49               ` Ulf Hansson
2017-06-26 19:39               ` Grygorii Strashko
2017-06-26 19:39                 ` Grygorii Strashko
2017-06-26 21:11                 ` Rafael J. Wysocki
2017-06-26 21:11                   ` Rafael J. Wysocki
2017-06-27  7:33                   ` Jarkko Nikula
2017-06-27  7:33                     ` Jarkko Nikula
2017-06-27 15:25                   ` Rafael J. Wysocki
2017-06-27 15:25                     ` Rafael J. Wysocki
2017-06-28 14:31                 ` Ulf Hansson
2017-06-28 14:31                   ` Ulf Hansson
2017-06-28 16:52                   ` Grygorii Strashko
2017-06-28 16:52                     ` Grygorii Strashko
2017-09-08  3:23   ` [1/9] " Wangtao (Kevin, Kirin)
2017-09-08  3:23     ` Wangtao (Kevin, Kirin)
2017-09-08  8:29     ` Ulf Hansson
2017-09-08  8:29       ` Ulf Hansson
2017-09-12  9:44       ` Wangtao (Kevin, Kirin)
2017-09-12  9:44         ` Wangtao (Kevin, Kirin)
2017-06-21 19:21 ` [PATCH 2/9] PM / ACPI: Restore acpi_subsys_complete() Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 19:21 ` [PATCH 3/9] PM / Sleep: Remove pm_complete_with_resume_check() Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 19:21 ` [PATCH 4/9] PM / ACPI: Split code validating need for runtime resume in ->prepare() Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 21:35   ` Rafael J. Wysocki
2017-06-21 21:35     ` Rafael J. Wysocki
2017-06-21 19:21 ` [PATCH 5/9] PM / ACPI: Split acpi_lpss_suspend_late|resume_early() Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 19:21 ` [PATCH 6/9] PM / ACPI: Provide option to disable direct_complete for ACPI devices Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 21:42   ` Rafael J. Wysocki
2017-06-21 21:42     ` Rafael J. Wysocki
2017-06-22  9:35     ` Ulf Hansson
2017-06-22  9:35       ` Ulf Hansson
2017-06-22 14:38       ` Rafael J. Wysocki
2017-06-22 14:38         ` Rafael J. Wysocki
2017-06-22 21:29         ` Ulf Hansson
2017-06-22 21:29           ` Ulf Hansson
2017-06-22 21:33           ` Rafael J. Wysocki
2017-06-22 21:33             ` Rafael J. Wysocki
2017-06-21 19:21 ` [PATCH 7/9] PM / ACPI: Enable the runtime PM centric approach for system sleep Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 21:47   ` Rafael J. Wysocki
2017-06-21 21:47     ` Rafael J. Wysocki
2017-06-22  9:42     ` Ulf Hansson
2017-06-22  9:42       ` Ulf Hansson
2017-06-22 14:32       ` Rafael J. Wysocki
2017-06-22 14:32         ` Rafael J. Wysocki
2017-06-22 21:14         ` Ulf Hansson
2017-06-22 21:14           ` Ulf Hansson
2017-06-22 21:28           ` Rafael J. Wysocki
2017-06-22 21:28             ` Rafael J. Wysocki
2017-06-21 19:21 ` [PATCH 8/9] PM / ACPI: Avoid runtime resuming device in acpi_subsys_suspend|freeze() Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 19:21 ` [PATCH 9/9] i2c: designware: Deploy the runtime PM centric approach for system sleep Ulf Hansson
2017-06-21 19:21   ` Ulf Hansson
2017-06-21 22:39 ` [PATCH 0/9] PM / ACPI / i2c: Fix system suspend and deploy runtime PM centric path for ACPI John Stultz
2017-06-21 22:39   ` John Stultz

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.