<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/dma/coherent.c, branch v5.15.2</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.2</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.15.2'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2021-08-19T07:02:39Z</updated>
<entry>
<title>dma-mapping: make the global coherent pool conditional</title>
<updated>2021-08-19T07:02:39Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-06-24T17:37:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=22f9feb49950885cdb6e37513f134d154175e743'/>
<id>urn:sha1:22f9feb49950885cdb6e37513f134d154175e743</id>
<content type='text'>
Only build the code to support the global coherent pool if support for
it is enabled.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Tested-by: Dillon Min &lt;dillon.minfei@gmail.com&gt;
</content>
</entry>
<entry>
<title>dma-mapping: add a dma_init_global_coherent helper</title>
<updated>2021-08-18T14:24:11Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-06-23T14:05:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=39a2d3506b2d53c569a6db13d65b2f3728c4feec'/>
<id>urn:sha1:39a2d3506b2d53c569a6db13d65b2f3728c4feec</id>
<content type='text'>
Add a new helper to initialize the global coherent pool.  This both
cleans up the existing initialization which indirects through the
reserved_mem_ops that are normally only used for struct device, and
also allows using the global pool for non-devicetree architectures.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Tested-by: Dillon Min &lt;dillon.minfei@gmail.com&gt;
</content>
</entry>
<entry>
<title>dma-mapping: simplify dma_init_coherent_memory</title>
<updated>2021-08-18T14:24:10Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-06-23T14:00:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a6933571f34a9aee843fff2aa4b96949c57d6274'/>
<id>urn:sha1:a6933571f34a9aee843fff2aa4b96949c57d6274</id>
<content type='text'>
Return the allocated dma_coherent_mem structure, set the
use_dma_pfn_offset and print the failure warning inside of
dma_init_coherent_memory instead of leaving that to the callers.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Tested-by: Dillon Min &lt;dillon.minfei@gmail.com&gt;
</content>
</entry>
<entry>
<title>dma-mapping: allow using the global coherent pool for !ARM</title>
<updated>2021-08-18T14:24:10Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2021-06-24T17:38:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=70d6aa0ecfed253a2b14659a6c77359af6d9b3ee'/>
<id>urn:sha1:70d6aa0ecfed253a2b14659a6c77359af6d9b3ee</id>
<content type='text'>
Switch an ifdef so that the global coherent pool is initialized for
any architecture that selects the DMA_GLOBAL_POOL symbol insted of
hardcoding ARM.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Tested-by: Dillon Min &lt;dillon.minfei@gmail.com&gt;
</content>
</entry>
<entry>
<title>dma-mapping: remove a trailing space</title>
<updated>2021-06-22T06:15:46Z</updated>
<author>
<name>Zhen Lei</name>
<email>thunder.leizhen@huawei.com</email>
</author>
<published>2021-06-08T07:52:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=bab1622350699dc209db4f50d9ab99e6f6465334'/>
<id>urn:sha1:bab1622350699dc209db4f50d9ab99e6f6465334</id>
<content type='text'>
Signed-off-by: Zhen Lei &lt;thunder.leizhen@huawei.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: split &lt;linux/dma-mapping.h&gt;</title>
<updated>2020-10-06T05:07:03Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-09-22T13:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0a0f0d8be76dcd4390ff538e7060fda34db79717'/>
<id>urn:sha1:0a0f0d8be76dcd4390ff538e7060fda34db79717</id>
<content type='text'>
Split out all the bits that are purely for dma_map_ops implementations
and related code into a new &lt;linux/dma-map-ops.h&gt; header so that they
don't get pulled into all the drivers.  That also means the architecture
specific &lt;asm/dma-mapping.h&gt; is not pulled in by &lt;linux/dma-mapping.h&gt;
any more, which leads to a missing includes that were pulled in by the
x86 or arm versions in a few not overly portable drivers.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: introduce DMA range map, supplanting dma_pfn_offset</title>
<updated>2020-09-17T16:43:56Z</updated>
<author>
<name>Jim Quinlan</name>
<email>james.quinlan@broadcom.com</email>
</author>
<published>2020-09-17T16:43:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e0d072782c734d27f5af062c62266f2598f68542'/>
<id>urn:sha1:e0d072782c734d27f5af062c62266f2598f68542</id>
<content type='text'>
The new field 'dma_range_map' in struct device is used to facilitate the
use of single or multiple offsets between mapping regions of cpu addrs and
dma addrs.  It subsumes the role of "dev-&gt;dma_pfn_offset" which was only
capable of holding a single uniform offset and had no region bounds
checking.

