linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: sd: Improve unaligned completion resid message
@ 2019-08-28  5:35 Damien Le Moal
  2019-09-07 19:32 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Damien Le Moal @ 2019-08-28  5:35 UTC (permalink / raw)
  To: linux-scsi, Martin K . Petersen

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(+)

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);
-- 
2.21.0


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

* Re: [PATCH] scsi: sd: Improve unaligned completion resid message
  2019-08-28  5:35 [PATCH] scsi: sd: Improve unaligned completion resid message Damien Le Moal
@ 2019-09-07 19:32 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2019-09-07 19:32 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: linux-scsi, Martin K . Petersen


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!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2019-09-07 19:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28  5:35 [PATCH] scsi: sd: Improve unaligned completion resid message Damien Le Moal
2019-09-07 19:32 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).