summaryrefslogtreecommitdiff
path: root/drivers/usb/musb/musbhsdma.c
AgeCommit message (Collapse)Author
2010-03-02usb: musb: workaround MUSB DMA_INTR sometimes reads zeroAnand Gadiyar
MUSB DMA_INTR register may sometimes read zero when infact there was a pending interrupt. Workaround this by reading the DMA_COUNT values for all enabled channels when this condition occurs. Flag these channels as the ones needing to be serviced. Additionally, the absence of a debug print meant we would never catch a spurious DMA interrupt in MUSB. So this patch adds a debug print in the IRQ handler. Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Cc: Ajay Kumar Gupta <ajay.gupta@ti.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Vikram Pandita <vikram.pandita@ti.com> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11USB: musb: fix printf warning in debug codeMike Frysinger
The debug code in the DMA ISR uses a %d for a size_t when it should be using %zu. Otherwise gcc whines with: drivers/usb/musb/musbhsdma.c: In function 'dma_controller_irq': drivers/usb/musb/musbhsdma.c:288: warning: format '%d' expects type 'int', but argument 7 has type 'size_t' Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11USB: musb: clear the Blackfin interrupt pending bits early in the ISRCliff Cai
If we clear the interrupt pending bits at the end, we sometimes return too fast and have the same interrupt assert itself. There is no way in a Blackfin system to force a sync of this state, so the hardware manual instructs people to clear interrupt flags early in their ISR. Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-17USB: musb: sanitize clearing TXCSR DMA bits (take 2)Sergei Shtylyov
The MUSB code clears TXCSR_DMAMODE incorrectly in several places, either asserting that TXCSR_DMAENAB is clear (when sometimes it isn't) or clearing both bits together. Recent versions of the programmer's guide require DMAENAB to be cleared first, although some older ones didn't. Fix this and while at it: - In musb_gadget::txstate(), stop clearing the AUTOSET and DMAMODE bits for the CPPI case since they never get set anyway (the former bit is reserved on DaVinci); but do clear the DMAENAB bit on the DMA error path. - In musb_host::musb_ep_program(), remove the duplicate DMA controller specific code code clearing the TXCSR previous state, add the code to clear TXCSR DMA bits on the Inventra DMA error path, to replace such code (executed late) on the PIO path. - In musbhsdma::dma_channel_abort()/dma_controller_irq(), add/use the 'offset' variable to avoid MUSB_EP_OFFSET() invocations on every RXCSR/TXCSR access. [dbrownell@users.sourceforge.net: don't introduce CamelCase, shrink diff] Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-17USB: musb: bugfixes for multi-packet TXDMA supportSergei Shtylyov
We really want to use DMA mode 1 for all multi-packet transfers; that's one IRQ on DMA completion, instead of one per packet. There is an important issue with such transfers, especially on the host side: when such transfers end with a full-size packet, we must defer musb_dma_completion() calls until the FIFO empties. Else we report URB completions too soon, and may clobber data in the FIFO fifo when writing the next packet (losing data). The Inventra DMA support uses DMA mode 1, but it ignores that issue. The CPPI DMA support uses mode 0, but doesn't handle its TXPKTRDY interrupts quite right either; it can get stale "packet ready" interrupts, and report transfer completion too early using slightly different code paths, also losing data. So I'm solving it in a generic way -- by adding a sort of the "interrupt filter" into musb_host_tx(), catching these cases where a DMA completion IRQ doesn't suffice and removing some needlessly controller-specific logic. When a TXDMA interrupt happens and DMA request mode 1 is active, that filter resets to mode 0 and defers URB completion processing until TXPKTRDY, unless the FIFO is already empty. Related filtering logic in Inventra and CPPI code gets removed. Since it should be competely safe now to use the DMA request mode 1 for host side transfers with the CPPI DMA controller, set it in musb_h_tx_dma_start() ... now renamed (and shared). [ dbrownell@users.sourceforge.net: don't introduce more CamElCase; use more concise explanations ] Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07USB: musb: enable low level DMA operation for BlackfinBryan Wu
- DMA registers in Blackfin have different layout - DMA interrupt flags need to be cleared by software Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07usb: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-17usb: musb: general cleanup to musbhsdma.cFelipe Balbi
Basically getting rid of CaMeLcAsE, but also adding missing lines and spaces. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-08-14USB: Add MUSB and TUSB supportFelipe Balbi
This patch adds support for MUSB and TUSB controllers integrated into omap2430 and davinci. It also adds support for external tusb6010 controller. Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>