The function of_dma_get_range() has been modified so that it takes a single
argument -- the device node -- and returns a map, NULL, or an error code.
The map is an array that holds the information regarding the DMA regions.
Each range entry contains the address offset, the cpu_start address, the
dma_start address, and the size of the region.

of_dma_configure() is the typical manner to set range offsets but there are
a number of ad hoc assignments to "dev-&gt;dma_pfn_offset" in the kernel
driver code.  These cases now invoke the function
dma_direct_set_offset(dev, cpu_addr, dma_addr, size).

Signed-off-by: Jim Quinlan &lt;james.quinlan@broadcom.com&gt;
[hch: various interface cleanups]
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
Tested-by: Mathieu Poirier &lt;mathieu.poirier@linaro.org&gt;
Tested-by: Nathan Chancellor &lt;natechancellor@gmail.com&gt;
</content>
</entry>
<entry>
<title>dma-mapping: move the dma_declare_coherent_memory documentation</title>
<updated>2020-09-11T07:17:42Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2020-08-18T17:32:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a92df4f62fda02e6b141e2b0bb52ccc486264b1c'/>
<id>urn:sha1:a92df4f62fda02e6b141e2b0bb52ccc486264b1c</id>
<content type='text'>
dma_declare_coherent_memory should not be in a DMA API guide aimed
at driver writers (that is consumers of the API).  Move it to a comment
near the function instead.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
</content>
</entry>
<entry>
<title>dma-coherent: fix integer overflow in the reserved-memory dma allocation</title>
<updated>2020-03-16T09:43:02Z</updated>
<author>
<name>Kevin Grandemange</name>
<email>kevin.grandemange@allegrodvt.com</email>
</author>
<published>2020-03-12T15:41:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=286c21de32b904131f8cf6a36ce40b8b0c9c5da3'/>
<id>urn:sha1:286c21de32b904131f8cf6a36ce40b8b0c9c5da3</id>
<content type='text'>
pageno is an int and the PAGE_SHIFT shift is done on an int,
overflowing if the memory is bigger than 2G

This can be reproduced using for example a reserved-memory of 4G

reserved-memory {
		    #address-cells = &lt;2&gt;;
		    #size-cells = &lt;2&gt;;
		    ranges;

		    reserved_dma: buffer@0 {
		        compatible = "shared-dma-pool";
		        no-map;
		        reg = &lt;0x5 0x00000000 0x1 0x0&gt;;
        };
};

Signed-off-by: Kevin Grandemange &lt;kevin.grandemange@allegrodvt.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
<entry>
<title>dma-mapping: fix handling of dma-ranges for reserved memory (again)</title>
<updated>2019-10-30T18:07:35Z</updated>
<author>
<name>Vladimir Murzin</name>
<email>vladimir.murzin@arm.com</email>
</author>
<published>2019-10-30T10:13:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a445e940ea686fc60475564009821010eb213be3'/>
<id>urn:sha1:a445e940ea686fc60475564009821010eb213be3</id>
<content type='text'>
Daniele reported that issue previously fixed in c41f9ea998f3
("drivers: dma-coherent: Account dma_pfn_offset when used with device
tree") reappear shortly after 43fc509c3efb ("dma-coherent: introduce
interface for default DMA pool") where fix was accidentally dropped.

Lets put fix back in place and respect dma-ranges for reserved memory.

Fixes: 43fc509c3efb ("dma-coherent: introduce interface for default DMA pool")

Reported-by: Daniele Alessandrelli &lt;daniele.alessandrelli@gmail.com&gt;
Tested-by: Daniele Alessandrelli &lt;daniele.alessandrelli@gmail.com&gt;
Tested-by: Alexandre Torgue &lt;alexandre.torgue@st.com&gt;
Signed-off-by: Vladimir Murzin &lt;vladimir.murzin@arm.com&gt;
Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
</content>
</entry>
</feed>
