| Age | Commit message (Collapse) | Author |
|
Implement device resource management, in short, devres. A device
driver can allocate arbirary size of devres data which is associated
with a release function. On driver detach, release function is
invoked on the devres data, then, devres data is freed.
devreses are typed by associated release functions. Some devreses are
better represented by single instance of the type while others need
multiple instances sharing the same release function. Both usages are
supported.
devreses can be grouped using devres group such that a device driver
can easily release acquired resources halfway through initialization
or selectively release resources (e.g. resources for port 1 out of 4
ports).
This patch adds devres core including documentation and the following
managed interfaces.
* alloc/free : devm_kzalloc(), devm_kzfree()
* IO region : devm_request_region(), devm_release_region()
* IRQ : devm_request_irq(), devm_free_irq()
* DMA : dmam_alloc_coherent(), dmam_free_coherent(),
dmam_declare_coherent_memory(), dmam_pool_create(),
dmam_pool_destroy()
* PCI : pcim_enable_device(), pcim_pin_device(), pci_is_managed()
* iomap : devm_ioport_map(), devm_ioport_unmap(), devm_ioremap(),
devm_ioremap_nocache(), devm_iounmap(), pcim_iomap_table(),
pcim_iomap(), pcim_iounmap()
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
|
|
As suggested by Muli Ben-Yehuda this function is moved to generic code as
may be useful for all archs.
[akpm@osdl.org: fix]
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Typo will be harder with this one.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
|
|
These are the last conversions of pci_set_dma_mask(),
pci_set_consistent_dma_mask() and pci_dma_supported() to use DMA_xBIT_MASK
constants from linux/dma-mapping.h
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Replace all occurences of 0xff.. in calls to function pci_set_dma_mask()
and pci_set_consistant_dma_mask() with the corresponding DMA_xBIT_MASK from
linux/dma-mapping.h.
Signed-off-by: Matthias Gehre <M.Gehre@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch introduces the DMA_28BIT_MASK constant in dma-mapping.h
ALSA drivers using this mask are changed to use the new constant.
Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Acked-by: Takashi Iwai <tiwai@suse.de>
Acked-by: Jaroslav Kysela <perex@suse.cz>
|
|
Signed-Off-By: Lee Revell <rlrevell@joe-job.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
|
|
It seems that most architectures already include linux/device.h in their
own asm/dma-mapping.h. Most but not all, and some drivers fail to
compile on those architectures that don't. Since everybody needs it
let's include device.h from one place only and fix compilation for
everybody.
|
|
|
|
William Lee Irwin III <wli@holomorphy.com> wrote:
>
> SPLIT include/linux/autoconf.h -> include/config/*
> CHK include/linux/compile.h
> UPD include/linux/compile.h
> In file included from include/asm/sbus.h:10,
> from arch/sparc64/kernel/auxio.c:15:
It needs err.h.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
|
|
dma_mark_declared_memory_occupied() wasn't declared static inline in the NULL (default)
implementation leading to compile failures.
|
|
This new function fails to build on sparc64 due to nasty include
dependencies.
Fix that by uninlining it - it was too big for inlining anyway.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This adds the description and a null prototype.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
|
|
This patch implements dma_get_required_mask() which may be used by drivers
to probe the optimal DMA descriptor type they should be implementing on the
platform.
I've also tested it this time with the sym_2 driver...making it chose the
correct descriptors for the platform. (although I don't have a 64 bit
platform with >4GB memory, so I only confirmed it selects the 32 bit
descriptors all the time...)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
|
|
From: "David S. Miller" <davem@redhat.com>
Currently, for an existing DMA mapping, there is a way to transfer buffer
ownership back to the cpu, yet there is no way to give it back to the device
again explicitly. The latter really is needed on platforms where the PCI
subsystem does not snoop the cpu caches, MIPS is one example.
Many drivers were expecting the existing DMA sync interface to handle both
directions, which was wrong.
Now, with this change, we have explicit interfaces for DMA syncing to/from
the device and the cpu.
|
|
add dma_ API to mirror pci_ DMA API but phrased to use struct
device instead of struct pci_dev.
See Documentation/DMA-API.txt for details
|