aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/dmabounce.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2008-07-26dma-mapping: add the device argument to dma_mapping_error()FUJITA Tomonori1-1/+1
Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER architecture does: This enables us to cleanly fix the Calgary IOMMU issue that some devices are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423). I think that per-device dma_mapping_ops support would be also helpful for KVM people to support PCI passthrough but Andi thinks that this makes it difficult to support the PCI passthrough (see the above thread). So I CC'ed this to KVM camp. Comments are appreciated. A pointer to dma_mapping_ops to struct dev_archdata is added. If the pointer is non NULL, DMA operations in asm/dma-mapping.h use it. If it's NULL, the system-wide dma_ops pointer is used as before. If it's useful for KVM people, I plan to implement a mechanism to register a hook called when a new pci (or dma capable) device is created (it works with hot plugging). It enables IOMMUs to set up an appropriate dma_mapping_ops per device. The major obstacle is that dma_mapping_error doesn't take a pointer to the device unlike other DMA operations. So x86 can't have dma_mapping_ops per device. Note all the POWER IOMMUs use the same dma_mapping_error function so this is not a problem for POWER but x86 IOMMUs use different dma_mapping_error functions. The first patch adds the device argument to dma_mapping_error. The patch is trivial but large since it touches lots of drivers and dma-mapping.h in all the architecture. This patch: dma_mapping_error() doesn't take a pointer to the device unlike other DMA operations. So we can't have dma_mapping_ops per device. Note that POWER already has dma_mapping_ops per device but all the POWER IOMMUs use the same dma_mapping_error function. x86 IOMMUs use device argument. [akpm@linux-foundation.org: fix sge] [akpm@linux-foundation.org: fix svc_rdma] [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: fix bnx2x] [akpm@linux-foundation.org: fix s2io] [akpm@linux-foundation.org: fix pasemi_mac] [akpm@linux-foundation.org: fix sdhci] [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: fix sparc] [akpm@linux-foundation.org: fix ibmvscsi] Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Muli Ben-Yehuda <muli@il.ibm.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Avi Kivity <avi@qumranet.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-21driver core: fix a lot of printk usages of bus_idGreg Kroah-Hartman1-13/+9
We have the dev_printk() variants for this kind of thing, use them instead of directly trying to access the bus_id field of struct device. This is done in order to remove bus_id entirely. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-06-22[ARM] Export dma_sync_sg_for_device()Russell King1-1/+2
Noticed by Martin Michlmayr, this missing export prevents IEEE1394 from building with: ERROR: "dma_sync_sg_for_device" [drivers/ieee1394/ieee1394.ko] undefined! Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-10-23arm: build fixFUJITA Tomonori1-0/+1
arch/arm/common/dmabounce.c: In function 'dma_map_sg': arch/arm/common/dmabounce.c:445: error: implicit declaration of function 'sg_page' Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-22Update arch/ to use sg helpersJens Axboe1-1/+1
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-12[ARM] Rename consistent_sync() as dma_cache_maint()Russell King1-2/+2
consistent_sync() is used to handle the cache maintainence issues with DMA operations. Since we've now removed the misuse of this function from the two MTD drivers, rename it to prevent future mis-use. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-05-20[ARM] spelling fixesSimon Arlott1-1/+1
Spelling fixes in arch/arm/. Signed-off-by: Simon Arlott <simon@fire.lp0.eu> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-17Merge AT91, EP93xx, General devel, PXA, S3C, V6+ and Xscale treesRussell King1-7/+14
2007-02-12[ARM] Convert dmabounce statistics to use a device attributeRussell King1-20/+15
Rather than printk'ing the dmabounce statistics occasionally to the kernel log, provide a sysfs file to allow this information to be periodically read. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-12[ARM] Add a reference from struct device to the dma bounce infoRussell King1-24/+7
dmabounce keeps a per-device structure, and finds the correct structure by walking a list. Since architectures can now add fields to struct device, we can attach this structure direct to the struct device, thereby eliminating the code to search the list. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-08[ARM] Convert DMA cache handling to take const void * argsRussell King1-4/+3
The DMA cache handling functions take virtual addresses, but in the form of unsigned long arguments. This leads to a little confusion about what exactly they take. So, convert them to take const void * instead. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-08[ARM] 4134/1: Add generic support for outer cachesCatalin Marinas1-0/+1
The outer cache can be L2 as on RealView/EB MPCore platform or even L3 or further on ARMv7 cores. This patch adds the generic support for flushing the outer cache in the DMA operations. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2007-02-08[ARM] Don't call consistent_sync() for DMA coherent memoryRussell King1-3/+10
Memory allocated by the coherent memory allocators will be marked uncacheable, which means it's pointless calling consistent_sync() to perform cache maintainence on this memory; it's just a waste of CPU cycles. Moreover, with the (subsequent) merge of outer cache support, it actually breaks things to call consistent_sync() on anything but direct-mapped memory. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-11-02[ARM] 3917/1: Fix dmabounce symbol exportsKevin Hilman1-1/+2
dma_sync_single is no more (and to be removed in 2.7) so this export should be dma_sync_single_for_cpu. Also export dma_sync_single_for_device. Signed-off-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-08-18[ARM] 3755/1: dmabounce: fix return value for find_safe_bufferKevin Hilman1-3/+5
Patch from Kevin Hilman Previous locking changes to dmabounce incorrectly return non-NULL even when buffer not found. Fix it up. Signed-off-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-06-22[ARM] 3537/1: Rework DMA-bounce locking for finer granularityKevin Hilman1-46/+21
Patch from Kevin Hilman This time with IRQ versions of locks. Rework also enables compatability with realtime-preemption patch. With the current locking via interrupt disabling, under RT, potentially sleeping functions can be called with interrupts disabled. Signed-off-by: Kevin Hilman <khilman@mvista.com> Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2006-03-22[ARM] 3389/1: typo and grammar fixErik Hovland1-1/+1
Patch from Erik Hovland I found a typo and what seems to be a run-on sentence in arch/arm/common/dmabounce.c This patch corrects both. Signed-off-by: Erik Hovland <erik@hovland.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-10-30[ARM] Clean up dmabounceRussell King1-79/+86
Encapsulate pool data into dmabounce_pool. Only account successful allocations. Use dma_mapping_error(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-06-22[PATCH] ARM: Use list_for_each_entry() for dmabounceRussell King1-13/+5
Convert dmabounce.c to use list_for_each_entry() instead of list_for_each() + list_entry(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-06-20[PATCH] ARM: Add missed include for dmabounce.cRussell King1-0/+2
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-06-20[PATCH] ARM: Ensure DMA-bounced buffers are properly written to RAMRussell King1-2/+14
When DMA bounce buffers were unmapped and the data was memcpy'd to the original buffer, we were not ensuring that the data was written to RAM. This means that there was the potential for page cache pages to have different cache states depending whether they've been bounced or not. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2005-04-16Linux-2.6.12-rc2Linus Torvalds1-0/+682
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!