Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1211276ybh; Sat, 3 Aug 2019 20:43:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYYMro4bE9u0y/k1uBTV407bhfuKiyDOS3sNoAw59XxW0DHz/MdhM5ISq1Dsj3Oa3TKpxd X-Received: by 2002:a17:90a:a489:: with SMTP id z9mr11502093pjp.24.1564890201638; Sat, 03 Aug 2019 20:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564890201; cv=none; d=google.com; s=arc-20160816; b=x64X/PESsEMFqDgzkZbYHhGgWCZLd+4Ce8CCrbtgd2MLfMjlNTLgkwE/lrzgBgHSXL RgziOjkl++EQzV73PnOOo9/rxpKm1SkU5CjtxJ5Pl76r6hcTu2aRDamdnNc/ULAmGTyC odwMNNGpd+o6sujUc6HDiH+2M+ZaEKgVIjxpvLFQQjbotO9GbGKrRoorUQyf64qnGdYD Hjltds94lMsa7lUjEAh6CATlBszXyymetgw/MLVHB3DjnaRdxKpnWT1wzaoMHEe2iZOS nQUY9NCGYO3ozktEnl1MEemawy9SD/2iB5xEoMeWt5QaW0Grg/+B8ENiq4L78ql1kW0D ydDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=qQom3GO58JIRe2aXkvMMOSscNsxTRtNMAxNQesThGtQ=; b=wjYUSXV8cswPL1iW2Pfy756wnIB1FDg0Yei0mPLA0BJL1Hiiw5/9WyP+vUSZ7VgZbR Q+YlXEIJRVY7+2Nf7lNSnENmzARrg/SyFSBj+xgCylbLuIBdK6t4n4ca7tO1FHMUR1lD XKMzuf408+qPhkwMvhvqgEmjvvqkezATrXe9K86bc10u722/Z7dCK2eWe6RCG8EyJU0o m1EXq8POc+JYRduHuki02toerIK4nSegg9D9Xq/8+SmCjAPIxcbuvA5WqFvxfIs7UBI/ +Vu6Uh6lcDTlX6s0PVoqs0IIXw/TS3SNhGuwwWfsJEb2xnYfA8iEAeasVlfwFn6istvp eMKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u13si17276550pgf.382.2019.08.03.20.43.06; Sat, 03 Aug 2019 20:43:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389988AbfHCLpZ (ORCPT + 99 others); Sat, 3 Aug 2019 07:45:25 -0400 Received: from mail.antaris-organics.com ([91.227.220.155]:45350 "EHLO mail.antaris-organics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389812AbfHCLpY (ORCPT ); Sat, 3 Aug 2019 07:45:24 -0400 X-Greylist: delayed 556 seconds by postgrey-1.27 at vger.kernel.org; Sat, 03 Aug 2019 07:45:23 EDT Date: Sat, 3 Aug 2019 13:36:06 +0200 From: Markus Reichelt To: Justin Piszcz Cc: 'LKML' , linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org Subject: Re: 5.2.x kernel: WD 8TB USB Drives: Unaligned partial completion (resid=78, sector_sz=512) Message-ID: <20190803113606.GB3746@pc21.mareichelt.com> Mail-Followup-To: Justin Piszcz , 'LKML' , linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org References: <006d01d549db$54e42140$feac63c0$@lucidpixels.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <006d01d549db$54e42140$feac63c0$@lucidpixels.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I can reproduce this with kernel 5.2.2 and a WD drive (WD40EZRZ-22GXCB0) in a USB 3.0 enclosure featuring a JMicron SATA Bridge (ID 152d:2329) I'm also interested in getting rid of the warnings. * Justin Piszcz wrote: > 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) -- left blank, right bald