diff mbox series

scsi: sd: Improve unaligned completion resid message

Message ID 20190828053511.14818-1-damien.lemoal@wdc.com (mailing list archive)
State Mainlined
Commit 670d8be28e72f984a61ccad3e9e98247c0d31e1c
Headers show
Series scsi: sd: Improve unaligned completion resid message | expand

Commit Message

Damien Le Moal Aug. 28, 2019, 5:35 a.m. UTC
For commands completing with a resid not aligned on the device logical
sector size, also print the command CDB in addition to the current
message to help debug hardware generating such incorrect command
completion information.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
 drivers/scsi/sd.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Martin K. Petersen Sept. 7, 2019, 7:32 p.m. UTC | #1
Damien,

> For commands completing with a resid not aligned on the device logical
> sector size, also print the command CDB in addition to the current
> message to help debug hardware generating such incorrect command
> completion information.

Applied to 5.4/scsi-queue. Thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 149d406aacc9..91af598f2f53 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1978,6 +1978,7 @@  static int sd_done(struct scsi_cmnd *SCpnt)
 			sd_printk(KERN_INFO, sdkp,
 				"Unaligned partial completion (resid=%u, sector_sz=%u)\n",
 				resid, sector_size);
+			scsi_print_command(SCpnt);
 			resid = min(scsi_bufflen(SCpnt),
 				    round_up(resid, sector_size));
 			scsi_set_resid(SCpnt, resid);