public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: core: add CMD_LAST flag for error handle scsi command
@ 2023-12-14 12:29 Ye Bin
  2023-12-15  5:00 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Ye Bin @ 2023-12-14 12:29 UTC (permalink / raw)
  To: jejb, martin.petersen, linux-scsi, linux-kernel; +Cc: Ye Bin

SCSI error handle will send scsi command bypass block layer. After commit
8930a6c20791 scsi support request batching. Some LLD only writing the hardware
doorbell when necessary, after the last request was prepared.
For scsi error handle, each command waits synchronously. So each scsi command
is both the beginning and the end. So add CMD_LAST flag for error handle scsi
command.

Fixes: 8930a6c20791 ("scsi: core: add support for request batching")
Signed-off-by: Ye Bin <yebin10@huawei.com>
---
 drivers/scsi/scsi_error.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 1bac12ef238e..9e79047a1250 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -1147,6 +1147,7 @@ static enum scsi_disposition scsi_send_eh_cmnd(struct scsi_cmnd *scmd,
 	const unsigned long stall_for = msecs_to_jiffies(100);
 	int rtn;
 
+	scmd->flags |= SCMD_LAST;
 retry:
 	scsi_eh_prep_cmnd(scmd, &ses, cmnd, cmnd_size, sense_bytes);
 	shost->eh_action = &done;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: core: add CMD_LAST flag for error handle scsi command
  2023-12-14 12:29 [PATCH] scsi: core: add CMD_LAST flag for error handle scsi command Ye Bin
@ 2023-12-15  5:00 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2023-12-15  5:00 UTC (permalink / raw)
  To: Ye Bin; +Cc: jejb, martin.petersen, linux-scsi, linux-kernel

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-15  5:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-14 12:29 [PATCH] scsi: core: add CMD_LAST flag for error handle scsi command Ye Bin
2023-12-15  5:00 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox