DM: Add funciton to update PM_WAK_STS

According to ACPI spec, when system back to working mode from
S3, WAK_STS bit (15) should be set.

Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Victor Sun <victor.sun@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Yin Fengwei 2018-05-24 11:16:32 +08:00 committed by lijinxia
parent a8a27d82d0
commit 7db4c0aac9
3 changed files with 11 additions and 0 deletions

View File

@ -175,6 +175,15 @@ pm1_status_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
return 0;
}
void
pm_backto_wakeup(struct vmctx *ctx)
{
/* According to ACPI 5.0 Table 4-16: bit 15, WAK_STS should be
* set when system trasition to the working state
*/
pm1_status |= PM1_WAK_STS;
}
static int
pm1_enable_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
uint32_t *eax, void *arg)

View File

@ -622,6 +622,7 @@ vm_suspend_resume(struct vmctx *ctx)
vm_stop_watchdog(ctx);
wait_for_resume(ctx);
pm_backto_wakeup(ctx);
vm_reset_watchdog(ctx);
vm_reset(ctx);
}

View File

@ -58,5 +58,6 @@ void dsdt_indent(int levels);
void dsdt_unindent(int levels);
void sci_init(struct vmctx *ctx);
void pm_write_dsdt(struct vmctx *ctx, int ncpu);
void pm_backto_wakeup(struct vmctx *ctx);
#endif /* _ACPI_H_ */