summaryrefslogtreecommitdiffstats
path: root/drivers/dma/amba-pl08x.c
Commit message (Collapse)AuthorAgeFilesLines
...
* ARM: PL08x: remove unnecessary includesRussell King - ARM Linux2011-01-051-6/+1Star
| | | | | | | | | | | | We don't need to include linux/pci.h as we aren't a PCI driver. We aren't doing any processor specific functions, so asm/processor.h is not required. asm/cacheflush.h shouldn't be used, we have the DMA API for this. DMA interfaces aren't required as we're only implementing the dmaengine API and not a platform-private DMA API. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: prefix hex numbers with 0xRussell King - ARM Linux2011-01-051-9/+9
| | | | | | | | | A driver which emits both decimal and hex numbers in its printk creates confusion as to what is what. Prefix hex numbers with 0x. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: improve the announcement printkRussell King - ARM Linux2011-01-051-7/+4Star
| | | | | | | | | | | Include the revision number of the PL08x primecell in the boot-time printk to allow proper identification of the peripheral. Reformat the announcement printk format reflect what we do for other primecell drivers - generally "PLXXX revX at 0xNNNNNNNN irq X". Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: add comment explaining the flow control methodsRussell King - ARM Linux2011-01-051-1/+17
| | | | | | | | | | | Explain the two flow control methods which the PL08x implements, along with the problem which peripheral flow control presents. This helps people understand why we are unable to use these DMA controllers with (eg) the MMCI. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix sparse warningsRussell King - ARM Linux2011-01-051-5/+5
| | | | | | | | | | | | drivers/dma/amba-pl08x.c:1895:40: warning: Unknown escape '%' drivers/dma/amba-pl08x.c:1903:40: warning: Unknown escape '%' drivers/dma/amba-pl08x.c:513:6: warning: symbol 'pl08x_choose_master_bus' was not declared. Should it be static? drivers/dma/amba-pl08x.c:604:5: warning: symbol 'pl08x_fill_llis_for_desc' was not declared. Should it be static? drivers/dma/amba-pl08x.c:1442:32: warning: symbol 'pl08x_prep_slave_sg' was not declared. Should it be static? Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix deadlock in terminate_allRussell King - ARM Linux2011-01-051-2/+0Star
| | | | | | | | | | | | | | | | | | | | | Trying to disable a tasklet while holding a spinlock which the tasklet will take is a recipe for deadlock - tasklet_disable() will wait for the tasklet to finish running, which it will never do. In any case, there is not a corresponding tasklet_enable(), so once the tasklet is disabled, it will never run again until reboot. It's safe to just remove the tasklet_disable() as we remove all current and pending descriptors before releasing this spinlock. This means that the tasklet will find no remaining work if it subsequently runs. The only remaining issue is that the callback for an already submitted txd may be in progress, or even called after terminate_all() returns. There's not much that can be done about that as waiting for the callback to complete before returning will also lead to deadlocks. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix missed spin-unlock in pl08x_issue_pending()Russell King - ARM Linux2011-01-051-8/+4Star
| | | | | | | | | | | | pl08x_issue_pending() returns with the spinlock locked and interrupts disabled if the channel is waiting for a physical DMA to become free. This is wrong - especially as pl08x_issue_pending() is an API function as it leads to deadlocks. Fix it to always return with the spinlock unlocked. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix a leak when preparing TXDsRussell King - ARM Linux2011-01-051-2/+3
| | | | | | | | | | | If we fail to allocate the LLI, the prep_* function will return NULL. However, the TXD we allocated will not be placed on any list, nor will it be freed - we'll just drop all references to it. Make sure we free it rather than leaking TXDs. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix locking in taskletRussell King - ARM Linux2011-01-051-2/+3
| | | | | | | | | | | | Tasklets are run from an interruptible context. The slave DMA functions can be called from within IRQ handlers. Taking the spinlock without disabling interrupts allows an interrupt handler to run, which may try to take the spinlock again, resulting in deadlock. Fix this by using the irqsave spinlocks. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix atomic_t usage and tx_submit() return value rangeRussell King - ARM Linux2011-01-051-9/+9
| | | | | | | | | | | | | | | | The last_issued variable uses an atomic type, which is only incremented inside a protected region, and then read. Everywhere else only reads the value, so it isn't using atomic_t correctly, and it doesn't even need to. Moreover, the DMA engine code provides us with a variable for this already - chan.cookie. Use chan.cookie instead. Also, avoid negative dma_cookie_t values - negative returns from tx_submit() mean failure, yet in reality we always succeed. Restart from cookie 1, just like other DMA engine drivers do. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix array overflow in dma_set_runtime_config()Russell King - ARM Linux2011-01-051-7/+6Star
| | | | | | | | | | | | | If maxburst was passed in as zero, we would overflow the burst_sizes[] array. Fix this by checking for this condition, and defaulting to single transfer 'bursts'. Improve the readability of the loop using a for() loop rather than a while() loop with the iterator initialized far from the loop. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ARM: PL08x: fix spelling errorsRussell King - ARM Linux2011-01-051-20/+17Star
| | | | | | | | Correct mis-spellings in comments and printk strings. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* dmaengine: driver for the ARM PL080/PL081 PrimeCells v5Linus Walleij2010-09-301-0/+2167
This creates a DMAengine driver for the ARM PL080/PL081 PrimeCells based on the implementation earlier submitted by Peter Pearse. This is working like a charm for memcpy and slave DMA to the PL011 PrimeCell on the PB11MPCore. This DMA controller is used in mostly unmodified form in the ARM RealView and Versatile platforms, in the ST-Ericsson Nomadik, and in the ST SPEAr platform. It has been converted to use the header from the Samsung PL080 derivate instead of its own defintions. The Samsungs have a custom driver in their mach-* folders though, atleast we can share the register definitions. Cc: Peter Pearse <peter.pearse@arm.com> Cc: Ben Dooks <ben-linux@fluff.org> Cc: Kukjin Kim <kgene.kim@samsung.com> Cc: Alessandro Rubini <rubini@unipv.it> Acked-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> [GFP_KERNEL to GFP_NOWAIT in pl08x_prep_dma_memcpy] Signed-off-by: Dan Williams <dan.j.williams@intel.com>