Skip to contentSkip to conversation

Section mismatches in drivers/video/console/promcon

DISCUSSION Sam Ravnborg 4 participants 7 messages Jun 2, 2007 – Jun 5, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Building a kernel for sparc64 defconfig gave me following warnings:
WARNING: drivers/built-in.o(.text+0xb788): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb790): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb794): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb798): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')

The warnings happens because the function: promcon_init_unimap() references promfont_unitable and promfont_unicount which are marked __initdata by the conmakehash command in the drivers/video/console/Makefile

The function promcon_init_unimap() are referenced in two places:
1) In prom_con_init() which is marked __init => no problem.
2) In promcon_init() which is not marked __init => warning. The actual code is here:

	if (!promcon_uni_pagedir[0] && p) {
		promcon_init_unimap(conp);
	}

I could not from the code judge if promcon_init_unimap is really only used during early init or this is a bug.
If promcon_init_unimap() is only used during early init it should be marked __init_refok (with a proper comment) to silence the warning.

A few people in to: that I hope can help out (thanks to git blame)...

Sam

#1 lore raw
Quoted 2 lines · Sam Ravnborg

A few people in to: that I hope can help out (thanks to git blame)...

git needs a "praise" command, like svn. :>

Jan

#2 lore raw
In reply to Sam Ravnborg
Quoted 14 lines · Sam Ravnborg

Building a kernel for sparc64 defconfig gave me following warnings:
WARNING: drivers/built-in.o(.text+0xb788): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb790): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb794): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: drivers/built-in.o(.text+0xb798): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')

The warnings happens because the function: promcon_init_unimap() references promfont_unitable and promfont_unicount which are marked __initdata by the conmakehash command in the drivers/video/console/Makefile

The function promcon_init_unimap() are referenced in two places:
1) In prom_con_init() which is marked __init => no problem.
2) In promcon_init() which is not marked __init => warning. The actual code is here:

Quoted 7 lines
	if (!promcon_uni_pagedir[0] && p) {
		promcon_init_unimap(conp);
	}

could not from the code judge if promcon_init_unimap is really
only used during early init or this is a bug.

promcon_init() can be called again from visual_init() during vc_allocate(). So anything referenced by promcon_init() should not be marked __init.

Although, if you want to keep promfont_unitable and promfont_unicount __init, you can probably use con_copy_unimap() using the default vc as the source instead of doing a promcon_init_unimap() again.

Tony

#3 lore raw
Quoted 8 lines

promcon_init() can be called again from visual_init() during vc_allocate(). So anything referenced by promcon_init() should not be marked __init.

Although, if you want to keep promfont_unitable and promfont_unicount __init, you can probably use con_copy_unimap() using the default vc as the source instead of doing a promcon_init_unimap() again.

Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.

Sam

Subject: video: fix section mismatch warning in promcon

Fix the following warnings in promcon:
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x480): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x488): Section mismatch: reference to .init.data:promfont_unitable (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x48c): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')
WARNING: o-sparc64/drivers/video/console/built-in.o(.text+0x490): Section mismatch: reference to .init.data:promfont_unicount (between 'promcon_init_unimap' and 'promcon_init')

The warnings happens because the function: promcon_init_unimap() references promfont_unitable and promfont_unicount which are marked __initdata by the conmakehash command in the drivers/video/console/Makefile

Fix the warning by removing the __initdata marker on the two variables.

---

drivers/video/console/Makefile +1 -1
index 9b26dda..ac46cc3 100644
@@ -47,7 +47,7 @@ targets := promcon_tbl.c
 quiet_cmd_conmakehash = CNMKHSH $@
       cmd_conmakehash = scripts/conmakehash $< | \
 		sed -e '/\#include <[^>]*>/p' -e 's/types/init/' \
-		-e 's/dfont\(_uni.*\]\)/promfont\1 __initdata/' > $@
+		-e 's/dfont\(_uni.*\]\)/promfont\1 /' > $@
 
 $(obj)/promcon_tbl.c: $(src)/prom.uni
 	$(call cmd,conmakehash)
#4 lore raw

From: Sam Ravnborg <[email protected]>
Date: Sat, 2 Jun 2007 21:16:46 +0200

Quoted 9 lines
Quoted 8 lines

promcon_init() can be called again from visual_init() during vc_allocate(). So anything referenced by promcon_init() should not be marked __init.

Although, if you want to keep promfont_unitable and promfont_unicount __init, you can probably use con_copy_unimap() using the default vc as the source instead of doing a promcon_init_unimap() again.

Quoted 7 lines

Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.

Sam

Subject: video: fix section mismatch warning in promcon

I'll merge this fix in via the Sparc tree since this is a sparc console driver.

Thanks Sam.

#5 lore raw
Quoted 16 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Sat, 2 Jun 2007 21:16:46 +0200

Quoted 13 lines
Quoted 8 lines

promcon_init() can be called again from visual_init() during vc_allocate(). So anything referenced by promcon_init() should not be marked __init.

Although, if you want to keep promfont_unitable and promfont_unicount __init, you can probably use con_copy_unimap() using the default vc as the source instead of doing a promcon_init_unimap() again.

Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.

Quoted 6 lines
Quoted 3 lines

Sam

Subject: video: fix section mismatch warning in promcon

I'll merge this fix in via the Sparc tree since this is a sparc console driver.

Thanks. I didn't notice it was sparc only otherwise I would have cc'ed you and sparclinux.

Sam

#6 lore raw
In reply to David Miller
Quoted 16 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Sat, 2 Jun 2007 21:16:46 +0200

Quoted 13 lines
Quoted 8 lines

promcon_init() can be called again from visual_init() during vc_allocate(). So anything referenced by promcon_init() should not be marked __init.

Although, if you want to keep promfont_unitable and promfont_unicount __init, you can probably use con_copy_unimap() using the default vc as the source instead of doing a promcon_init_unimap() again.

Too involved for me to look into.
I cooked up following very minimal patch - if you agree can you then please forward/take care of it.

Quoted 7 lines
Quoted 3 lines

Sam

Subject: video: fix section mismatch warning in promcon

I'll merge this fix in via the Sparc tree since this is a sparc console driver.

I was about to send this patch to akpm, I'll leave this to you then.

Tony