public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Vikram Pandita <vikram.pandita@ti.com>
Cc: balbi@ti.com, linux-usb@vger.kernel.org, gadiyar@ti.com,
	linux-omap@vger.kernel.org, Moiz Sonasath <m-sonasath@ti.com>
Subject: Re: [PATCH] usb: musb: Enable DMA mode1 RX for USB-Mass-Storage
Date: Sat, 16 Jul 2011 15:22:20 +0400	[thread overview]
Message-ID: <4E21746C.4040301@ru.mvista.com> (raw)
In-Reply-To: <1310773489-19184-1-git-send-email-vikram.pandita@ti.com>

Hello.

On 16-07-2011 3:44, Vikram Pandita wrote:

> From: Vikram Pandita <vikram.pandita@ti.com>

> This patch enables the DMA mode1 RX support.
> This feature is enabled based on the short_not_ok flag passed from
> gadget drivers.

> This will result in a thruput performance gain of around
> 40% for USB mass-storage/mtp use cases.

> Based on Original work by
> Anand Gadiyar<gadiyar@ti.com>  on 2.6.35 kernel

> Tested on OMAP4460 Blaze board.

> Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
> Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
> ---
>   drivers/usb/musb/musb_gadget.c |   42 ++++++++++++++++++++++++++++-----------
>   1 files changed, 30 insertions(+), 12 deletions(-)

> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index 9412410..e643ec2 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -624,6 +624,7 @@ void musb_g_tx(struct musb *musb, u8 epnum)
>   /*
>    * Context: controller locked, IRQs blocked, endpoint selected
>    */
> +

    Why?

>   static void rxstate(struct musb *musb, struct musb_request *req)
>   {
>   	const u8		epnum = req->epnum;
> @@ -714,10 +728,13 @@ static void rxstate(struct musb *musb, struct musb_request *req)
>   	 * then becomes usable as a runtime "use mode 1" hint...
>   	 */
>
> -				csr |= MUSB_RXCSR_DMAENAB;
> -#ifdef USE_MODE1
> +	/* Experimental: Mode1 works with mass storage use cases
> +	 */
> +		if (use_mode_1) {

    No, you can't put the code at the arbitrary indentation levels. Please 
indent properly.

>   				csr |= MUSB_RXCSR_AUTOCLEAR;
> -				/* csr |= MUSB_RXCSR_DMAMODE; */
> +				musb_writew(epio, MUSB_RXCSR, csr);
> +				csr |= MUSB_RXCSR_DMAENAB;
> +				musb_writew(epio, MUSB_RXCSR, csr);
>
>   				/* this special sequence (enabling and then
>   				 * disabling MUSB_RXCSR_DMAMODE) is required
> @@ -725,26 +742,27 @@ static void rxstate(struct musb *musb, struct musb_request *req)
>   				 */
>   				musb_writew(epio, MUSB_RXCSR,
>   					csr | MUSB_RXCSR_DMAMODE);
> -#else
> +				musb_writew(epio, MUSB_RXCSR, csr);
> +
> +		} else {
>   				if (!musb_ep->hb_mult &&
>   					musb_ep->hw_ep->rx_double_buffered)
>   					csr |= MUSB_RXCSR_AUTOCLEAR;
> -#endif
> +				csr |= MUSB_RXCSR_DMAENAB;
>   				musb_writew(epio, MUSB_RXCSR, csr);
> +		}
>
>   				if (request->actual<  request->length) {
>   					int transfer_size = 0;
> -#ifdef USE_MODE1
> +		if (use_mode_1) {

    Same here.

>   					transfer_size = min(request->length - request->actual,
>   							channel->max_len);
> -#else
> +					musb_ep->dma->desired_mode = 1;
> +		} else {
>   					transfer_size = min(request->length - request->actual,
>   							(unsigned)len);
> -#endif
> -					if (transfer_size <= musb_ep->packet_sz)
> -						musb_ep->dma->desired_mode = 0;
> -					else
> -						musb_ep->dma->desired_mode = 1;
> +					musb_ep->dma->desired_mode = 0;
> +		}
>
>   					use_dma = c->channel_program(
>   							channel,

WBR, Sergei

  reply	other threads:[~2011-07-16 11:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-15 23:44 [PATCH] usb: musb: Enable DMA mode1 RX for USB-Mass-Storage Vikram Pandita
2011-07-16 11:22 ` Sergei Shtylyov [this message]
2011-07-18 23:38   ` Pandita, Vikram

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=4E21746C.4040301@ru.mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=balbi@ti.com \
    --cc=gadiyar@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m-sonasath@ti.com \
    --cc=vikram.pandita@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox