From 384bf8b4cfcfe2f8b542fcecdc2b76ecd848953b Mon Sep 17 00:00:00 2001 From: Paras Singh Jain Date: Wed, 2 Sep 2020 19:11:23 +0530 Subject: [PATCH] usb: gadget: increase the buffer size to 1 MB for tty ports To support LTE peak data rates of 150MBPS Uplink for DUN+SoftAP usecases Change-Id: I947b6338661cab3d3346d280b3ec4ccbac6b2f94 Signed-off-by: Paras Singh Jain --- drivers/usb/gadget/function/u_serial.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 038c445a4e9b..a57c36af2786 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1150,12 +1150,15 @@ gs_port_alloc(unsigned port_num, struct usb_cdc_line_coding *coding) } tty_port_init(&port->port); + tty_buffer_set_limit(&port->port, 8388608); spin_lock_init(&port->port_lock); init_waitqueue_head(&port->drain_wait); init_waitqueue_head(&port->close_wait); - INIT_DELAYED_WORK(&port->push, gs_rx_push); + pr_debug("%s open:ttyGS%d and set 8388608, avail:%d\n", __func__, + port_num, tty_buffer_space_avail(&port->port)); + INIT_DELAYED_WORK(&port->push, gs_rx_push); INIT_LIST_HEAD(&port->read_pool); INIT_LIST_HEAD(&port->read_queue); INIT_LIST_HEAD(&port->write_pool);