From patchwork Wed Jun 17 02:46:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Macpaul Lin X-Patchwork-Id: 11608913 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 367EE92A for ; Wed, 17 Jun 2020 02:47:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1581D208C3 for ; Wed, 17 Jun 2020 02:47:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="UQNlZQuY" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726505AbgFQCrB (ORCPT ); Tue, 16 Jun 2020 22:47:01 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:18229 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726275AbgFQCrB (ORCPT ); Tue, 16 Jun 2020 22:47:01 -0400 X-UUID: 29cb5b068b674c549fb17cb674c4c795-20200617 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=ZB3PDgfcBojaJ/fPpU6l0md70bnLTvLTU3jl+XWvIfE=; b=UQNlZQuY0/jpjIyCUaZKGd/4VnP5RTrlQYm4MJYqT6cBPb4hKiOKDz0U1f0kjvNOmwd331xjUs47K8ji18ypFCErWOq5PEmc5xWaGbptHlwbAPqsZsKtKVJXW69RULvBnlcW8Tq0de6144qXGe/K9IJV8zaz1JVe1VU8B6ydnKU=; X-UUID: 29cb5b068b674c549fb17cb674c4c795-20200617 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 464138752; Wed, 17 Jun 2020 10:46:56 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Jun 2020 10:46:50 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 17 Jun 2020 10:46:52 +0800 From: Macpaul Lin To: Alan Stern , Chunfeng Yun , Greg Kroah-Hartman , Felipe Balbi , Matthias Brugger , =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= , Sergey Organov , Fabrice Gasnier , , , , CC: Mediatek WSD Upstream , Macpaul Lin , Macpaul Lin Subject: [PATCH v2] usb: gadget: u_serial: improve performance for large data Date: Wed, 17 Jun 2020 10:46:47 +0800 Message-ID: <1592362007-7120-1-git-send-email-macpaul.lin@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1592310884-4307-1-git-send-email-macpaul.lin@mediatek.com> References: <1592310884-4307-1-git-send-email-macpaul.lin@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 341107C8CF0BF6B3E6614FF7FFDF49CB2287241339A1BF5421EE54432FA9522B2000:8 X-MTK: N Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Nowadays some embedded systems use VCOM to transfer large log and data. Take LTE MODEM as an example, during the long debugging stage, large log and data were transfer through VCOM when doing field try or in operator's lab. Here we suggest slightly increase the transfer buffer in u_serial.c for performance improving. Signed-off-by: Macpaul Lin --- drivers/usb/gadget/function/u_serial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 3cfc6e2..d7912a9 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -80,6 +80,7 @@ #define QUEUE_SIZE 16 #define WRITE_BUF_SIZE 8192 /* TX only */ #define GS_CONSOLE_BUF_SIZE 8192 +#define REQ_BUF_SIZE 4096 /* console info */ struct gs_console { @@ -247,7 +248,7 @@ static int gs_start_tx(struct gs_port *port) break; req = list_entry(pool->next, struct usb_request, list); - len = gs_send_packet(port, req->buf, in->maxpacket); + len = gs_send_packet(port, req->buf, REQ_BUF_SIZE); if (len == 0) { wake_up_interruptible(&port->drain_wait); break; @@ -514,7 +515,7 @@ static int gs_alloc_requests(struct usb_ep *ep, struct list_head *head, * be as speedy as we might otherwise be. */ for (i = 0; i < n; i++) { - req = gs_alloc_req(ep, ep->maxpacket, GFP_ATOMIC); + req = gs_alloc_req(ep, REQ_BUF_SIZE, GFP_ATOMIC); if (!req) return list_empty(head) ? -ENOMEM : 0; req->complete = fn;