From patchwork Thu Sep 17 16:42:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 53833 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by patches.linaro.org (Postfix) with ESMTPS id 3F06622A0D for ; Thu, 17 Sep 2015 16:43:02 +0000 (UTC) Received: by lamp12 with SMTP id p12sf8623714lam.2 for ; Thu, 17 Sep 2015 09:43:01 -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=AkvrVxMiWOfGb4XrM7mz/qDFycklmwrP8wxGhqEspkwgZkwzt31LEnhtaXaWzXzx43 fGEul41hc6xp86WluOE8fmPFqk42mzMyBxMOQj3AH94yG3nV6boHIS3Pl2Zpp2gI9Wxq jfapInH+6jWznyZYj/jz0KYq1eiuL/JJOD2KL2n9N4NKqtPqvNKLnaGWuUZLHcv/LfwU hJcvQ6MLyXKkuiw4hRYlDZpAJlGfDCoUwU2d18ylO7gPHHT/ix+7QUuvU2IbsiC/avYH aXq28fN7VvAy+JMvQul7+3BRZYdSijs/87ffblYxSfy9JrBEXSwvJv4SKJdgZ5ZRYnYg Ffrw== X-Gm-Message-State: ALoCoQmDIddaOQLIUGuxxKjfw8/diTclnXewCHuKYBjM5Onfoz6RGlCw5T+7LKIoFRpwooMz+mgX X-Received: by 10.152.21.42 with SMTP id s10mr14784lae.9.1442508181153; Thu, 17 Sep 2015 09:43:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.166 with SMTP id w6ls116599lae.10.gmail; Thu, 17 Sep 2015 09:43:01 -0700 (PDT) X-Received: by 10.152.6.196 with SMTP id d4mr49576laa.121.1442508180959; Thu, 17 Sep 2015 09:43:00 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com. [209.85.217.169]) by mx.google.com with ESMTPS id c11si2788447lbq.1.2015.09.17.09.43.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2015 09:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by lbbmp1 with SMTP id mp1so12454159lbb.1 for ; Thu, 17 Sep 2015 09:43:00 -0700 (PDT) X-Received: by 10.112.156.167 with SMTP id wf7mr129140lbb.88.1442508180873; Thu, 17 Sep 2015 09:43:00 -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 w3csp3177715lbq; Thu, 17 Sep 2015 09:43:00 -0700 (PDT) X-Received: by 10.107.137.69 with SMTP id l66mr8078712iod.60.1442508175889; Thu, 17 Sep 2015 09:42:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dn2si6446320pbb.210.2015.09.17.09.42.55; Thu, 17 Sep 2015 09:42:55 -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 S1752632AbbIQQmx (ORCPT + 4 others); Thu, 17 Sep 2015 12:42:53 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:32913 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641AbbIQQmw (ORCPT ); Thu, 17 Sep 2015 12:42:52 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id t8HGgpDm015301 for ; Thu, 17 Sep 2015 11:42:51 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t8HGgpp4005696 for ; Thu, 17 Sep 2015 11:42:51 -0500 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; Thu, 17 Sep 2015 11:42:52 -0500 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 t8HGgpND022491; Thu, 17 Sep 2015 11:42:51 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Felipe Balbi Subject: [PATCH 3/3] usb: gadget: mass_storage: allow for deeper queue lengths Date: Thu, 17 Sep 2015 11:42:40 -0500 Message-ID: <1442508160-20601-3-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1442508160-20601-1-git-send-email-balbi@ti.com> References: <1442508160-20601-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.217.169 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; }