From patchwork Wed Nov 4 20:48:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 56008 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp22398lbr; Wed, 4 Nov 2015 12:48:39 -0800 (PST) X-Received: by 10.66.246.162 with SMTP id xx2mr4356494pac.144.1446670119662; Wed, 04 Nov 2015 12:48:39 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xx1si4439166pbc.232.2015.11.04.12.48.39; Wed, 04 Nov 2015 12:48:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-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-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965722AbbKDUsh (ORCPT + 4 others); Wed, 4 Nov 2015 15:48:37 -0500 Received: from bear.ext.ti.com ([192.94.94.41]:54898 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965431AbbKDUsg (ORCPT ); Wed, 4 Nov 2015 15:48:36 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id tA4KmY3G023041; Wed, 4 Nov 2015 14:48:34 -0600 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id tA4KmYTS028816; Wed, 4 Nov 2015 14:48:34 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Wed, 4 Nov 2015 14:48:34 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id tA4KmX92007175; Wed, 4 Nov 2015 14:48:34 -0600 From: Felipe Balbi To: Linux USB Mailing List CC: Alan Stern , Matthew Dharm , Felipe Balbi Subject: [RFC PATCH 1/2] usb: storage: scsiglue: further describe our 240 sector limit Date: Wed, 4 Nov 2015 14:48:31 -0600 Message-ID: <1446670112-29088-1-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Just so we have some sort of documentation as to why we limit our Mass Storage transfers to 240 sectors, let's update the comment to make clearer that devices were found that would choke with larger transfers. While at that, also make sure to clarify that other operating systems have similar, albeit different, limits on mass storage transfers. Signed-off-by: Felipe Balbi --- Guys, how about this version ? First we update comments then, as a follow up patch, we increase USB3 only to 2048 sectors. drivers/usb/storage/scsiglue.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index dba51362d2e2..00aadf3a3857 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -565,7 +565,23 @@ static const struct scsi_host_template usb_stor_host_template = { /* lots of sg segments can be handled */ .sg_tablesize = SCSI_MAX_SG_CHAIN_SEGMENTS, - /* limit the total size of a transfer to 120 KB */ + /* + * Limit the total size of a transfer to 120 KB. + * + * Some devices are known to choke with anything larger. It seems like + * the problem stems from the fact that original IDE controllers had + * only an 8-bit register to hold the number of sectors in one transfer + * and even those couldn't handle a full 256 sectors. + * + * Because we want to make sure we interoperate with as many devices as + * possible, we will maintain a 240 sector transfer size limit for USB + * Mass Storage devices. + * + * Tests show that other operating have similar limits with Microsoft + * Windows™ 7 limitting transfers to 128 sectors for both USB2 and USB3 + * and Apple Mac OS X™ 10.11 limitting transfers to 256 sectors for USB2 + * and 2048 for USB3 devices. + */ .max_sectors = 240, /* merge commands... this seems to help performance, but