linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Justin Piszcz" <jpiszcz@lucidpixels.com>
To: "'LKML'" <linux-kernel@vger.kernel.org>,
	<linux-usb@vger.kernel.org>, <linux-scsi@vger.kernel.org>
Subject: 5.2.x kernel: WD 8TB USB Drives: Unaligned partial completion (resid=78, sector_sz=512)
Date: Sat, 3 Aug 2019 05:10:44 -0400	[thread overview]
Message-ID: <006d01d549db$54e42140$feac63c0$@lucidpixels.com> (raw)

Attached 2 x brand new Western Digital 8TB USB 3.0 drives awhile back and
ran some file copy tests and was getting these warnings-- is there any way
to avoid these warnings?  I did confirm with parted that the partition was
aligned but this appears to be something related to the firmware on the
device according to [1] and [2]?

[1] https://patchwork.kernel.org/patch/9573203/
[2] https://patchwork.kernel.org/patch/9597797/

Part of the patch in [2] - if the firmware is buggy is there a patch or
workaround for these drives (when used in the USB enclosures) to avoid this
issue?

+	default:
+		/*
+		 * In case of bogus fw or device, we could end up having
+		 * an unaligned partial completion. Check this here and
force
+		 * alignment.
+		 */
+		resid = scsi_get_resid(SCpnt);
+		if (resid & (sector_size - 1)) {
+			sd_printk(KERN_INFO, sdkp,
+				"Unaligned partial completion (resid=%u,
sector_sz=%u)\n",
+				resid, sector_size);
+			resid = min(scsi_bufflen(SCpnt),
+				    round_up(resid, sector_size));
+			scsi_set_resid(SCpnt, resid);
+		}

Errors:

Jul 18 16:25:02 name kernel: [87305.605993] sd 8:0:0:0: [sdg] Unaligned
partial completion (resid=78, sector_sz=512)
Jul 18 16:25:02 name kernel: [87305.605993] sd 8:0:0:0: [sdg] Unaligned
partial completion (resid=78, sector_sz=512)

Jul 18 16:25:15 name kernel: [87318.292262] sd 7:0:0:0: [sdf] Unaligned
partial completion (resid=78, sector_sz=512)
Jul 18 16:25:15 name kernel: [87318.292262] sd 7:0:0:0: [sdf] Unaligned
partial completion (resid=78, sector_sz=512)



             reply	other threads:[~2019-08-03  9:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-03  9:10 Justin Piszcz [this message]
2019-08-03 11:36 ` 5.2.x kernel: WD 8TB USB Drives: Unaligned partial completion (resid=78, sector_sz=512) Markus Reichelt
2019-08-03 19:00 ` Alan Stern
2019-08-03 19:37   ` Justin Piszcz
2019-08-08  2:03 ` Martin K. Petersen
2019-08-08  8:27   ` Justin Piszcz
2019-08-13  2:12     ` Martin K. Petersen
2019-08-13  3:47       ` Damien Le Moal
2019-08-13 10:48       ` Damien Le Moal
2019-08-13 20:58         ` Justin Piszcz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006d01d549db$54e42140$feac63c0$@lucidpixels.com' \
    --to=jpiszcz@lucidpixels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).