summaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/dma.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "scatterlist: use sg_phys()"Dan Williams2015-12-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | commit db0fa0cb0157 "scatterlist: use sg_phys()" did replacements of the form: phys_addr_t phys = page_to_phys(sg_page(s)); phys_addr_t phys = sg_phys(s) & PAGE_MASK; However, this breaks platforms where sizeof(phys_addr_t) > sizeof(unsigned long). Revert for 4.3 and 4.4 to make room for a combined helper in 4.5. Cc: <stable@vger.kernel.org> Cc: Jens Axboe <axboe@fb.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Russell King <linux@arm.linux.org.uk> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Andrew Morton <akpm@linux-foundation.org> Fixes: db0fa0cb0157 ("scatterlist: use sg_phys()") Suggested-by: Joerg Roedel <joro@8bytes.org> Reported-by: Vitaly Lavrov <vel21ripn@gmail.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* scatterlist: use sg_phys()Dan Williams2015-08-171-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Coccinelle cleanup to replace open coded sg to physical address translations. This is in preparation for introducing scatterlists that reference __pfn_t. // sg_phys.cocci: convert usage page_to_phys(sg_page(sg)) to sg_phys(sg) // usage: make coccicheck COCCI=sg_phys.cocci MODE=patch virtual patch @@ struct scatterlist *sg; @@ - page_to_phys(sg_page(sg)) + sg->offset + sg_phys(sg) @@ struct scatterlist *sg; @@ - page_to_phys(sg_page(sg)) + sg_phys(sg) & PAGE_MASK Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
* microblaze: Label local function staticMichal Simek2015-06-081-0/+1
| | | | | | | | | | Warnings found by sparse: arch/microblaze/kernel/dma.c:157:5: warning: symbol 'dma_direct_mmap_coherent' was not declared. Should it be static? arch/microblaze/kernel/kgdb.c:35:14: warning: symbol 'pvr' was not declared. Should it be static? Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* microblaze: Fix mmap for cache coherent memoryLars-Peter Clausen2014-12-171-0/+27
| | | | | | | | | | | | | | | When running in non-cache coherent configuration the memory that was allocated with dma_alloc_coherent() has a custom mapping and so there is no 1-to-1 relationship between the kernel virtual address and the PFN. This means that virt_to_pfn() will not work correctly for those addresses and the default mmap implementation in the form of dma_common_mmap() will map some random, but not the requested, memory area. Fix this by providing a custom mmap implementation that looks up the PFN from the page table rather than using virt_to_pfn. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* microblaze: Do not setup empty unmap_sg functionMichal Simek2014-06-041-7/+0Star
| | | | | | | No reason to setup empty function. Core is checking if this function should be called or not. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* microblaze: Cleanup PCI_DRAM_OFFSET handlingMichal Simek2014-06-041-20/+3Star
| | | | | | | | | PCI_DRAM_OFFSET/pci_dram_offset is 0 all the time and there is no difference for PCI and !PCI cases. Also remove the whole code which setup archdata.dma_data which is completely unused. Signed-off-by: Michal Simek <michal.simek@xilinx.com>
* microblaze: Fix coding style issuesMichal Simek2013-02-121-3/+3
| | | | | | Fix coding style issues reported by checkpatch.pl. Signed-off-by: Michal Simek <monstr@monstr.eu>
* Microblaze: adapt for dma_map_ops changesAndrzej Pietrasiewicz2012-03-281-4/+6
| | | | | | | | | | | Adapt core Microblaze architecture code for dma_map_ops changes: replace alloc/free_coherent with generic alloc/free methods. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> [fixed coding style issues] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
* Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds2011-11-071-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
| * microblaze: Add export.h to arch/microblaze files as requiredPaul Gortmaker2011-11-011-0/+1
| | | | | | | | | | | | For access to the EXPORT_SYMBOL variants and THIS_MODULE macros. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* | microblaze: Added DMA sync operationsEli Billauer2011-10-141-0/+60
| | | | | | | | | | | | | | Added support gor dma_direct_sync_single_for_*() and dma_direct_sync_sg_for_*() Signed-off-by: Eli Billauer <eli.billauer@gmail.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
* | microblaze: Moved __dma_sync() to dma-mapping.hEli Billauer2011-10-141-19/+3Star
|/ | | | | | | | __dma_sync_page() was replaced by __dma_sync(), and parameters of calls to the new function were adjusted to match __dma_sync()'s format. Signed-off-by: Eli Billauer <eli.billauer@gmail.com> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Add support for DMA_BIDIRECTIONALMichal Simek2011-03-091-0/+1
| | | | | | CDMA requires DMA_BIDIRECTIONAL option. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix sg_dma_len() regressionFUJITA Tomonori2010-06-091-1/+0Star
| | | | | | | | | | | | | | | | The commit "asm-generic: add NEED_SG_DMA_LENGTH to define sg_dma_len()" 18e98307de0d746cb0845ebf66535ce2184c25a2 broke microblaze compilation. dma_direct_map_sg() sets sg->dma_length, however microblaze doesn't set NEED_SG_DMA_LENGTH so scatterlist strcutres doesn't include dma_length. sg->dma_length is always equal to sg->length on microblaze. So we don't need to set set dma_length, that is, microblaze can simply use sg->length. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Fix consistent codeMichal Simek2010-05-061-1/+1
| | | | | | | | | | | | This patch fix consistent code which had problems with consistent_free function. I am not sure if we need to call flush_tlb_all after it but it keeps tlbs synced. I added noMMU and MMU version together. Uncached shadow feature is not tested. Signed-off-by: Michal Simek <monstr@monstr.eu>
* Merge branch 'master' into export-slabhTejun Heo2010-04-051-1/+1
|\
| * microblaze: Adding likely macrosMichal Simek2010-04-011-1/+1
| | | | | | | | | | | | | | On the base on GCOV analytics is helpful to add likely/unlikely macros. Signed-off-by: Michal Simek <monstr@monstr.eu>
* | include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* microblaze: Fix dma alloc and free coherent dma functionsMichal Simek2010-03-111-4/+13
| | | | | | | | | | We have to use consistent code to be able to do coherent dma function. In consistent code is used cache inhibit page mapping. Xilinx reported that there is bug in Microblaze for WB and d-cache_always use option. Microblaze 7.30.a should be first version where is this bug removed. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Preliminary support for dma driversMichal Simek2010-03-111-6/+3Star
| | | | | | | | I found several problems for ll_temac driver and on system with WB. This early fix should fix it. I will clean this patch before I will add it to mainline Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Preliminary support for dma driversMichal Simek2010-03-111-6/+12
| | | | | | | | I found several problems for ll_temac driver and on system with WB. This early fix should fix it. I will clean this patch before I will add it to mainline Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Implement __dma_sync_pageMichal Simek2010-03-111-3/+23
| | | | | | There is necessary to do some cache handling for dma operations. Signed-off-by: Michal Simek <monstr@monstr.eu>
* microblaze: Support DMAMichal Simek2010-03-111-0/+124
Add DMA support for Microblaze. There are some part of this new feature: 1. Basic DMA support 2. Enable DMA debug option 3. Setup notifier Ad 1. dma-mapping come from powerpc and x86 version and it is based on generic dma-mapping-common.h Ad 2. DMA support debug features which is used in generic file. For more information please look at Documentation/DMA-API.txt Ad 3. notifier is very important to setup dma_ops. Without this part for example ll_temac driver failed because there are no setup dma operations. Signed-off-by: Michal Simek <monstr@monstr.eu>