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: Wed, 27 Mar 2013 15:17:11 +0200 [thread overview]
Message-ID: <20130327131711.GG4626@arwen.pp.htv.fi> (raw)
In-Reply-To: <1363284729-24228-2-git-send-email-ruslan.bilovol@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1782 bytes --]
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 ?
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-03-27 13:17 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 [this message]
2013-03-28 13:44 ` Ruslan Bilovol
2013-03-28 13:57 ` 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=20130327131711.GG4626@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