public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Ruslan Bilovol <ruslan.bilovol@ti.com>
Cc: balbi@ti.com, gregkh@linuxfoundation.org,
	linux-usb@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH RESEND v2 1/1] usb: musb: implement (un)map_urb_for_dma hooks
Date: Thu, 28 Mar 2013 15:57:06 +0200	[thread overview]
Message-ID: <20130328135706.GF16298@arwen.pp.htv.fi> (raw)
In-Reply-To: <CAB=otbS2C3pmLhuOOHau4=_7G0VBp-Y-aDi3YOpHkq+=YR+x_Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2631 bytes --]

On Thu, Mar 28, 2013 at 03:44:50PM +0200, Ruslan Bilovol wrote:
> Hi Felipe,
> 
> On Wed, Mar 27, 2013 at 3:17 PM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Thu, Mar 14, 2013 at 08:12:09PM +0200, Ruslan Bilovol wrote:
> >> MUSB controller cannot work in DMA mode with misaligned buffers,
> >> switching in PIO mode.
> >>
> >> HCD core has hooks that allow to override the default DMA
> >> mapping and unmapping routines for host controllers that have
> >> special DMA requirements, such as alignment contraints.
> >>
> >> It is observed that work in PIO mode is slow and it's better
> >> to align buffers properly before passing them to MUSB
> >>
> >> This increased throughput 80->120 MBits/s over musb@omap4 with
> >> USB Gigabit ethernet adapter attached.
> >>
> >> Some ideas taken from ehci-tegra.c
> >>
> >> Signed-off-by: Ruslan Bilovol <ruslan.bilovol@ti.com>
> >> ---
> >>  drivers/usb/musb/musb_core.c |   14 ++++++
> >>  drivers/usb/musb/musb_host.c |  102 +++++++++++++++++++++++++++++++++++++++++-
> >>  drivers/usb/musb/musb_host.h |    2 +-
> >>  3 files changed, 116 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> >> index 60b41cc..91ac166 100644
> >> --- a/drivers/usb/musb/musb_core.c
> >> +++ b/drivers/usb/musb/musb_core.c
> >> @@ -1431,6 +1431,20 @@ static int musb_core_init(u16 musb_type, struct musb *musb)
> >>
> >>       /* log release info */
> >>       musb->hwvers = musb_read_hwvers(mbase);
> >> +
> >> +#ifndef CONFIG_MUSB_PIO_ONLY
> >> +     /*
> >> +      * The DMA engine in RTL1.8 and above cannot handle
> >> +      * DMA addresses that are not aligned to a 4 byte boundary.
> >> +      * For such engine implemented (un)map_urb_for_dma hooks.
> >> +      * Do not use these hooks for RTL<1.8
> >> +      */
> >> +     if (musb->hwvers < MUSB_HWVERS_1800) {
> >
> > if you move this check to map/unmap and always return error if this is
> > true, you can avoid removing 'const' from our struct hc_driver. Would
> > that work ?
> 
> If we return an error in map/unmap callbacks, this will break urb transferring,
> however I can call core function usb_hcd_(un)map_urb_for_dma() instead of
> returning the error (and that is default behavior if we do not have
> map/unmap callbacks
> set for the hc driver) so I can avoid removing 'const' from our struct
> hc_driver and this will work.
> The side effect will be only in small overhead for this path.
> 
> So, will be this OK for you? I will send v3 in this case.

should be alright. Thanks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      reply	other threads:[~2013-03-28 13:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 18:12 [PATCH RESEND v2 0/1] usb: musb: improve throughput in HOST mode Ruslan Bilovol
2013-03-14 18:12 ` [PATCH RESEND v2 1/1] usb: musb: implement (un)map_urb_for_dma hooks Ruslan Bilovol
2013-03-27 13:17   ` Felipe Balbi
2013-03-28 13:44     ` Ruslan Bilovol
2013-03-28 13:57       ` Felipe Balbi [this message]

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=20130328135706.GF16298@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=ruslan.bilovol@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