dm: monotor: bugfix: update wakeup reason before call recume() callback
In handle_resume(), wakeup_reason is updated before call ops->ops->resume(). Because ops->ops->resume() needs to know the latest wakeup reason. Acked-by: Yan Like <like.yan@intel.com> Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
parent
a86a25f369
commit
b0861621d9
|
@ -168,6 +168,8 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
|
|||
ack.msgid = msg->msgid;
|
||||
ack.timestamp = msg->timestamp;
|
||||
|
||||
wakeup_reason = msg->data.reason;
|
||||
|
||||
LIST_FOREACH(ops, &vm_ops_head, list) {
|
||||
if (ops->ops->resume) {
|
||||
ret += ops->ops->resume(ops->arg);
|
||||
|
@ -181,8 +183,6 @@ static void handle_resume(struct mngr_msg *msg, int client_fd, void *param)
|
|||
} else
|
||||
ack.data.err = ret;
|
||||
|
||||
wakeup_reason = msg->data.reason;
|
||||
|
||||
mngr_send_msg(client_fd, &ack, NULL, ACK_TIMEOUT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue