Skip to contentSkip to conversation

Mainline OMAP3 breakage (and other OMAP?)

PATCH Russell King - ARM Linux 5 participants 11 messages Dec 2, 2010 – Dec 14, 2010 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

This has been around since October:

drivers/video/omap2/vram.c: In function ?omap_vram_reserve_sdram_memblock?:
drivers/video/omap2/vram.c:573: error: ?MEMBLOCK_REAL_LIMIT? undeclared (first use in this function) drivers/video/omap2/vram.c:573: error: (Each undeclared identifier is reported only once drivers/video/omap2/vram.c:573: error: for each function it appears in.)

This requires a trivial one-liner compile fix:

drivers/video/omap2/vram.c +1 -1
index fed2a72..a8973f0 100644
@@ -570,7 +570,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 			return;
 		}
 	} else {
-		paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT);
+		paddr = memblock_alloc(size, PAGE_SIZE);
 	}
 
 	omap_vram_add_region(paddr, size);

which restores the old behaviour before the X86 memblock changes went in. Yes, there may be other changes due to the ioremap stuff, but that's really no excuse for not fixing the compile error itself.

Acked-by
#1 lore raw
Quoted 23 lines · Russell King - ARM Linux

This has been around since October:

drivers/video/omap2/vram.c: In function ?omap_vram_reserve_sdram_memblock?:
drivers/video/omap2/vram.c:573: error: ?MEMBLOCK_REAL_LIMIT? undeclared (first use in this function) drivers/video/omap2/vram.c:573: error: (Each undeclared identifier is reported only once drivers/video/omap2/vram.c:573: error: for each function it appears in.)

This requires a trivial one-liner compile fix:

drivers/video/omap2/vram.c +1 -1
index fed2a72..a8973f0 100644
@@ -570,7 +570,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 			return;
 		}
 	} else {
-		paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT);
+		paddr = memblock_alloc(size, PAGE_SIZE);
 	}
 
 	omap_vram_add_region(paddr, size);
Quoted 3 lines

which restores the old behaviour before the X86 memblock changes went in. Yes, there may be other changes due to the ioremap stuff, but that's really no excuse for not fixing the compile error itself.

Great. Adding fbdev and Tomi to Cc.

#2 lore raw
Quoted 24 lines · Tony Lindgren
Quoted 23 lines · Russell King - ARM Linux

This has been around since October:

drivers/video/omap2/vram.c: In function ?omap_vram_reserve_sdram_memblock?:
drivers/video/omap2/vram.c:573: error: ?MEMBLOCK_REAL_LIMIT? undeclared (first use in this function) drivers/video/omap2/vram.c:573: error: (Each undeclared identifier is reported only once drivers/video/omap2/vram.c:573: error: for each function it appears in.)

This requires a trivial one-liner compile fix:

drivers/video/omap2/vram.c +1 -1
index fed2a72..a8973f0 100644
@@ -570,7 +570,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 			return;
 		}
 	} else {
-		paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT);
+		paddr = memblock_alloc(size, PAGE_SIZE);
 	}
 
 	omap_vram_add_region(paddr, size);
Quoted 7 lines
Quoted 3 lines

which restores the old behaviour before the X86 memblock changes went in. Yes, there may be other changes due to the ioremap stuff, but that's really no excuse for not fixing the compile error itself.

Great. Adding fbdev and Tomi to Cc.

http://marc.info/?l=linux-omap&w=2&r=1&s=MEMBLOCK_REAL_LIMIT%20vram&q=b

There have been patches posted throughout November to fix this, but the problem is they're not making it to mainline. It needs chasing until someone does the right thing and sends one variant of the above patch, rather than just leaving it until the ioremap fixes hit mainline during the next merge window.

#3 lore raw
Quoted 33 lines · Russell King - ARM Linux
Quoted 24 lines · Tony Lindgren
Quoted 23 lines · Russell King - ARM Linux

This has been around since October:

