Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-07 Thread Eli Billauer
Hello Shuah, We agree that the streaming API was originally *intended* for short map-unmap DMA sessions, and that dma_alloc_noncoherent() was the *intended* API for those who want to hold the DMA during a device's lifetime. We also agree that on some platforms, DMA mappings are precious, an

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-06 Thread Eli Billauer
On 06/06/14 19:01, Greg KH wrote: Please try to put yourself in my position: I have a driver that I care > about, which works fine for a few years. It's based upon dma_map_single(), > which seems to be the common way to get non-coherent memory, even for the > driver's entire lifespan. I realiz

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-06 Thread Eli Billauer
Hello Joerg. On 05/06/14 00:25, Joerg Roedel wrote: What you are trying to do should work with dma_alloc_noncoherent(). The API allows partial syncs on this memory, so you should be fine. Please try to put yourself in my position: I have a driver that I care about, which works fine for a

Re: [PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-04 Thread Eli Billauer
Hi, I believe that I need a managed dma_map_single() my own driver, which doesn't fall in the case of a single use: The driver allocates its buffers with __get_free_pages() (or the to-be managed version of it). Then it cuts the allocated memory into smaller buffers (in some cases, and with ce

[PATCH v2 0/4] devres: dma-mapping: Introducing new functions

2014-06-02 Thread Eli Billauer
() into dma_map_single_attrs(), and implements the former as a macro. Functions added: * dmam_map_single_attrs() * dmam_unmap_single_attrs() Xillybus' driver works with and without this patch (depends on patches #1 and #3 only). Thanks, Eli Eli Billauer (4): dma-mapping: Add devm_ interfac

[PATCH v2 4/4] staging: xillybus: Use devm_ API for memory allocation and DMA mapping

2014-06-02 Thread Eli Billauer
Managed device resource API replaces code that reinvents it for memory allocation, page allocation and DMA mapping. Suggested-by: Baruch Siach Signed-off-by: Eli Billauer --- drivers/staging/xillybus/xillybus.h | 38 +-- drivers/staging/xillybus/xillybus_core.c | 186

[PATCH v2 1/4] dma-mapping: Add devm_ interface for dma_map_single()

2014-06-02 Thread Eli Billauer
lways returns success. Thanks to Tejun Heo for suggesting this API. Signed-off-by: Eli Billauer --- Documentation/driver-model/devres.txt |2 + drivers/base/dma-mapping.c| 86 + include/linux/dma-mapping.h |6 ++- 3 files change

[PATCH v2 3/4] dma-mapping: pci: Add devm_ interface for pci_map_single

2014-06-02 Thread Eli Billauer
Signed-off-by: Eli Billauer --- Documentation/driver-model/devres.txt |2 ++ include/asm-generic/pci-dma-compat.h | 18 ++ 2 files changed, 20 insertions(+), 0 deletions(-) diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt index

[PATCH v2 2/4] dma-mapping: Add devm_ interface for dma_map_single_attrs()

2014-06-02 Thread Eli Billauer
dmam_map_single_attrs() and dmam_unmap_single_attrs() replace the non-*_attrs functions, which are implemented as defines instead. The case of a non-NULL @attrs parameter has not been tested. Suggested-by: Tejun Heo Signed-off-by: Eli Billauer --- Documentation/driver-model/devres.txt