Skip to content

Commit 6d2555c

Browse files
ZhangYuchenLCRcminyard
authored andcommitted
ipmi: fix SSIF not responding under certain cond.
The ipmi communication is not restored after a specific version of BMC is upgraded on our server. The ipmi driver does not respond after printing the following log: ipmi_ssif: Invalid response getting flags: 1c 1 I found that after entering this branch, ssif_info->ssif_state always holds SSIF_GETTING_FLAGS and never return to IDLE. As a result, the driver cannot be loaded, because the driver status is checked during the unload process and must be IDLE in shutdown_ssif(): while (ssif_info->ssif_state != SSIF_IDLE) schedule_timeout(1); The process trigger this problem is: 1. One msg timeout and next msg start send, and call ssif_set_need_watch(). 2. ssif_set_need_watch()->watch_timeout()->start_flag_fetch() change ssif_state to SSIF_GETTING_FLAGS. 3. In msg_done_handler() ssif_state == SSIF_GETTING_FLAGS, if an error message is received, the second branch does not modify the ssif_state. 4. All retry action need IS_SSIF_IDLE() == True. Include retry action in watch_timeout(), msg_done_handler(). Sending msg does not work either. SSIF_IDLE is also checked in start_next_msg(). 5. The only thing that can be triggered in the SSIF driver is watch_timeout(), after destory_user(), this timer will stop too. So, if enter this branch, the ssif_state will remain SSIF_GETTING_FLAGS and can't send msg, no timer started, can't unload. We did a comparative test before and after adding this patch, and the result is effective. Fixes: 2593070 ("ipmi: Add SMBus interface driver (SSIF)") Cc: [email protected] Signed-off-by: Zhang Yuchen <[email protected]> Message-Id: <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 6ce7995 commit 6d2555c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,9 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
786786
} else if (data[0] != (IPMI_NETFN_APP_REQUEST | 1) << 2
787787
|| data[1] != IPMI_GET_MSG_FLAGS_CMD) {
788788
/*
789-
* Don't abort here, maybe it was a queued
790-
* response to a previous command.
789+
* Recv error response, give up.
791790
*/
791+
ssif_info->ssif_state = SSIF_IDLE;
792792
ipmi_ssif_unlock_cond(ssif_info, flags);
793793
dev_warn(&ssif_info->client->dev,
794794
"Invalid response getting flags: %x %x\n",

0 commit comments

Comments
 (0)