Skip to content

Commit

Permalink
Do not send shutdown/reboot requests to dsme when update mode is active
Browse files Browse the repository at this point in the history
  • Loading branch information
spiiroin committed Jun 12, 2014
1 parent 63d67f1 commit a919eb2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions mce-dsme.c
Expand Up @@ -195,13 +195,20 @@ void request_powerup(void)
*/
void request_reboot(void)
{
if( datapipe_get_gint(update_mode_pipe) ) {
mce_log(LL_WARN, "reboot blocked; os update in progress");
goto EXIT;
}

/* Set up the message */
DSM_MSGTYPE_REBOOT_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_REBOOT_REQ);

/* Send the message */
mce_dsme_send(&msg);
mce_log(LL_DEBUG,
"DSM_MSGTYPE_REBOOT_REQ sent to DSME");
EXIT:
return;
}

/**
Expand Down Expand Up @@ -291,6 +298,11 @@ static void setup_transition_timeout(void)
*/
void request_normal_shutdown(void)
{
if( datapipe_get_gint(update_mode_pipe) ) {
mce_log(LL_WARN, "shutdown blocked; os update in progress");
goto EXIT;
}

/* Set up the message */
DSM_MSGTYPE_SHUTDOWN_REQ msg = DSME_MSG_INIT(DSM_MSGTYPE_SHUTDOWN_REQ);

Expand All @@ -299,6 +311,8 @@ void request_normal_shutdown(void)
mce_log(LL_DEBUG,
"DSM_MSGTYPE_SHUTDOWN_REQ (DSME_NORMAL_SHUTDOWN) "
"sent to DSME");
EXIT:
return;
}

/**
Expand Down

0 comments on commit a919eb2

Please sign in to comment.