New issue
Advanced search Search tips

Issue 789957 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

shill: avoid overlapping suspend and resume actions

Project Member Reported by benchan@chromium.org, Nov 30 2017

Issue description

After powerd notifies shill that a suspend is imminent via a SuspendImminent D-Bus signal, shill performs suspend actions, and then upon the completion of these actions, notifies powerd that it's ready to suspend via powerd's SuspendReadiness D-Bus method. Later, powerd notifies that shill a suspend attempt is completed or cancelled via a SuspendDone signal and shill performs resume actions.
    
However, powerd may notify shill the completion of a suspend attempt before shill reports its readiness to suspend (e.g. when the suspend attempt is cancelled while shill is performing the suspend actions). Currently, shill performs the resume actions before it completes the ongoing suspend actions, which may lead to erroneous behavior (e.g. as observed in b/68670487#comment8) 
 
Project Member

Comment 1 by bugdroid1@chromium.org, Dec 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/38b1bcbca317612854e10f8507e1f01fc11408f1

commit 38b1bcbca317612854e10f8507e1f01fc11408f1
Author: Ben Chan <benchan@chromium.org>
Date: Sat Dec 02 04:32:39 2017

shill: defer resume actions until after completion of ongoing suspend actions

After powerd notifies shill that a suspend is imminent via a
SuspendImminent D-Bus signal, shill performs suspend actions, and then
upon the completion of these actions, notifies powerd that it's ready to
suspend via powerd's SuspendReadiness D-Bus method. Later, powerd
notifies that shill a suspend attempt is completed or cancelled via a
SuspendDone signal and shill performs resume actions.

However, powerd may notify shill the completion of a suspend attempt
before shill reports its readiness to suspend (e.g. when the suspend
attempt is cancelled while shill is performing the suspend actions).
It's problematic if shill performs the resume actions before it
completes the ongoing suspend actions. This CL addresses this problem by
deferring the actions taken in response to powerd's SuspendDone signal
if shill is still performing suspend actions and hasn't yet reported its
readiness to suspend.

BUG= chromium:789957 
TEST=Run unit tests.
TEST=Run network_MobileSuspendResume test on a DUT with a modem.
TEST=Manually close the lid of a DUT and then quickly reopen the lid.
     Verify that shill performs resumes actions after completing suspend
     actions.

Change-Id: I97828c0ff7006816da7bba47a04a67742c269d8c
Reviewed-on: https://chromium-review.googlesource.com/800573
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/38b1bcbca317612854e10f8507e1f01fc11408f1/power_manager.cc
[modify] https://crrev.com/38b1bcbca317612854e10f8507e1f01fc11408f1/power_manager.h
[modify] https://crrev.com/38b1bcbca317612854e10f8507e1f01fc11408f1/power_manager_unittest.cc

Labels: Merge-Request-64
Status: Fixed (was: Started)
Project Member

Comment 3 by sheriffbot@chromium.org, Dec 3 2017

Labels: -Merge-Request-64 Hotlist-Merge-Approved Merge-Approved-64
Your change meets the bar and is auto-approved for M64. Please go ahead and merge the CL to branch 3282 manually. Please contact milestone owner if you have questions.
Owners: cmasso@(Android), cmasso@(iOS), kbleicher@(ChromeOS), abdulsyed@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 3 2017

Labels: merge-merged-release-R64-10176.B
The following revision refers to this bug:
  https://chromium.googlesource.com/aosp/platform/system/connectivity/shill/+/82a48d3e353fdf0e483af04fbafb54544b79f4fe

commit 82a48d3e353fdf0e483af04fbafb54544b79f4fe
Author: Ben Chan <benchan@chromium.org>
Date: Sun Dec 03 04:49:46 2017

shill: defer resume actions until after completion of ongoing suspend actions

After powerd notifies shill that a suspend is imminent via a
SuspendImminent D-Bus signal, shill performs suspend actions, and then
upon the completion of these actions, notifies powerd that it's ready to
suspend via powerd's SuspendReadiness D-Bus method. Later, powerd
notifies that shill a suspend attempt is completed or cancelled via a
SuspendDone signal and shill performs resume actions.

However, powerd may notify shill the completion of a suspend attempt
before shill reports its readiness to suspend (e.g. when the suspend
attempt is cancelled while shill is performing the suspend actions).
It's problematic if shill performs the resume actions before it
completes the ongoing suspend actions. This CL addresses this problem by
deferring the actions taken in response to powerd's SuspendDone signal
if shill is still performing suspend actions and hasn't yet reported its
readiness to suspend.

BUG= chromium:789957 
TEST=Run unit tests.
TEST=Run network_MobileSuspendResume test on a DUT with a modem.
TEST=Manually close the lid of a DUT and then quickly reopen the lid.
     Verify that shill performs resumes actions after completing suspend
     actions.

Change-Id: I97828c0ff7006816da7bba47a04a67742c269d8c
Reviewed-on: https://chromium-review.googlesource.com/800573
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>
(cherry picked from commit 38b1bcbca317612854e10f8507e1f01fc11408f1)

[modify] https://crrev.com/82a48d3e353fdf0e483af04fbafb54544b79f4fe/power_manager.cc
[modify] https://crrev.com/82a48d3e353fdf0e483af04fbafb54544b79f4fe/power_manager.h
[modify] https://crrev.com/82a48d3e353fdf0e483af04fbafb54544b79f4fe/power_manager_unittest.cc

Labels: -Merge-Approved-64 Merge-Merged
Status: Verified (was: Fixed)

Sign in to add a comment