From: Tony Lindgren <tony@atomide.com>
To: "Hunter, Jon" <jon-hunter@ti.com>
Cc: David Brownell <david-b@pacbell.net>,
linux-omap-open-source@linux.omap.com
Subject: Re: OMAP2430: MUSB: Ethernet Gadget Issue
Date: Mon, 17 Dec 2007 17:05:56 -0800 [thread overview]
Message-ID: <20071218010556.GX7388@atomide.com> (raw)
In-Reply-To: <5573C19A4BBDB441BED2A44157E9705302D6E61F@dlee12.ent.ti.com>
* Hunter, Jon <jon-hunter@ti.com> [071217 16:01]:
> > There what's odd is that nothing seems to have emptied the
> > FIFO. I've not looked at the Mentor DMA engine, but I'd kind
> > of hope that it's more sane than CPPI ... so that one could
> > let it offload entire IEEE 802 packets without needing to
> > wake up the CPU after each packet.
>
>
> I do see from the driver that the Mentor DMA engine appears to have two
> modes of operation, namely mode 0 and mode 1. When the DMA is configured
> for Mode 0 then the DMA will only load/unload one packet at a time and
> so the CPU will be interrupted for each packet. Whereas in Mode 1 the
> DMA can load/unload all packets of the entire transfer. On the TX side
> it appears to use Mode 1 and on the RX side it uses Mode 0. I did find
> the following comment in the musb_gadget.c file:
>
> /* We use DMA Req mode 0 in rx_csr, and DMA controller operates in
> * mode 0 only. So we do not get endpoint interrupts due to DMA
> * completion. We only get interrupts from DMA controller.
> *
> * We could operate in DMA mode 1 if we knew the size of the tranfer
> * in advance. For mass storage class, request->length = what the host
> * sends, so that'd work. But for pretty much everything else,
> * request->length is routinely more than what the host sends. For
> * most these gadgets, end of is signified either by a short packet,
> * or filling the last byte of the buffer. (Sending extra data in
> * that last pckate should trigger an overflow fault.) But in mode 1,
> * we don't get DMA completion interrrupt for short packets.
> *
> * Theoretically, we could enable DMAReq irq (MUSB_RXCSR_DMAMODE = 1),
> * to get endpoint interrupt on every DMA req, but that didn't seem
> * to work reliably.
> *
> * REVISIT an updated g_file_storage can set req->short_not_ok, which
> * then becomes usable as a runtime "use mode 1" hint...
> */
>
> >From digging into this more, when the failure condition occurs, I see
> that the DMA channels for both RX and TX are configured and enabled. The
> strange thing is that neither DMA completes and so the driver is stuck
> waiting for an interrupt from both the RX and the TX side. The DMA
> registers do show that the DMA channels are configured to generate an
> interrupt but the INTR (interrupt status register) for DMA controller
> never shows an interrupt pending for either the RX or TX channel. It
> seems that the DMA is setup correctly but never transfer the data.
The musb driver should be fixed to allow using mode 1 based on the fifo
interrupt. I never had much luck with mode 1 though on tusb :(
Tony
next prev parent reply other threads:[~2007-12-18 1:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-21 17:08 OMAP2430: MUSB: Ethernet Gadget Issue Hunter, Jon
2007-11-23 20:26 ` David Brownell
2007-11-29 20:03 ` Foale, Jeff
2007-11-29 21:07 ` David Brownell
2007-12-07 20:55 ` Hunter, Jon
2007-12-07 20:38 ` Hunter, Jon
2007-12-10 5:34 ` David Brownell
2007-12-12 20:55 ` Hunter, Jon
2007-12-12 23:22 ` Hunter, Jon
2007-12-18 0:00 ` Hunter, Jon
2007-12-18 1:05 ` Tony Lindgren [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-12-05 22:10 Foale, Jeff
2007-12-06 16:17 ` David Brownell
2007-12-07 20:55 ` Hunter, Jon
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=20071218010556.GX7388@atomide.com \
--to=tony@atomide.com \
--cc=david-b@pacbell.net \
--cc=jon-hunter@ti.com \
--cc=linux-omap-open-source@linux.omap.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.