From patchwork Thu Sep 3 18:17:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 258650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A61AC433E2 for ; Thu, 3 Sep 2020 18:17:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3AAC20737 for ; Thu, 3 Sep 2020 18:17:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ol4d/OZL" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728885AbgICSRg (ORCPT ); Thu, 3 Sep 2020 14:17:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbgICSRf (ORCPT ); Thu, 3 Sep 2020 14:17:35 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D65FC061244 for ; Thu, 3 Sep 2020 11:17:34 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id gl3so787768pjb.1 for ; Thu, 03 Sep 2020 11:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FHbqaZpCUWjtJgK7uaYpQ4yqxTuhI8c3foqClCywaNw=; b=Ol4d/OZLLGo2AYJiTOHknzgrxjNIQYF2TeJjcMtkDo3WE7NH7XOa3/fOq5K/Ts0+o6 rXn+1scCVTygoaFcHKHGO36KP0Oimq8RtOv1MJq+0TKXT0QWm6FzKMJB72x/j9gPRqra +6qrSGyz9Nvj+nFxSziHncD2qcH3z4uisYUFOhtU+4OsrRl3WCxcLYZe0tfcmB0qsqWx AxxFwRm1A/zj+LVtWtsijFaauzFydA7oZaK2rquZuC+zfzfTgcW3iFStIfNqVLW69Seg CtG1lCcOx7P3rZ2Ck0pRJ26s8UZcpH9Codva+PdOher6MFm+Qrbmf81Cu+4CT9IHtIHq l3dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FHbqaZpCUWjtJgK7uaYpQ4yqxTuhI8c3foqClCywaNw=; b=tstXIY59ORL4AmydzMFS9lotwHPq1WlQB9oYSJowCPagWdktRTDJRAUmQA0E5NjHzx pyBlCzYbFnJ6CbDjBOJnyVlH9wjW/pJ49pXM8U8VuOauE9SxXaRiQoq+D6TqlUyScGwK CVlzm2YJuo7nLcVmoKfclclcPh60HKUeVyDb5+2+V/co+wSVaqQJDwhZiQC2mo4gb6SN 7olOV4fUPp3oIy0JW1Aw2kbyam5OhRnZVAoRQ+NO98pLDevZXg4egErf9Zo1UX4DkzG5 HVmBHzxgipF1Mv4vlAkSkiL7E45H5jA9jjOR6Y8cJWy1sF+JU2pxMmDWxMnCxiY/XQ2q NRpQ== X-Gm-Message-State: AOAM5327X0s57K3kOUhZNYJWiBHvvcO0I0hq3NhAWhUkGW8oc/tBnCh+ pNaT8nubgXARB35tk/qZkx/Yp7yyPvE= X-Google-Smtp-Source: ABdhPJwtpAjcExwxEJW1wD0UPYbuETWesbVbeRSvXheT8ebISFhzuP8D4AY2RgDcvhVw+vk7PGEhzQ== X-Received: by 2002:a17:90a:9503:: with SMTP id t3mr4439467pjo.171.1599157053543; Thu, 03 Sep 2020 11:17:33 -0700 (PDT) Received: from localhost.localdomain ([161.81.62.213]) by smtp.gmail.com with ESMTPSA id r91sm3228530pja.56.2020.09.03.11.17.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 11:17:32 -0700 (PDT) From: Tom Yan To: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, stern@rowland.harvard.edu, arnd@arndb.de Cc: cyrozap@gmail.com, yoshihiro.shimoda.uh@renesas.com, Tom Yan Subject: [PATCH v6 1/3] usb-storage: fix sdev->host->dma_dev Date: Fri, 4 Sep 2020 02:17:23 +0800 Message-Id: <20200903181725.2931-1-tom.ty89@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200903155438.GC663761@rowland.harvard.edu> References: <20200903155438.GC663761@rowland.harvard.edu> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Use scsi_add_host_with_dma() instead of scsi_add_host(). When the scsi request queue is initialized/allocated, hw_max_sectors is clamped to the dma max mapping size. Therefore, the correct device that should be used for the clamping needs to be set. The same clamping is still needed in usb-storage as hw_max_sectors could be changed there. The original clamping would be invalidated in such cases. Signed-off-by: Tom Yan Reviewed-by: Alan Stern --- v2: fix commit message line length; bump hw_max_sectors to 2048 for SS UAS drives; split the "fallback" hw_max_sectors setting into another patch v3: use a different approach: fix the dma_dev instead v4: add the changelog of the patch series v5: fix changelog line length v6: split dma_dev fix for usb-storage and uas drivers/usb/storage/scsiglue.c | 2 +- drivers/usb/storage/usb.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index e5a971b83e3f..560efd1479ba 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -92,7 +92,7 @@ static int slave_alloc (struct scsi_device *sdev) static int slave_configure(struct scsi_device *sdev) { struct us_data *us = host_to_us(sdev->host); - struct device *dev = us->pusb_dev->bus->sysdev; + struct device *dev = sdev->host->dma_dev; /* * Many devices have trouble transferring more than 32KB at a time, diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 94a64729dc27..c2ef367cf257 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -1049,8 +1049,9 @@ int usb_stor_probe2(struct us_data *us) goto BadDevice; usb_autopm_get_interface_no_resume(us->pusb_intf); snprintf(us->scsi_name, sizeof(us->scsi_name), "usb-storage %s", - dev_name(&us->pusb_intf->dev)); - result = scsi_add_host(us_to_host(us), dev); + dev_name(dev)); + result = scsi_add_host_with_dma(us_to_host(us), dev, + us->pusb_dev->bus->sysdev); if (result) { dev_warn(dev, "Unable to add the scsi host\n"); From patchwork Thu Sep 3 18:17:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 297729 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D87EC433E9 for ; Thu, 3 Sep 2020 18:17:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCB7E208CA for ; Thu, 3 Sep 2020 18:17:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SeoM7BUr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728422AbgICSRj (ORCPT ); Thu, 3 Sep 2020 14:17:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbgICSRi (ORCPT ); Thu, 3 Sep 2020 14:17:38 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E8E9C061244 for ; Thu, 3 Sep 2020 11:17:38 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id u128so2982013pfb.6 for ; Thu, 03 Sep 2020 11:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UogfL6cduRwRQNe6hBusItUBEqxEtygL++0UT6QBUJM=; b=SeoM7BUrFNVcfpcnI3XyQRqyH9Nlb2ONE+dCKfrOnFPLw6CaLkA1rydGaZUYCT7Z6s CZBYDZeB7po+re1bm1HlHPip4Gt6tS0+7IVIwjidL8EhitFNv8ztd8C9mo+6vTrHkZmn 9ntrNKC8cEEXsiIyE0nkrR/K9BVAADxOMYlWTsVwkV0PXCPlBAY03RQZaIs3QzgvSJt2 C5hEzNCz/PorW+Uxadg7edtbdC9kHmskEd5hm43GpJclxDWLYgPNa5T/U/HneEMYjPae bIXzsRx201M2pT4p6+B07mNW6mrsNi2KAtNH1zKX/p1jhj4rJY+5LbsQWp9p6phTwE0k 0N/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UogfL6cduRwRQNe6hBusItUBEqxEtygL++0UT6QBUJM=; b=DKJthHIzaKeOwroG/czygIgsrLkxYB7S8/n+Ph05pqR8w5cmHdxFkvLF37BWnhx/dH 82HG+y+teqpC3cyY5iPW2K9SZnCHWXENNzEnSNbQlPXSnphFt0MBqPxQzfhBeHdunow/ SLGTBhREF3MS3SPX3kACpZJ4Pe+VlHEXSIRXEsmH3OVE6o40we0jKoB4PjQtuLQxS+Ne 15tKSL4dLQO7ev3SjgNywu1j36GO3X8qkVbKU+/JVT/8L92K1Q/Q7HX96kqnzcj+a6z2 U8nQCVhhB9PNbktmPB8WbDXTqjrCwbp5sGg9NawVZ624s+cWklGv4Llk5BlSNLslUIhA G1wA== X-Gm-Message-State: AOAM530qPf+R6Aa3xf1fSMfC0wswlNCsAyq5WrnccQcKfCKSHbJEKBeL uX/S6wZcZWK1M9Y71TfJEpdTz+pXlFA= X-Google-Smtp-Source: ABdhPJwswXH1rLlFAXmvPvhX1wSjRm+s9t+ly6fBU8mf/p/CLs7bqQGdbhDeWrGkpoiFe7nPBD9fQQ== X-Received: by 2002:a17:902:9b8e:b029:d0:89f3:28c8 with SMTP id y14-20020a1709029b8eb02900d089f328c8mr3692362plp.4.1599157057288; Thu, 03 Sep 2020 11:17:37 -0700 (PDT) Received: from localhost.localdomain ([161.81.62.213]) by smtp.gmail.com with ESMTPSA id r91sm3228530pja.56.2020.09.03.11.17.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 11:17:36 -0700 (PDT) From: Tom Yan To: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, stern@rowland.harvard.edu, arnd@arndb.de Cc: cyrozap@gmail.com, yoshihiro.shimoda.uh@renesas.com, Tom Yan Subject: [PATCH v6 2/3] uas: fix sdev->host->dma_dev Date: Fri, 4 Sep 2020 02:17:24 +0800 Message-Id: <20200903181725.2931-2-tom.ty89@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200903181725.2931-1-tom.ty89@gmail.com> References: <20200903155438.GC663761@rowland.harvard.edu> <20200903181725.2931-1-tom.ty89@gmail.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Use scsi_add_host_with_dma() instead of scsi_add_host(). When the scsi request queue is initialized/allocated, hw_max_sectors is clamped to the dma max mapping size. Therefore, the correct device that should be used for the clamping needs to be set. The same clamping is still needed in uas as hw_max_sectors could be changed there. The original clamping would be invalidated in such cases. Signed-off-by: Tom Yan --- drivers/usb/storage/uas.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index 08f9296431e9..f4beeb8a8adb 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -827,17 +827,22 @@ static int uas_slave_alloc(struct scsi_device *sdev) */ blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1)); - if (devinfo->flags & US_FL_MAX_SECTORS_64) - blk_queue_max_hw_sectors(sdev->request_queue, 64); - else if (devinfo->flags & US_FL_MAX_SECTORS_240) - blk_queue_max_hw_sectors(sdev->request_queue, 240); - return 0; } static int uas_slave_configure(struct scsi_device *sdev) { struct uas_dev_info *devinfo = sdev->hostdata; + struct device *dev = sdev->host->dma_dev; + + if (devinfo->flags & US_FL_MAX_SECTORS_64) + blk_queue_max_hw_sectors(sdev->request_queue, 64); + else if (devinfo->flags & US_FL_MAX_SECTORS_240) + blk_queue_max_hw_sectors(sdev->request_queue, 240); + + blk_queue_max_hw_sectors(sdev->request_queue, + min_t(size_t, queue_max_hw_sectors(sdev->request_queue), + dma_max_mapping_size(dev) >> SECTOR_SHIFT)); if (devinfo->flags & US_FL_NO_REPORT_OPCODES) sdev->no_report_opcodes = 1; @@ -1023,7 +1028,7 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id) shost->can_queue = devinfo->qdepth - 2; usb_set_intfdata(intf, shost); - result = scsi_add_host(shost, &intf->dev); + result = scsi_add_host_with_dma(shost, &intf->dev, udev->bus->sysdev); if (result) goto free_streams; From patchwork Thu Sep 3 18:17:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Yan X-Patchwork-Id: 258649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 599D7C433E2 for ; Thu, 3 Sep 2020 18:17:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27F90208CA for ; Thu, 3 Sep 2020 18:17:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DcLqkfol" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728949AbgICSRn (ORCPT ); Thu, 3 Sep 2020 14:17:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726025AbgICSRm (ORCPT ); Thu, 3 Sep 2020 14:17:42 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2E6CC061244 for ; Thu, 3 Sep 2020 11:17:41 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id u13so2792852pgh.1 for ; Thu, 03 Sep 2020 11:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zPbBfYdRv19xF3sirA0d8CLfF89pzIdN85SmGePftxg=; b=DcLqkfolcDogOjHXTFh6eeQiN8y9U2e+niKgUvNbmSC9tAB4/4yMqGavUhhAKZgQos irics9Vy+xnoaFQl29crrMPhImX84fuyfcVrRUdiINkDy9T0siMlVIcWK7BOndv2LAyX 1PDelL4Cu3TvZ+QcpP6k7SWrImF6JJI8T7Q62MnZCGuaeoN2VNgHwN8P2XcE/mqsZmtH Y4xxSTR83VqO760qYhkJCDq+qBzyNZ7upT8H6SYCaYK7i61re7Ep2RRkksk5TFLwbfI7 fQ0fMKXhJhmFRLj2MyTSOO8NCBhXO1ltLSSuAOBtxIQunpPGDe5px/eWNIzI+LtQmfsF J6Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zPbBfYdRv19xF3sirA0d8CLfF89pzIdN85SmGePftxg=; b=afJu4TUpIdGLZVUQGu57wWli/86TfnW09WBYKpeQZ4+Ovg1XAnhUGHbTRYvy99KwAh oKZH9NrRlymuJezBw8PyZHMB0fPVOQbL137h85QLShuKmKLdTKE974JmuJeR14f5tyj4 y6p1C6KaDYL0g5e/dUvOX3UGgIkjE07XovkX0R94MC0cmwWWI5q53l2AWavbPc8/coXe VUETy/0oqsgrPdVKeY6SYuv6MvF+ng93NaNA1s2asEIW14fp5GYVMu1YS2QGeC53iUfu PjrPqTiSBa6OZj1YeIxGpLf1+5+Gjo8skVmUpr8HYivZJQI5p9tXdS05AB6A58HkPdVt Sh/w== X-Gm-Message-State: AOAM531E1VChX/zrC78D6y1O2Whh96vcclT813Gxbh1erZCG7UeILJjq 62j4ceYMU3zgB7FQsExGJh1wzJ68p3g= X-Google-Smtp-Source: ABdhPJz5kSixLnik27wxO/GYEJXv4jmlyN306qUCqmMql4I6QvyVrGPM/73DpDsQrfZZ5FwO6evuKA== X-Received: by 2002:a17:902:8c94:: with SMTP id t20mr4991702plo.76.1599157060947; Thu, 03 Sep 2020 11:17:40 -0700 (PDT) Received: from localhost.localdomain ([161.81.62.213]) by smtp.gmail.com with ESMTPSA id r91sm3228530pja.56.2020.09.03.11.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 11:17:40 -0700 (PDT) From: Tom Yan To: linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, stern@rowland.harvard.edu, arnd@arndb.de Cc: cyrozap@gmail.com, yoshihiro.shimoda.uh@renesas.com, Tom Yan Subject: [PATCH v6 3/3] uas: bump hw_max_sectors to 2048 blocks for SS or faster drives Date: Fri, 4 Sep 2020 02:17:25 +0800 Message-Id: <20200903181725.2931-3-tom.ty89@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200903181725.2931-1-tom.ty89@gmail.com> References: <20200903155438.GC663761@rowland.harvard.edu> <20200903181725.2931-1-tom.ty89@gmail.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org There's no reason for uas to use a smaller value of max_sectors than usb-storage. Signed-off-by: Tom Yan --- drivers/usb/storage/uas.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/storage/uas.c b/drivers/usb/storage/uas.c index f4beeb8a8adb..c1123da43407 100644 --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -839,6 +839,8 @@ static int uas_slave_configure(struct scsi_device *sdev) blk_queue_max_hw_sectors(sdev->request_queue, 64); else if (devinfo->flags & US_FL_MAX_SECTORS_240) blk_queue_max_hw_sectors(sdev->request_queue, 240); + else if (devinfo->udev->speed >= USB_SPEED_SUPER) + blk_queue_max_hw_sectors(sdev->request_queue, 2048); blk_queue_max_hw_sectors(sdev->request_queue, min_t(size_t, queue_max_hw_sectors(sdev->request_queue),