Skip to contentSkip to conversation

dmaengine: rcar-dmac: Rename highmem/lowmem

PATCH In review Magnus Damm 2 participants 2 messages Jan 14, 2016 – Jan 25, 2016

Subsystems (3)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 1/1 dmaengine: rcar-dmac: Rename highmem/lowmem

From: Magnus Damm <[email protected]>

Update the rcar-dmac driver to rework comments and variable names related to lowmem and highmem.

Terminology such as highmem and lowmem are commonly used for Linux kernel memory managment. Highmem in particular is about handling more physical memory than can fit into the kernel virtual address space.

Highmem and lowmem are related to but not equivalent to the 40-bit address limitation that is the real issue the rcar-dmac driver has to deal with. For instance, with 1 GiB of RAM highmem is usually needed on a 32-bit architecture, but a 32-bit address is still enough.

64-bit architectures tend to not use highmem since the virtual address space is more than enough for loads of lowmem. 32-bit architectures may still need highmem to access all memory.

The rcar-dmac driver and the DMA device needs to handle the 40-bit limitation on both 64-bit and 32-bit architectures.

This patch renames the highmem variable to fourty_bit_required to avoid confusion. And the comment gets updated as well.

---

 drivers/dma/sh/rcar-dmac.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/dma/sh/rcar-dmac.c +6 -6
@@ -889,7 +889,7 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_
 	unsigned int nchunks = 0;
 	unsigned int max_chunk_size;
 	unsigned int full_size = 0;
-	bool highmem = false;
+	bool fourty_bit_required = false;
 	unsigned int i;
 
 	desc = rcar_dmac_desc_get(chan);
@@ -935,7 +935,7 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_
 			 * hardware descriptor lists.
 			 */
 			if (dev_addr >> 32 || mem_addr >> 32)
-				highmem = true;
+				fourty_bit_required = true;
 #endif
 
 			chunk = rcar_dmac_xfer_chunk_get(chan);
@@ -977,13 +977,13 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_
 	 * Use hardware descriptor lists if possible when more than one chunk
 	 * needs to be transferred (otherwise they don't make much sense).
 	 *
-	 * The highmem check currently covers the whole transfer. As an
-	 * optimization we could use descriptor lists for consecutive lowmem
-	 * chunks and direct manual mode for highmem chunks. Whether the
+	 * The 40-bit address check currently covers the whole transfer. As an
+	 * optimization we could use descriptor lists for consecutive 32-bit
+	 * chunks and direct manual mode for 40-bit chunks. Whether the
 	 * performance improvement would be significant enough compared to the
 	 * additional complexity remains to be investigated.
 	 */
-	desc->hwdescs.use = !highmem && nchunks > 1;
+	desc->hwdescs.use = !fourty_bit_required && nchunks > 1;
 	if (desc->hwdescs.use) {
 		if (rcar_dmac_fill_hwdesc(chan, desc) < 0)
 			desc->hwdescs.use = false;
#1 lore raw

Hi Magnus,

Thank you for the patch.

Quoted 33 lines · On Thursday 14 January 2016 18:59:33 Magnus Damm wrote:

From: Magnus Damm <[email protected]>

Update the rcar-dmac driver to rework comments and variable names related to lowmem and highmem.

Terminology such as highmem and lowmem are commonly used for Linux kernel memory managment. Highmem in particular is about handling more physical memory than can fit into the kernel virtual address space.

Highmem and lowmem are related to but not equivalent to the 40-bit address limitation that is the real issue the rcar-dmac driver has to deal with. For instance, with 1 GiB of RAM highmem is usually needed on a 32-bit architecture, but a 32-bit address is still enough.

64-bit architectures tend to not use highmem since the virtual address space is more than enough for loads of lowmem. 32-bit architectures may still need highmem to access all memory.

The rcar-dmac driver and the DMA device needs to handle the 40-bit limitation on both 64-bit and 32-bit architectures.

This patch renames the highmem variable to fourty_bit_required to avoid confusion. And the comment gets updated as well.

---

 drivers/dma/sh/rcar-dmac.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

drivers/dma/sh/rcar-dmac.c rcar_dmac_chan_prep_sg(struct rcar_dmac_ · line 892

Quoted 5 lines
drivers/dma/sh/rcar-dmac.c +1 -1
@@ -889,7 +889,7 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_
 	unsigned int nchunks = 0;
 	unsigned int max_chunk_size;
 	unsigned int full_size = 0;
-	bool highmem = false;
+	bool fourty_bit_required = false;

s/fourty_bit_required/fourty_bits_required/ ? Or, as the variable name seems a bit long, need_40bits ?

Quoted 30 lines
drivers/dma/sh/rcar-dmac.c +5 -5
 	unsigned int i;
 
 	desc = rcar_dmac_desc_get(chan);
@@ -935,7 +935,7 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_
 			 * hardware descriptor lists.
 			 */
 			if (dev_addr >> 32 || mem_addr >> 32)
-				highmem = true;
+				fourty_bit_required = true;
 #endif
 
 			chunk = rcar_dmac_xfer_chunk_get(chan);
@@ -977,13 +977,13 @@ rcar_dmac_chan_prep_sg(struct rcar_dmac_
 	 * Use hardware descriptor lists if possible when more than one chunk
 	 * needs to be transferred (otherwise they don't make much sense).
 	 *
-	 * The highmem check currently covers the whole transfer. As an
-	 * optimization we could use descriptor lists for consecutive lowmem
-	 * chunks and direct manual mode for highmem chunks. Whether the
+	 * The 40-bit address check currently covers the whole transfer. As an
+	 * optimization we could use descriptor lists for consecutive 32-bit
+	 * chunks and direct manual mode for 40-bit chunks. Whether the
 	 * performance improvement would be significant enough compared to the
 	 * additional complexity remains to be investigated.
 	 */
-	desc->hwdescs.use = !highmem && nchunks > 1;
+	desc->hwdescs.use = !fourty_bit_required && nchunks > 1;
 	if (desc->hwdescs.use) {
 		if (rcar_dmac_fill_hwdesc(chan, desc) < 0)
 			desc->hwdescs.use = false;
Signature · 3 lines
Regards,

Laurent Pinchart