drivers/video/omap2/vram.c: In function ?omap_vram_reserve_sdram_memblock?:
drivers/video/omap2/vram.c:573: error: ?MEMBLOCK_REAL_LIMIT? undeclared (first use in this function) drivers/video/omap2/vram.c:573: error: (Each undeclared identifier is reported only once drivers/video/omap2/vram.c:573: error: for each function it appears in.)

This requires a trivial one-liner compile fix:

drivers/video/omap2/vram.c +1 -1
index fed2a72..a8973f0 100644
@@ -570,7 +570,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 			return;
 		}
 	} else {
-		paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT);
+		paddr = memblock_alloc(size, PAGE_SIZE);
 	}
 
 	omap_vram_add_region(paddr, size);
Quoted 7 lines
Quoted 3 lines

which restores the old behaviour before the X86 memblock changes went in. Yes, there may be other changes due to the ioremap stuff, but that's really no excuse for not fixing the compile error itself.

Great. Adding fbdev and Tomi to Cc.

Quoted 7 lines

http://marc.info/?l=linux-omap&w=2&r=1&s=MEMBLOCK_REAL_LIMIT%20vram&q=b

There have been patches posted throughout November to fix this, but the problem is they're not making it to mainline. It needs chasing until someone does the right thing and sends one variant of the above patch, rather than just leaving it until the ioremap fixes hit mainline during the next merge window.

Yes this should go in during the -rc for sure.

I suggest you merge this but let's wait a bit and check if Tomi already has a similar fix queued for the -rc series.

Regards,

Tony

#4 lore raw
Quoted 42 lines · Tony Lindgren
Quoted 33 lines · Russell King - ARM Linux
Quoted 24 lines · Tony Lindgren
Quoted 23 lines · Russell King - ARM Linux

This has been around since October:

drivers/video/omap2/vram.c: In function ???omap_vram_reserve_sdram_memblock???:
drivers/video/omap2/vram.c:573: error: ???MEMBLOCK_REAL_LIMIT??? undeclared (first use in this function) drivers/video/omap2/vram.c:573: error: (Each undeclared identifier is reported only once drivers/video/omap2/vram.c:573: error: for each function it appears in.)

This requires a trivial one-liner compile fix:

drivers/video/omap2/vram.c +1 -1
index fed2a72..a8973f0 100644
@@ -570,7 +570,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 			return;
 		}
 	} else {
-		paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT);
+		paddr = memblock_alloc(size, PAGE_SIZE);
 	}
 
 	omap_vram_add_region(paddr, size);
Quoted 7 lines
Quoted 3 lines

which restores the old behaviour before the X86 memblock changes went in. Yes, there may be other changes due to the ioremap stuff, but that's really no excuse for not fixing the compile error itself.

Great. Adding fbdev and Tomi to Cc.

Quoted 7 lines

http://marc.info/?l=linux-omap&w=2&r=1&s=MEMBLOCK_REAL_LIMIT%20vram&q=b

There have been patches posted throughout November to fix this, but the problem is they're not making it to mainline. It needs chasing until someone does the right thing and sends one variant of the above patch, rather than just leaving it until the ioremap fixes hit mainline during the next merge window.

Quoted 5 lines

Yes this should go in during the -rc for sure.

I suggest you merge this but let's wait a bit and check if Tomi already has a similar fix queued for the -rc series.

This has been fixed since -rc2.

#5 lore raw
Quoted 43 lines · Paul Mundt
Quoted 42 lines · Tony Lindgren
Quoted 40 lines · Russell King - ARM Linux
Quoted 24 lines · Tony Lindgren
Quoted 23 lines · Russell King - ARM Linux

This has been around since October:

drivers/video/omap2/vram.c: In function ???omap_vram_reserve_sdram_memblock???:
drivers/video/omap2/vram.c:573: error: ???MEMBLOCK_REAL_LIMIT??? undeclared (first use in this function) drivers/video/omap2/vram.c:573: error: (Each undeclared identifier is reported only once drivers/video/omap2/vram.c:573: error: for each function it appears in.)

