Skip to content

Commit 65a4890

Browse files
Felipe Balbinsekhar
authored andcommitted
usb: gadget: mass_storage: allow for deeper queue lengths
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 <balbi@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
1 parent 99bcfee commit 65a4890

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

drivers/usb/gadget/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ config USB_GADGET_VBUS_DRAW
113113

114114
config USB_GADGET_STORAGE_NUM_BUFFERS
115115
int "Number of storage pipeline buffers"
116-
range 2 4
116+
range 2 32
117117
default 2
118118
help
119119
Usually 2 buffers are enough to establish a good buffering

drivers/usb/gadget/function/f_mass_storage.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,10 +2653,12 @@ EXPORT_SYMBOL_GPL(fsg_common_put);
26532653
/* check if fsg_num_buffers is within a valid range */
26542654
static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers)
26552655
{
2656-
if (fsg_num_buffers >= 2 && fsg_num_buffers <= 4)
2656+
#define FSG_MAX_NUM_BUFFERS 32
2657+
2658+
if (fsg_num_buffers >= 2 && fsg_num_buffers <= FSG_MAX_NUM_BUFFERS)
26572659
return 0;
26582660
pr_err("fsg_num_buffers %u is out of range (%d to %d)\n",
2659-
fsg_num_buffers, 2, 4);
2661+
fsg_num_buffers, 2, FSG_MAX_NUM_BUFFERS);
26602662
return -EINVAL;
26612663
}
26622664

0 commit comments

Comments
 (0)