Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8df150c authored by Corey Minyard's avatar Corey Minyard
Browse files

ipmi: Fix attention handling for system interfaces



If an attention came in while handling a message response, it
could cause the state machine to go into the wrong mode and lock
things up if the state machine wasn't in normal mode.  So if the
state machine is not in normal mode, save the attention flag for
later.

Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
Tested-by: default avatarTony Rex <tony.rex@ericsson.com>
Tested-by: default avatarMagnus Johansson E <magnus.e.johansson@ericsson.com>
Cc: Per Fogelström <per.fogelstrom@ericsson.com>
parent d9b7e4f7
Loading
Loading
Loading
Loading
+30 −15
Original line number Diff line number Diff line
@@ -262,6 +262,11 @@ struct smi_info {
	 */
	bool supports_event_msg_buff;

	/*
	 * Did we get an attention that we did not handle?
	 */
	bool got_attn;

	/* From the get device id response... */
	struct ipmi_device_id device_id;

@@ -813,9 +818,18 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
	 * We prefer handling attn over new messages.  But don't do
	 * this if there is not yet an upper layer to handle anything.
	 */
	if (likely(smi_info->intf) && si_sm_result == SI_SM_ATTN) {
	if (likely(smi_info->intf) &&
	    (si_sm_result == SI_SM_ATTN || smi_info->got_attn)) {
		unsigned char msg[2];

		if (smi_info->si_state != SI_NORMAL) {
			/*
			 * We got an ATTN, but we are doing something else.
			 * Handle the ATTN later.
			 */
			smi_info->got_attn = true;
		} else {
			smi_info->got_attn = false;
			smi_inc_stat(smi_info, attentions);

			/*
@@ -833,6 +847,7 @@ static enum si_sm_result smi_event_handler(struct smi_info *smi_info,
			smi_info->si_state = SI_GETTING_FLAGS;
			goto restart;
		}
	}

	/* If we are currently idle, try to start the next message. */
	if (si_sm_result == SI_SM_IDLE) {