public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink
@ 2012-12-13 14:11 Armando Visconti
  2012-12-17 15:45 ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 4+ messages in thread
From: Armando Visconti @ 2012-12-13 14:11 UTC (permalink / raw)
  To: balbi; +Cc: gregkh, pratyush.anand, linux-usb, linux-kernel, spear-devel

In the IN case, since the USB request is allocated only when
the source/sink function is started and never freed, the USB ept
buffer needs to be inited only at the beginning. This change
results into a more performant g_zero module, especially when
'pattern=1' is selected.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
---
 drivers/usb/gadget/f_sourcesink.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c
index 3c126fd..534cf8c 100644
--- a/drivers/usb/gadget/f_sourcesink.c
+++ b/drivers/usb/gadget/f_sourcesink.c
@@ -536,8 +536,7 @@ static void source_sink_complete(struct usb_ep *ep, struct usb_request *req)
 			check_read_data(ss, req);
 			if (pattern != 2)
 				memset(req->buf, 0x55, req->length);
-		} else
-			reinit_write_data(ep, req);
+		}
 		break;
 
 	/* this endpoint is normally active while we're configured */
-- 
1.7.4.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink
  2012-12-13 14:11 [PATCH] usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink Armando Visconti
@ 2012-12-17 15:45 ` Sebastian Andrzej Siewior
  2012-12-17 17:21   ` Armando Visconti
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-12-17 15:45 UTC (permalink / raw)
  To: Armando Visconti
  Cc: balbi, gregkh, pratyush.anand, linux-usb, linux-kernel,
	spear-devel

On Thu, Dec 13, 2012 at 03:11:19PM +0100, Armando Visconti wrote:
> In the IN case, since the USB request is allocated only when
> the source/sink function is started and never freed, the USB ept
> buffer needs to be inited only at the beginning. This change
                     ^^^^^^
> results into a more performant g_zero module, especially when
> 'pattern=1' is selected.

Besides that the patch looks fine :)

> Signed-off-by: Armando Visconti <armando.visconti@st.com>

Sebastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink
  2012-12-17 15:45 ` Sebastian Andrzej Siewior
@ 2012-12-17 17:21   ` Armando Visconti
  2012-12-18  8:27     ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 4+ messages in thread
From: Armando Visconti @ 2012-12-17 17:21 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: balbi@ti.com, gregkh@linuxfoundation.org, Pratyush ANAND,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	spear-devel

On 12/17/2012 04:45 PM, Sebastian Andrzej Siewior wrote:
> On Thu, Dec 13, 2012 at 03:11:19PM +0100, Armando Visconti wrote:
>> In the IN case, since the USB request is allocated only when
>> the source/sink function is started and never freed, the USB ept
>> buffer needs to be inited only at the beginning. This change
>                       ^^^^^^
>> results into a more performant g_zero module, especially when
>> 'pattern=1' is selected.
>
> Besides that the patch looks fine :)

Do you mean that 'inited' should be changed with 'initialized'?
Oh ... my poor english... :(

Rgds,
Arm


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink
  2012-12-17 17:21   ` Armando Visconti
@ 2012-12-18  8:27     ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2012-12-18  8:27 UTC (permalink / raw)
  To: Armando Visconti
  Cc: Sebastian Andrzej Siewior, balbi@ti.com,
	gregkh@linuxfoundation.org, Pratyush ANAND,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	spear-devel

On Mon, Dec 17, 2012 at 06:21:16PM +0100, Armando Visconti wrote:
> >Besides that the patch looks fine :)
> 
> Do you mean that 'inited' should be changed with 'initialized'?
Yes, I do.

> Oh ... my poor english... :(
Don't worry. Others, including myself, do this from time to time as well :)

> 
> Rgds,
> Arm

Sebastian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-18  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-13 14:11 [PATCH] usb: gadget zero: avoid unnecessary reinit of data in f_sourcesink Armando Visconti
2012-12-17 15:45 ` Sebastian Andrzej Siewior
2012-12-17 17:21   ` Armando Visconti
2012-12-18  8:27     ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox