All of lore.kernel.org
 help / color / mirror / Atom feed
From: Macpaul Lin <macpaul.lin@mediatek.com>
To: "Alan Stern" <stern@rowland.harvard.edu>,
	"Chunfeng Yun" <chunfeng.yun@mediatek.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	"Sergey Organov" <sorganov@gmail.com>,
	"Fabrice Gasnier" <fabrice.gasnier@st.com>,
	linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Mediatek WSD Upstream <wsd_upstream@mediatek.com>,
	Macpaul Lin <macpaul.lin@mediatek.com>,
	Macpaul Lin <macpaul.lin@gmail.com>
Subject: [PATCH v2] usb: gadget: u_serial: improve performance for large data
Date: Wed, 17 Jun 2020 10:46:47 +0800	[thread overview]
Message-ID: <1592362007-7120-1-git-send-email-macpaul.lin@mediatek.com> (raw)
In-Reply-To: <1592310884-4307-1-git-send-email-macpaul.lin@mediatek.com>

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 <macpaul.lin@mediatek.com>
---
 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;
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: Macpaul Lin <macpaul.lin@mediatek.com>
To: "Alan Stern" <stern@rowland.harvard.edu>,
	"Chunfeng Yun" <chunfeng.yun@mediatek.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	"Sergey Organov" <sorganov@gmail.com>,
	"Fabrice Gasnier" <fabrice.gasnier@st.com>,
	linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Macpaul Lin <macpaul.lin@gmail.com>,
	Macpaul Lin <macpaul.lin@mediatek.com>,
	Mediatek WSD Upstream <wsd_upstream@mediatek.com>
Subject: [PATCH v2] usb: gadget: u_serial: improve performance for large data
Date: Wed, 17 Jun 2020 10:46:47 +0800	[thread overview]
Message-ID: <1592362007-7120-1-git-send-email-macpaul.lin@mediatek.com> (raw)
In-Reply-To: <1592310884-4307-1-git-send-email-macpaul.lin@mediatek.com>

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 <macpaul.lin@mediatek.com>
---
 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;
-- 
1.7.9.5
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Macpaul Lin <macpaul.lin@mediatek.com>
To: "Alan Stern" <stern@rowland.harvard.edu>,
	"Chunfeng Yun" <chunfeng.yun@mediatek.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Felipe Balbi" <balbi@kernel.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
	"Sergey Organov" <sorganov@gmail.com>,
	"Fabrice Gasnier" <fabrice.gasnier@st.com>,
	linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Macpaul Lin <macpaul.lin@gmail.com>,
	Macpaul Lin <macpaul.lin@mediatek.com>,
	Mediatek WSD Upstream <wsd_upstream@mediatek.com>
Subject: [PATCH v2] usb: gadget: u_serial: improve performance for large data
Date: Wed, 17 Jun 2020 10:46:47 +0800	[thread overview]
Message-ID: <1592362007-7120-1-git-send-email-macpaul.lin@mediatek.com> (raw)
In-Reply-To: <1592310884-4307-1-git-send-email-macpaul.lin@mediatek.com>

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 <macpaul.lin@mediatek.com>
---
 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;
-- 
1.7.9.5
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2020-06-17  2:47 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 12:34 [PATCH 1/2] usb: gadget: introduce flag for large request Macpaul Lin
2020-06-16 12:34 ` Macpaul Lin
2020-06-16 12:34 ` Macpaul Lin
2020-06-16 12:34 ` [PATCH 2/2] usb: gadget: u_serial: improve performance for large data Macpaul Lin
2020-06-16 12:34   ` Macpaul Lin
2020-06-16 12:34   ` Macpaul Lin
2020-06-24  6:48   ` Felipe Balbi
2020-06-24  6:48     ` Felipe Balbi
2020-06-24  6:48     ` Felipe Balbi
2020-06-16 14:02 ` [PATCH 1/2] usb: gadget: introduce flag for large request Alan Stern
2020-06-16 14:02   ` Alan Stern
2020-06-16 14:02   ` Alan Stern
2020-06-17  2:27   ` Macpaul Lin
2020-06-17  2:27     ` Macpaul Lin
2020-06-17  2:27     ` Macpaul Lin
2020-06-17  2:46 ` Macpaul Lin [this message]
2020-06-17  2:46   ` [PATCH v2] usb: gadget: u_serial: improve performance for large data Macpaul Lin
2020-06-17  2:46   ` Macpaul Lin
2020-06-17  5:14   ` Greg Kroah-Hartman
2020-06-17  5:14     ` Greg Kroah-Hartman
2020-06-17  5:14     ` Greg Kroah-Hartman
2020-06-17  5:34     ` Macpaul Lin
2020-06-17  5:34       ` Macpaul Lin
2020-06-17  5:34       ` Macpaul Lin
2020-06-17  5:42   ` [PATCH v3] " Macpaul Lin
2020-06-17  5:42     ` Macpaul Lin
2020-06-17  5:42     ` Macpaul Lin
2020-06-24  6:50     ` Felipe Balbi
2020-06-24  6:50       ` Felipe Balbi
2020-06-24  6:50       ` Felipe Balbi
2020-06-24  6:47 ` [PATCH 1/2] usb: gadget: introduce flag for large request Felipe Balbi
2020-06-24  6:47   ` Felipe Balbi
2020-06-24  6:47   ` Felipe Balbi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1592362007-7120-1-git-send-email-macpaul.lin@mediatek.com \
    --to=macpaul.lin@mediatek.com \
    --cc=balbi@kernel.org \
    --cc=chunfeng.yun@mediatek.com \
    --cc=fabrice.gasnier@st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=macpaul.lin@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=sorganov@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=wsd_upstream@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.