This requires a trivial one-liner compile fix:

drivers/video/omap2/vram.c +1 -1
index fed2a72..a8973f0 100644
@@ -570,7 +570,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 			return;
 		}
 	} else {
-		paddr = memblock_alloc_base(size, PAGE_SIZE, MEMBLOCK_REAL_LIMIT);
+		paddr = memblock_alloc(size, PAGE_SIZE);
 	}
 
 	omap_vram_add_region(paddr, size);
Quoted 7 lines
Quoted 3 lines

which restores the old behaviour before the X86 memblock changes went in. Yes, there may be other changes due to the ioremap stuff, but that's really no excuse for not fixing the compile error itself.

Great. Adding fbdev and Tomi to Cc.

http://marc.info/?l=linux-omap&w=2&r=1&s=MEMBLOCK_REAL_LIMIT%20vram&q=b

There have been patches posted throughout November to fix this, but the problem is they're not making it to mainline. It needs chasing until someone does the right thing and sends one variant of the above patch, rather than just leaving it until the ioremap fixes hit mainline during the next merge window.

Quoted 6 lines
Quoted 5 lines

Yes this should go in during the -rc for sure.

I suggest you merge this but let's wait a bit and check if Tomi already has a similar fix queued for the -rc series.

This has been fixed since -rc2.

So it is. However, the ioremap fix is wrong.

        } else {
                paddr = memblock_alloc(size, PAGE_SIZE);
        }

        memblock_free(paddr, size);
        memblock_remove(paddr, size);

Didn't I say that such blocks were supposed to be aligned to a 2MB boundary - and the size also so aligned?

http://lists.arm.linux.org.uk/lurker/message/20101011.152516.893a6088.en.html

It at least needs to be 1MB as that's the section size.

#6 lore raw
Quoted 9 lines · Russell King - ARM Linux
Quoted 1 line · Paul Mundt

This has been fixed since -rc2.

So it is. ?However, the ioremap fix is wrong.

? ? ? ?} else {
? ? ? ? ? ? ? ?paddr = memblock_alloc(size, PAGE_SIZE); ? ? ? ?}

Quoted 5 lines

? ? ? ?memblock_free(paddr, size);
? ? ? ?memblock_remove(paddr, size);

Didn't I say that such blocks were supposed to be aligned to a 2MB boundary - and the size also so aligned?

I asked you if there was something special and I didn't receive any response:
http://article.gmane.org/gmane.linux.kernel/1048434

So, why SZ_2M?

Signature · 1 line
Felipe Contreras
#7 lore raw
Quoted 11 lines · Felipe Contreras
Quoted 9 lines · Russell King - ARM Linux
Quoted 1 line · Paul Mundt

This has been fixed since -rc2.

So it is. ?However, the ioremap fix is wrong.

? ? ? ?} else {
? ? ? ? ? ? ? ?paddr = memblock_alloc(size, PAGE_SIZE); ? ? ? ?}

Quoted 8 lines
Quoted 5 lines

? ? ? ?memblock_free(paddr, size);
? ? ? ?memblock_remove(paddr, size);

Didn't I say that such blocks were supposed to be aligned to a 2MB boundary - and the size also so aligned?

I asked you if there was something special and I didn't receive any response:
http://article.gmane.org/gmane.linux.kernel/1048434

So you thought you could ride rough-shod over my statement and ignore it? Thank you for treating me like shit, I'll remember that for future and treat you in a similar manner.

Quoted 1 line

So, why SZ_2M?

Firstly, that's the granularity which we allocate page tables - one Linux page table covers 2MB of memory. We want to avoid creating page tables for the main memory mapping as that increases TLB pressure through the use of additional TLB entries, and more page table walks.

Plus, we never used to allow the kernel's direct memory mapping to be mapped at anything less than section size - this restriction has since been lifted due to OMAP SRAM problems, but I'd rather we stuck with it to ensure that we have proper behaviour from all parts of the system.

