From patchwork Thu Sep 17 16:45:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53836 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id D602E22A0D for ; Thu, 17 Sep 2015 16:45:47 +0000 (UTC) Received: by lamp12 with SMTP id p12sf8649974lam.2 for ; Thu, 17 Sep 2015 09:45:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=SClMpM04mT7c0MRylSZHkJEPuv3MCS3vUNNRbOU6aic=; b=Nk9m6R+SmRE/ml2ojJt4O3jlrIkLdXUbng/z8wB6nqNkgExUxdGtG0Ppsvcdu6i5gJ K2bP8nHSHYkVFrT+9yMc2PGT7oiF69Z8TFrz4SEX44s5D7qNIQU0KJaxGaxfVbCWocOV U9xIW+dI8Lxb54seVQ4w4Sfe86PpUFotegkXKRtK74zfyicSW5a+lMYT+21C4+fCduyE sgpgV+4Hx5mrlXIIGu07MmM+ibvZsJ6LHbQabU2asGP8K+8r/6fLuNnuhHklHizphMh0 rSoCV4AoksTx4I3ymQSVngHnKRN0ativEMDQ27/4LYGR2yHqONuNrqLBfgGWm3VEZ8Hq 6qkQ== X-Gm-Message-State: ALoCoQlBcile2XeprzZegAR/2L3RxmY53SmJilWZrPZUwXO5W0mY6Gh+UfL6sthP156nuv6GAV8M X-Received: by 10.112.48.41 with SMTP id i9mr9388lbn.23.1442508346740; Thu, 17 Sep 2015 09:45:46 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.67 with SMTP id y3ls108730lay.55.gmail; Thu, 17 Sep 2015 09:45:46 -0700 (PDT) X-Received: by 10.152.3.196 with SMTP id e4mr165794lae.68.1442508346597; Thu, 17 Sep 2015 09:45:46 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id zk1si2793222lbb.30.2015.09.17.09.45.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 09:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by lamp12 with SMTP id p12so14736622lam.0 for ; Thu, 17 Sep 2015 09:45:46 -0700 (PDT) X-Received: by 10.112.166.106 with SMTP id zf10mr178899lbb.36.1442508346244; Thu, 17 Sep 2015 09:45:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp3179135lbq; Thu, 17 Sep 2015 09:45:45 -0700 (PDT) X-Received: by 10.68.233.200 with SMTP id ty8mr214011pbc.80.1442508344913; Thu, 17 Sep 2015 09:45:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id iu6si6507437pac.81.2015.09.17.09.45.44; Thu, 17 Sep 2015 09:45:44 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751939AbbIQQpN (ORCPT + 4 others); Thu, 17 Sep 2015 12:45:13 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:48409 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751471AbbIQQpG (ORCPT ); Thu, 17 Sep 2015 12:45:06 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8HGj5iM019914 for ; Thu, 17 Sep 2015 11:45:05 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HGj5vN011952 for ; Thu, 17 Sep 2015 11:45:05 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Thu, 17 Sep 2015 11:45:06 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HGj5ib018241; Thu, 17 Sep 2015 11:45:05 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH RESEND 4/4] usb: gadget: mass_storage: allow for deeper queue lengths Date: Thu, 17 Sep 2015 11:45:00 -0500 Message-ID: <1442508300-20858-4-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442508300-20858-1-git-send-email-balbi@ti.com> References: <1442508300-20858-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Instead of allowing a range of 2 to 4 requests, let's allow the user choose up to 32 requests as that will give us a better chance of keeping controller busy. We still maintain default of 2 so users shouldn't be affected. Signed-off-by: Felipe Balbi --- drivers/usb/gadget/Kconfig | 2 +- drivers/usb/gadget/function/f_mass_storage.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index bcf83c0a6e62..33834aa09ed4 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -113,7 +113,7 @@ config USB_GADGET_VBUS_DRAW config USB_GADGET_STORAGE_NUM_BUFFERS int "Number of storage pipeline buffers" - range 2 4 + range 2 32 default 2 help Usually 2 buffers are enough to establish a good buffering diff --git a/drivers/usb/gadget/function/f_mass_storage.c b/drivers/usb/gadget/function/f_mass_storage.c index a6eb537d7768..5277e7c4a82a 100644 --- a/drivers/usb/gadget/function/f_mass_storage.c +++ b/drivers/usb/gadget/function/f_mass_storage.c @@ -2662,10 +2662,12 @@ EXPORT_SYMBOL_GPL(fsg_common_put); /* check if fsg_num_buffers is within a valid range */ static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers) { - if (fsg_num_buffers >= 2 && fsg_num_buffers <= 4) +#define FSG_MAX_NUM_BUFFERS 32 + + if (fsg_num_buffers >= 2 && fsg_num_buffers <= FSG_MAX_NUM_BUFFERS) return 0; pr_err("fsg_num_buffers %u is out of range (%d to %d)\n", - fsg_num_buffers, 2, 4); + fsg_num_buffers, 2, FSG_MAX_NUM_BUFFERS); return -EINVAL; }