From: Matthieu CASTET <matthieu.castet@parrot.com>
To: "Patra, Nilkesh" <nilkesh.patra@ti.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
David Brownell <david-b@pacbell.net>,
"Gadiyar, Anand" <gadiyar@ti.com>
Subject: Re: [RFC] MUSB: Workaround for Ethernet data alignment issue
Date: Tue, 15 Dec 2009 11:13:25 +0100 [thread overview]
Message-ID: <4B276145.1080909@parrot.com> (raw)
In-Reply-To: <B85A65D85D7EB246BE421B3FB0FBB59301DEAB8723@dbde02.ent.ti.com>
Hi,
Patra, Nilkesh a écrit :
> On the latest version of MUSB, DMA is not working properly if the Data in the packet doesn't start at 32bit aligned address. This issue was found while using MUSB as g_ether. The basic ping does not work, if the data in the Ethernet packet does not start at 32bit aligned address.
>
> To overcome this issue, we found one solution mentioned in the below patch. This patch moves data (skb->data) by 2 bytes backwards in ethernet packet, which is nothing but skb->head.
>
> I want to know, if there are any better approaches to fix this issue.
>
What dma_mask are you using ?
From what I understand, dma_map_single will use it to know if the dma
buffer need to be aligned [1].
So you need to set the last 2 bits to 0 and it should do everything for you.
Matthieu
[1]
/*
* Figure out if we need to bounce from the DMA mask.
*/
needs_bounce = (dma_addr | (dma_addr + size - 1)) & ~mask;
}
if (device_info && (needs_bounce || dma_needs_bounce(dev, dma_addr,
size))) {
struct safe_buffer *buf;
buf = alloc_safe_buffer(device_info, ptr, size, dir);
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-12-15 10:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-14 4:50 [RFC] MUSB: Workaround for Ethernet data alignment issue Patra, Nilkesh
[not found] ` <B85A65D85D7EB246BE421B3FB0FBB59301DEAB8723-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2009-12-14 17:39 ` Pandita, Vikram
2009-12-14 20:30 ` Sonasath, Moiz
2009-12-16 7:11 ` Patra, Nilkesh
2009-12-15 10:13 ` Matthieu CASTET [this message]
[not found] ` <4B276145.1080909-ITF29qwbsa/QT0dZR+AlfA@public.gmane.org>
2009-12-15 10:28 ` Matthieu CASTET
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=4B276145.1080909@parrot.com \
--to=matthieu.castet@parrot.com \
--cc=david-b@pacbell.net \
--cc=gadiyar@ti.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=nilkesh.patra@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