Secondly, we don't want to end up with lots of fragmentation at the end of the memory mapping as that'll reduce performance, not only by making the pfn_valid() search more expensive.

Emsuring a minimum allocation size and alignment makes sure that the regions can be coalesced together into one block, and minimises run-time expenses.

So please, 2MB, or if you object, at the _very_ _least_ 1MB. But definitely not PAGE_SIZE.

#8 lore raw
Quoted 18 lines · Russell King - ARM Linux
Quoted 17 lines · Felipe Contreras
Quoted 14 lines · Russell King - ARM Linux
Quoted 1 line · Paul Mundt

This has been fixed since -rc2.

So it is. ?However, the ioremap fix is wrong.

? ? ? ?} else {
? ? ? ? ? ? ? ?paddr = memblock_alloc(size, PAGE_SIZE); ? ? ? ?}

? ? ? ?memblock_free(paddr, size);
? ? ? ?memblock_remove(paddr, size);

Didn't I say that such blocks were supposed to be aligned to a 2MB boundary - and the size also so aligned?

Quoted 6 lines
Quoted 2 lines

I asked you if there was something special and I didn't receive any response:
http://article.gmane.org/gmane.linux.kernel/1048434

So you thought you could ride rough-shod over my statement and ignore it? Thank you for treating me like shit, I'll remember that for future and treat you in a similar manner.

No, you didn't make any statement, just provided code. I thought SZ_2M might have just been an example for something that required that alignment, thus my request for clarification.

Quoted 16 lines
Quoted 1 line

So, why SZ_2M?

Firstly, that's the granularity which we allocate page tables - one Linux page table covers 2MB of memory. ?We want to avoid creating page tables for the main memory mapping as that increases TLB pressure through the use of additional TLB entries, and more page table walks.

Plus, we never used to allow the kernel's direct memory mapping to be mapped at anything less than section size - this restriction has since been lifted due to OMAP SRAM problems, but I'd rather we stuck with it to ensure that we have proper behaviour from all parts of the system.

Secondly, we don't want to end up with lots of fragmentation at the end of the memory mapping as that'll reduce performance, not only by making the pfn_valid() search more expensive.

Quoted 6 lines

Emsuring a minimum allocation size and alignment makes sure that the regions can be coalesced together into one block, and minimises run-time expenses.

So please, 2MB, or if you object, at the _very_ _least_ 1MB. ?But definitely not PAGE_SIZE.

Fair enough. If nobody beats me to it I would send patches to fix that, although perhaps it would make sense to write a helper function that does exactly this.

Cheers.

Signature · 1 line
Felipe Contreras
#9 lore raw
In reply to Russell King - ARM Linux

Hi,

Quoted 2 lines · ext Russell King - ARM Linux

So please, 2MB, or if you object, at the _very_ _least_ 1MB. But definitely not PAGE_SIZE.

Here's a patch for this. Works for me on OMAP3430SDP. If the patch is ok, I'll send a pull request to Paul.

Acked-by
#10 lore raw
Quoted 3 lines · Tomi Valkeinen
Quoted 3 lines

So please, 2MB, or if you object, at the _very_ _least_ 1MB. But definitely not PAGE_SIZE.

Quoted 32 lines
---
 drivers/video/omap2/vram.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/video/omap2/vram.c +2 -2
index 2fd7e52..9441e2e 100644
@@ -551,7 +551,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 	if (!size)
 		return;
 
-	size = PAGE_ALIGN(size);
+	size = ALIGN(size, SZ_2M);
 
 	if (paddr) {
 		if (paddr & ~PAGE_MASK) {
@@ -576,7 +576,7 @@ void __init omap_vram_reserve_sdram_memblock(void)
 			return;
 		}
 	} else {
-		paddr = memblock_alloc(size, PAGE_SIZE);
+		paddr = memblock_alloc(size, SZ_2M);
 	}
 
 	memblock_free(paddr, size);
Signature · 1 line
1.7.1