Skip to content

Commit 83d8c79

Browse files
qnguyen-amperecminyard
authored andcommitted
ipmi: ssif_bmc: Fix new request loss when bmc ready for a response
Cosmo found that when there is a new request comes in while BMC is ready for a response, the complete_response(), which is called to complete the pending response, would accidentally clear out that new request and force ssif_bmc to move back to abort state again. This commit is to address that issue. Fixes: dd2bc5c ("ipmi: ssif_bmc: Add SSIF BMC driver") Reported-by: Cosmo Chou <chou.cosmo@gmail.com> Closes: https://lore.kernel.org/lkml/20250101165431.2113407-1-chou.cosmo@gmail.com/ Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com> Message-ID: <20250107034734.1842247-1-quan@os.amperecomputing.com> Signed-off-by: Corey Minyard <corey@minyard.net>
1 parent 9b6442a commit 83d8c79

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/char/ipmi/ssif_bmc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ static void complete_response(struct ssif_bmc_ctx *ssif_bmc)
292292
ssif_bmc->nbytes_processed = 0;
293293
ssif_bmc->remain_len = 0;
294294
ssif_bmc->busy = false;
295-
memset(&ssif_bmc->part_buf, 0, sizeof(struct ssif_part_buffer));
296295
wake_up_all(&ssif_bmc->wait_queue);
297296
}
298297

@@ -744,9 +743,11 @@ static void on_stop_event(struct ssif_bmc_ctx *ssif_bmc, u8 *val)
744743
ssif_bmc->aborting = true;
745744
}
746745
} else if (ssif_bmc->state == SSIF_RES_SENDING) {
747-
if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num == 0xFF)
746+
if (ssif_bmc->is_singlepart_read || ssif_bmc->block_num == 0xFF) {
747+
memset(&ssif_bmc->part_buf, 0, sizeof(struct ssif_part_buffer));
748748
/* Invalidate response buffer to denote it is sent */
749749
complete_response(ssif_bmc);
750+
}
750751
ssif_bmc->state = SSIF_READY;
751752
}
752753

0 commit comments

Comments
 (0)