Skip to contentSkip to conversation

Fonts: font_acorn_8x8: Replace discarded const qualifier

PATCH In review Lee Jones 6 participants 25 messages Oct 30, 2020 – Nov 7, 2020

Subsystems (2)
lore
Share & tools
lore

Lee Jones

author
#0 lore raw

PATCH 1/1 Fonts: font_acorn_8x8: Replace discarded const qualifier

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking.

---
 lib/fonts/font_acorn_8x8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/fonts/font_acorn_8x8.c +1 -1
index 069b3e80c4344..fb395f0d40317 100644
@@ -5,7 +5,7 @@
 
 #define FONTDATAMAX 2048
 
-static struct font_data acorndata_8x8 = {
+static const struct font_data acorndata_8x8 = {
 { 0, 0, FONTDATAMAX, 0 }, {
 /* 00 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */
 /* 01 */  0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, /* ^A */
Signature · 1 line
2.25.1
Tested-by on v1 1/1
#1 lore raw

Hi Lee,

Quoted 12 lines · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

Quoted 2 lines

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking.

Thanks a lot for fixing this up! I wasn't aware that the symbol is being referenced in arch/arm/boot/compressed/ll_char_wr.S. I'm sorry for the trouble. The patch is,

Quoted 3 lines

Thank you,
Peilin Ye

#2 lore raw
In reply to Lee Jones
Quoted 1 line · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for

Your commit ID does not exist in mainline kernels, which makes this confusing. The commit ID you should be using is 6735b4632def.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
author
#3 lore raw
Quoted 5 lines · Russell King - ARM Linux admin
Quoted 1 line · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for

Your commit ID does not exist in mainline kernels, which makes this confusing. The commit ID you should be using is 6735b4632def.

Ah yes, quite right. That is the ID from android-3.18 where this issue was first seen and fixed against. I will fix it up for Mainline.

Does the fix look okay to you though Russell?

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw
Quoted 5 lines · Lee Jones
Quoted 3 lines · Russell King - ARM Linux admin
Quoted 1 line · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for

Quoted 8 lines
Quoted 2 lines

Your commit ID does not exist in mainline kernels, which makes this confusing. The commit ID you should be using is 6735b4632def.

Ah yes, quite right. That is the ID from android-3.18 where this issue was first seen and fixed against. I will fix it up for Mainline.

Does the fix look okay to you though Russell?

Frankly, I don't know. Looking at the commit itself, it looks safe, but it depends what this "extra" data is being used for. From what I can see, the commit in question just adds the additional opaque data as a member named "extra", and one is left to guess what it's use as.

I'd have thought a small structure with named members would have been the minimum given our standards for in-kernel code.

Why was the "const" dropped in the first place? Does this "extra" member get written to somewhere?

So, sorry, no idea. This looks to me like a very unsatisfactory commit, and probably something that got a very poor review.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#5 lore raw
Quoted 21 lines · Russell King - ARM Linux admin
Quoted 5 lines · Lee Jones
Quoted 3 lines · Russell King - ARM Linux admin
Quoted 1 line · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for

Quoted 8 lines
Quoted 2 lines

Your commit ID does not exist in mainline kernels, which makes this confusing. The commit ID you should be using is 6735b4632def.

Ah yes, quite right. That is the ID from android-3.18 where this issue was first seen and fixed against. I will fix it up for Mainline.

Does the fix look okay to you though Russell?

Frankly, I don't know. Looking at the commit itself, it looks safe, but it depends what this "extra" data is being used for. From what I can see, the commit in question just adds the additional opaque data as a member named "extra", and one is left to guess what it's use as.

Quoted 8 lines

I'd have thought a small structure with named members would have been the minimum given our standards for in-kernel code.

Why was the "const" dropped in the first place? Does this "extra" member get written to somewhere?

So, sorry, no idea. This looks to me like a very unsatisfactory commit, and probably something that got a very poor review.

Also, the commit description is missing a chunk:

For user-provided fonts, the framebuffer layer resolves this issue by reserving four extra words at the beginning of data buffers. Later, whenever a function needs to access them, it simply uses the following macros:

Recently we have gathered all the above macros to <linux/font.h>.

So what were these macros that have been nicely removed from the commit description? I guess they started with a '#' character and git thought they were a comment.

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
#6 lore raw
In reply to Russell King - ARM Linux admin

Hi Russell,

Quoted 13 lines · Russell King - ARM Linux admin
Quoted 12 lines · Lee Jones
Quoted 5 lines · Russell King - ARM Linux admin
Quoted 1 line · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for

Your commit ID does not exist in mainline kernels, which makes this confusing. The commit ID you should be using is 6735b4632def.

Ah yes, quite right. That is the ID from android-3.18 where this issue was first seen and fixed against. I will fix it up for Mainline.

Quoted 7 lines
Quoted 1 line

Does the fix look okay to you though Russell?

Frankly, I don't know. Looking at the commit itself, it looks safe, but it depends what this "extra" data is being used for. From what I can see, the commit in question just adds the additional opaque data as a member named "extra", and one is left to guess what it's use as.

Thank you very much for looking into this. I apologize for the trouble and confusion it has caused.

The motivation behind this commit, and commit 5af08640795b ("fbcon: Fix global-out-of-bounds read in fbcon_get_font()") was to fix a decades-old out-of-bounds access bug in the framebuffer layer.

However the framebuffer layer is doing bounds checking in a very strange way, by hiding the buffer length before the buffer, then access it using a negative-indexing macro:

	#define FNTSIZE(fd)	(((int *)(fd))[-2])

Other "extra" (so-called by the framebuffer layer) fields include:

	#define REFCOUNT(fd)	(((int *)(fd))[-1])

	#define FNTCHARCNT(fd)	(((int *)(fd))[-3])
	#define FNTSUM(fd)	(((int *)(fd))[-4])

...representing reference count, character count and checksum, respectively.

The commit in question (6735b4632def) prepends the buffer length to each of the built-in font buffers, so other functions in the framebuffer layer can use FNTSIZE() on them. 5af08640795b uses it to fix that out-of-bounds bug.

Quoted 2 lines

I'd have thought a small structure with named members would have been the minimum given our standards for in-kernel code.

Yes, this is a temporary bug fix, and is far from satisfactory. We are trying to replace these magic macros using a structure with properly named members. It is taking more time than I imagined, but one day this temporary fix will disappear from the kernel, I hope.

Quoted 2 lines

Why was the "const" dropped in the first place? Does this "extra" member get written to somewhere?

No, I will try to come up with a solution without these fields being writable.

Quoted 2 lines

So, sorry, no idea. This looks to me like a very unsatisfactory commit, and probably something that got a very poor review.

I hope this helps explain it.

Again, I apologize for all the troubles. I will do more thorough testing and practice writing a commit message. Thank you!

Sincerely,
Peilin Ye

#7 lore raw
In reply to Lee Jones
Quoted 13 lines · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

Quoted 6 lines

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking.

Shouldn't we add the const to all of them, for consistency? -Daniel

Quoted 20 lines
---
 lib/fonts/font_acorn_8x8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/fonts/font_acorn_8x8.c +1 -2
index 069b3e80c4344..fb395f0d40317 100644
@@ -5,7 +5,7 @@
 
 #define FONTDATAMAX 2048
 
-static struct font_data acorndata_8x8 = {
+static const struct font_data acorndata_8x8 = {
 { 0, 0, FONTDATAMAX, 0 }, {
 /* 00 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */
 /* 01 */  0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, /* ^A */
--

2.25.1

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
author
#8 lore raw
Quoted 14 lines · Daniel Vetter
Quoted 13 lines · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

Quoted 8 lines
Quoted 6 lines

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking.

Shouldn't we add the const to all of them, for consistency?

The thought did cross my mind. However, I do not see any further issues which need addressing. Nor do I have any visibility into what issues may be caused by doing so. The only thing I know for sure is that this patch fixes the compile error pertained to in the commit message, and I'd like for this fix to be as atomic as possible, as it's designed to be routed through the Stable/LTS trees.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#9 lore raw
Quoted 24 lines · Lee Jones
Quoted 21 lines · Daniel Vetter
Quoted 19 lines · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking.

Quoted 8 lines
Quoted 1 line

Shouldn't we add the const to all of them, for consistency?

The thought did cross my mind. However, I do not see any further issues which need addressing. Nor do I have any visibility into what issues may be caused by doing so. The only thing I know for sure is that this patch fixes the compile error pertained to in the commit message, and I'd like for this fix to be as atomic as possible, as it's designed to be routed through the Stable/LTS trees.

The trouble is that if we only make one of them const, then it'll take so much longer to hit any issues due to code not handling this correctly. Being consistent with all fonts sounds like the best approach.

And the original patch that lost the const for the additional data also went through cc: stable for all fonts together. So that shouldn't be the hold-up.
-Daniel

Quoted 6 lines

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services

Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
author
#10 lore raw
Quoted 34 lines · Daniel Vetter
Quoted 24 lines · Lee Jones
Quoted 21 lines · Daniel Vetter
Quoted 19 lines · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking.

Quoted 8 lines
Quoted 1 line

Shouldn't we add the const to all of them, for consistency?

The thought did cross my mind. However, I do not see any further issues which need addressing. Nor do I have any visibility into what issues may be caused by doing so. The only thing I know for sure is that this patch fixes the compile error pertained to in the commit message, and I'd like for this fix to be as atomic as possible, as it's designed to be routed through the Stable/LTS trees.

Quoted 8 lines

The trouble is that if we only make one of them const, then it'll take so much longer to hit any issues due to code not handling this correctly. Being consistent with all fonts sounds like the best approach.

And the original patch that lost the const for the additional data also went through cc: stable for all fonts together. So that shouldn't be the hold-up.

My plan was to keep the fix as simple as possible.

This is only an issue due to the odd handling of the compressed Arm image which exclusively references 'acorndata_8x8' and discards it's .data section.

I am happy to go with the majority on this though.

Does anyone else have an opinion?

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#11 lore raw
Quoted 48 lines · Lee Jones
Quoted 34 lines · Daniel Vetter
Quoted 24 lines · Lee Jones
Quoted 21 lines · Daniel Vetter
Quoted 19 lines · Lee Jones

Commit 09e5b3fd5672 ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking.

Quoted 8 lines
Quoted 1 line

Shouldn't we add the const to all of them, for consistency?

The thought did cross my mind. However, I do not see any further issues which need addressing. Nor do I have any visibility into what issues may be caused by doing so. The only thing I know for sure is that this patch fixes the compile error pertained to in the commit message, and I'd like for this fix to be as atomic as possible, as it's designed to be routed through the Stable/LTS trees.

Quoted 8 lines

The trouble is that if we only make one of them const, then it'll take so much longer to hit any issues due to code not handling this correctly. Being consistent with all fonts sounds like the best approach.

And the original patch that lost the const for the additional data also went through cc: stable for all fonts together. So that shouldn't be the hold-up.

My plan was to keep the fix as simple as possible.

Quoted 7 lines

This is only an issue due to the odd handling of the compressed Arm image which exclusively references 'acorndata_8x8' and discards it's .data section.

I am happy to go with the majority on this though.

Does anyone else have an opinion?

Oh I don't want to hold up the fix, I'm just semi desperately looking for people who care beyond "this is the most minimal thing for my use case" since this entire area is orphaned. With the other things fixed feel free to smash my ack onto this.

Maybe Peilin is going to include the full re-cosntification in a cleanup series, dunno.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#12 lore raw
Quoted 2 lines · Daniel Vetter

Maybe Peilin is going to include the full re-cosntification in a cleanup series, dunno.

Sure, I will do it in a separate patch.

Thank you,
Peilin Ye

author
#13 lore raw
Quoted 5 lines · Peilin Ye
Quoted 2 lines · Daniel Vetter

Maybe Peilin is going to include the full re-cosntification in a cleanup series, dunno.

Sure, I will do it in a separate patch.

Are you happy to conduct a proper clean-up on top of this patch?

This is currently broken in all of the LTS kernels, which I would like to have fixed post-haste.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#14 lore raw
Quoted 6 lines · Lee Jones
Quoted 4 lines · Peilin Ye
Quoted 2 lines · Daniel Vetter

Maybe Peilin is going to include the full re-cosntification in a cleanup series, dunno.

Quoted 6 lines
Quoted 1 line

Sure, I will do it in a separate patch.

Are you happy to conduct a proper clean-up on top of this patch?

This is currently broken in all of the LTS kernels, which I would like to have fixed post-haste.

Of course, if it's *just* a matter of making all of the structures const again, I will do that myself and post a fix either this evening or tomorrow morning.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#15 lore raw
In reply to Lee Jones
Quoted 6 lines · Lee Jones
Quoted 4 lines · Peilin Ye
Quoted 2 lines · Daniel Vetter

Maybe Peilin is going to include the full re-cosntification in a cleanup series, dunno.

Quoted 6 lines
Quoted 1 line

Sure, I will do it in a separate patch.

Are you happy to conduct a proper clean-up on top of this patch?

This is currently broken in all of the LTS kernels, which I would like to have fixed post-haste.

Sure I will do it now. Thank you,

Peilin Ye

#16 lore raw

PATCH v2 1/1 Fonts: Replace discarded const qualifier

In reply to Lee Jones

From: Lee Jones <[email protected]>

Commit 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking. Do the same for the other 12 built-in fonts as well, for consistency purposes.

Cc Russell King <[email protected]>
Fixes 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts")

---
Changes in v2:
- Fix commit ID to 6735b4632def in commit message (Russell King <[email protected]>)
- Add const back for all 13 built-in fonts (Daniel Vetter <[email protected]>)
- Add a Fixes: tag

 lib/fonts/font_10x18.c     | 2 +-
 lib/fonts/font_6x10.c      | 2 +-
 lib/fonts/font_6x11.c      | 2 +-
 lib/fonts/font_6x8.c       | 2 +-
 lib/fonts/font_7x14.c      | 2 +-
 lib/fonts/font_8x16.c      | 2 +-
 lib/fonts/font_8x8.c       | 2 +-
 lib/fonts/font_acorn_8x8.c | 2 +-
 lib/fonts/font_mini_4x6.c  | 2 +-
 lib/fonts/font_pearl_8x8.c | 2 +-
 lib/fonts/font_sun12x22.c  | 2 +-
 lib/fonts/font_sun8x16.c   | 2 +-
 lib/fonts/font_ter16x32.c  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
lib/fonts/font_10x18.c +1 -1
index 0e2deac97da0..e02f9df24d1e 100644
@@ -8,7 +8,7 @@
 
 #define FONTDATAMAX 9216
 
-static struct font_data fontdata_10x18 = {
+static const struct font_data fontdata_10x18 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, 0x00, /* 0000000000 */
lib/fonts/font_6x10.c +1 -1
index 87da8acd07db..6e3c4b7691c8 100644
@@ -3,7 +3,7 @@
 
 #define FONTDATAMAX 2560
 
-static struct font_data fontdata_6x10 = {
+static const struct font_data fontdata_6x10 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, /* 00000000 */
lib/fonts/font_6x11.c +1 -1
index 5e975dfa10a5..2d22a24e816f 100644
@@ -9,7 +9,7 @@
 
 #define FONTDATAMAX (11*256)
 
-static struct font_data fontdata_6x11 = {
+static const struct font_data fontdata_6x11 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, /* 00000000 */
lib/fonts/font_6x8.c +1 -1
index 700039a9ceae..e7442a0d183d 100644
@@ -3,7 +3,7 @@
 
 #define FONTDATAMAX 2048
 
-static struct font_data fontdata_6x8 = {
+static const struct font_data fontdata_6x8 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, /* 000000 */
lib/fonts/font_7x14.c +1 -1
index 86d298f38505..9cc7ae2e03f7 100644
@@ -8,7 +8,7 @@
 
 #define FONTDATAMAX 3584
 
-static struct font_data fontdata_7x14 = {
+static const struct font_data fontdata_7x14 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, /* 0000000 */
lib/fonts/font_8x16.c +1 -1
index 37cedd36ca5e..bab25dc59e8d 100644
@@ -10,7 +10,7 @@
 
 #define FONTDATAMAX 4096
 
-static struct font_data fontdata_8x16 = {
+static const struct font_data fontdata_8x16 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, /* 00000000 */
lib/fonts/font_8x8.c +1 -1
index 8ab695538395..109d0572368f 100644
@@ -9,7 +9,7 @@
 
 #define FONTDATAMAX 2048
 
-static struct font_data fontdata_8x8 = {
+static const struct font_data fontdata_8x8 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, /* 00000000 */
lib/fonts/font_acorn_8x8.c +1 -1
index 069b3e80c434..fb395f0d4031 100644
@@ -5,7 +5,7 @@
 
 #define FONTDATAMAX 2048
 
-static struct font_data acorndata_8x8 = {
+static const struct font_data acorndata_8x8 = {
 { 0, 0, FONTDATAMAX, 0 }, {
 /* 00 */  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ^@ */
 /* 01 */  0x7e, 0x81, 0xa5, 0x81, 0xbd, 0x99, 0x81, 0x7e, /* ^A */
lib/fonts/font_mini_4x6.c +1 -1
index 1449876c6a27..592774a90917 100644
@@ -43,7 +43,7 @@ __END__;
 
 #define FONTDATAMAX 1536
 
-static struct font_data fontdata_mini_4x6 = {
+static const struct font_data fontdata_mini_4x6 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/*{*/
 	  	/*   Char 0: ' '  */
lib/fonts/font_pearl_8x8.c +1 -1
index 32d65551e7ed..a6f95ebce950 100644
@@ -14,7 +14,7 @@
 
 #define FONTDATAMAX 2048
 
-static struct font_data fontdata_pearl8x8 = {
+static const struct font_data fontdata_pearl8x8 = {
    { 0, 0, FONTDATAMAX, 0 }, {
    /* 0 0x00 '^@' */
    0x00, /* 00000000 */
lib/fonts/font_sun12x22.c +1 -1
index 641a6b4dca42..a5b65bd49604 100644
@@ -3,7 +3,7 @@
 
 #define FONTDATAMAX 11264
 
-static struct font_data fontdata_sun12x22 = {
+static const struct font_data fontdata_sun12x22 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	/* 0 0x00 '^@' */
 	0x00, 0x00, /* 000000000000 */
lib/fonts/font_sun8x16.c +1 -1
index 193fe6d988e0..e577e76a6a7c 100644
@@ -3,7 +3,7 @@
 
 #define FONTDATAMAX 4096
 
-static struct font_data fontdata_sun8x16 = {
+static const struct font_data fontdata_sun8x16 = {
 { 0, 0, FONTDATAMAX, 0 }, {
 /* */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 /* */ 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00,
lib/fonts/font_ter16x32.c +1 -1
index 91b9c283bd9c..f7c3abb6b99e 100644
@@ -4,7 +4,7 @@
 
 #define FONTDATAMAX 16384
 
-static struct font_data fontdata_ter16x32 = {
+static const struct font_data fontdata_ter16x32 = {
 	{ 0, 0, FONTDATAMAX, 0 }, {
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x7f, 0xfc, 0x7f, 0xfc,
Signature · 1 line
2.25.1
author
#17 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

Quoted 32 lines · Peilin Ye

From: Lee Jones <[email protected]>

Commit 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking. Do the same for the other 12 built-in fonts as well, for consistency purposes.

Cc Russell King <[email protected]>
Fixes 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts")

---
Changes in v2:
- Fix commit ID to 6735b4632def in commit message (Russell King <[email protected]>)
- Add const back for all 13 built-in fonts (Daniel Vetter <[email protected]>)
- Add a Fixes: tag

Quoted 14 lines
 lib/fonts/font_10x18.c     | 2 +-
 lib/fonts/font_6x10.c      | 2 +-
 lib/fonts/font_6x11.c      | 2 +-
 lib/fonts/font_6x8.c       | 2 +-
 lib/fonts/font_7x14.c      | 2 +-
 lib/fonts/font_8x16.c      | 2 +-
 lib/fonts/font_8x8.c       | 2 +-
 lib/fonts/font_acorn_8x8.c | 2 +-
 lib/fonts/font_mini_4x6.c  | 2 +-
 lib/fonts/font_pearl_8x8.c | 2 +-
 lib/fonts/font_sun12x22.c  | 2 +-
 lib/fonts/font_sun8x16.c   | 2 +-
 lib/fonts/font_ter16x32.c  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

LGTM.

Thanks for keeping my authorship. Much appreciated.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#18 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

Quoted 50 lines · Lee Jones
Quoted 32 lines · Peilin Ye

From: Lee Jones <[email protected]>

Commit 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking. Do the same for the other 12 built-in fonts as well, for consistency purposes.

Cc Russell King <[email protected]>
Fixes 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts")

---
Changes in v2:
- Fix commit ID to 6735b4632def in commit message (Russell King <[email protected]>)
- Add const back for all 13 built-in fonts (Daniel Vetter <[email protected]>)
- Add a Fixes: tag

Quoted 14 lines
 lib/fonts/font_10x18.c     | 2 +-
 lib/fonts/font_6x10.c      | 2 +-
 lib/fonts/font_6x11.c      | 2 +-
 lib/fonts/font_6x8.c       | 2 +-
 lib/fonts/font_7x14.c      | 2 +-
 lib/fonts/font_8x16.c      | 2 +-
 lib/fonts/font_8x8.c       | 2 +-
 lib/fonts/font_acorn_8x8.c | 2 +-
 lib/fonts/font_mini_4x6.c  | 2 +-
 lib/fonts/font_pearl_8x8.c | 2 +-
 lib/fonts/font_sun12x22.c  | 2 +-
 lib/fonts/font_sun8x16.c   | 2 +-
 lib/fonts/font_ter16x32.c  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
Quoted 3 lines

LGTM.

Thanks for keeping my authorship. Much appreciated.

Should I stuff this into drm-misc-fixes? Or will someone else pick this up? Greg?

I guess drm-misc-fixes might be easiest since there's a bunch of other fbcon/font stuff in the queue in drm-misc from Peilin. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
maintainer Reviewed-by
#19 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

Quoted 53 lines · Daniel Vetter
Quoted 52 lines · Lee Jones
Quoted 32 lines · Peilin Ye

From: Lee Jones <[email protected]>

Commit 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking. Do the same for the other 12 built-in fonts as well, for consistency purposes.

Cc Russell King <[email protected]>
Fixes 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts")

---
Changes in v2:
- Fix commit ID to 6735b4632def in commit message (Russell King <[email protected]>)
- Add const back for all 13 built-in fonts (Daniel Vetter <[email protected]>)
- Add a Fixes: tag

Quoted 14 lines
 lib/fonts/font_10x18.c     | 2 +-
 lib/fonts/font_6x10.c      | 2 +-
 lib/fonts/font_6x11.c      | 2 +-
 lib/fonts/font_6x8.c       | 2 +-
 lib/fonts/font_7x14.c      | 2 +-
 lib/fonts/font_8x16.c      | 2 +-
 lib/fonts/font_8x8.c       | 2 +-
 lib/fonts/font_acorn_8x8.c | 2 +-
 lib/fonts/font_mini_4x6.c  | 2 +-
 lib/fonts/font_pearl_8x8.c | 2 +-
 lib/fonts/font_sun12x22.c  | 2 +-
 lib/fonts/font_sun8x16.c   | 2 +-
 lib/fonts/font_ter16x32.c  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

LGTM.

Quoted 7 lines
Quoted 1 line

Thanks for keeping my authorship. Much appreciated.

Should I stuff this into drm-misc-fixes? Or will someone else pick this up? Greg?

I guess drm-misc-fixes might be easiest since there's a bunch of other fbcon/font stuff in the queue in drm-misc from Peilin.

You can take it:

#20 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

Quoted 59 lines · Greg KH
Quoted 58 lines · Daniel Vetter
Quoted 50 lines · Lee Jones
Quoted 32 lines · Peilin Ye

From: Lee Jones <[email protected]>

Commit 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking. Do the same for the other 12 built-in fonts as well, for consistency purposes.

Cc Russell King <[email protected]>
Fixes 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts")

---
Changes in v2:
- Fix commit ID to 6735b4632def in commit message (Russell King <[email protected]>)
- Add const back for all 13 built-in fonts (Daniel Vetter <[email protected]>)
- Add a Fixes: tag

Quoted 14 lines
 lib/fonts/font_10x18.c     | 2 +-
 lib/fonts/font_6x10.c      | 2 +-
 lib/fonts/font_6x11.c      | 2 +-
 lib/fonts/font_6x8.c       | 2 +-
 lib/fonts/font_7x14.c      | 2 +-
 lib/fonts/font_8x16.c      | 2 +-
 lib/fonts/font_8x8.c       | 2 +-
 lib/fonts/font_acorn_8x8.c | 2 +-
 lib/fonts/font_mini_4x6.c  | 2 +-
 lib/fonts/font_pearl_8x8.c | 2 +-
 lib/fonts/font_sun12x22.c  | 2 +-
 lib/fonts/font_sun8x16.c   | 2 +-
 lib/fonts/font_ter16x32.c  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
Quoted 3 lines

LGTM.

Thanks for keeping my authorship. Much appreciated.

Should I stuff this into drm-misc-fixes? Or will someone else pick this up? Greg?

Quoted 6 lines
Quoted 2 lines

I guess drm-misc-fixes might be easiest since there's a bunch of other fbcon/font stuff in the queue in drm-misc from Peilin.

You can take it:

Applied to drm-misc-fixes, thanks everyone!

Cheers, Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
author
#21 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

Quoted 60 lines · Daniel Vetter
Quoted 59 lines · Greg KH
Quoted 58 lines · Daniel Vetter
Quoted 50 lines · Lee Jones
Quoted 32 lines · Peilin Ye

From: Lee Jones <[email protected]>

Commit 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts") introduced the following error when building rpc_defconfig (only this build appears to be affected):

acorndata_8x8' referenced in section .text' of arch/arm/boot/compressed/ll_char_wr.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
acorndata_8x8' referenced in section .data.rel.ro' of arch/arm/boot/compressed/font.o:
defined in discarded section `.data' of arch/arm/boot/compressed/font.o
make[3]: *** [/scratch/linux/arch/arm/boot/compressed/Makefile:191: arch/arm/boot/compressed/vmlinux] Error 1 make[2]: *** [/scratch/linux/arch/arm/boot/Makefile:61: arch/arm/boot/compressed/vmlinux] Error 2 make[1]: *** [/scratch/linux/arch/arm/Makefile:317: zImage] Error 2

The .data section is discarded at link time. Reinstating acorndata_8x8 as const ensures it is still available after linking. Do the same for the other 12 built-in fonts as well, for consistency purposes.

Cc Russell King <[email protected]>
Fixes 6735b4632def ("Fonts: Support FONT_EXTRA_WORDS macros for built-in fonts")

---
Changes in v2:
- Fix commit ID to 6735b4632def in commit message (Russell King <[email protected]>)
- Add const back for all 13 built-in fonts (Daniel Vetter <[email protected]>)
- Add a Fixes: tag

Quoted 14 lines
 lib/fonts/font_10x18.c     | 2 +-
 lib/fonts/font_6x10.c      | 2 +-
 lib/fonts/font_6x11.c      | 2 +-
 lib/fonts/font_6x8.c       | 2 +-
 lib/fonts/font_7x14.c      | 2 +-
 lib/fonts/font_8x16.c      | 2 +-
 lib/fonts/font_8x8.c       | 2 +-
 lib/fonts/font_acorn_8x8.c | 2 +-
 lib/fonts/font_mini_4x6.c  | 2 +-
 lib/fonts/font_pearl_8x8.c | 2 +-
 lib/fonts/font_sun12x22.c  | 2 +-
 lib/fonts/font_sun8x16.c   | 2 +-
 lib/fonts/font_ter16x32.c  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
Quoted 3 lines

LGTM.

Thanks for keeping my authorship. Much appreciated.

Should I stuff this into drm-misc-fixes? Or will someone else pick this up? Greg?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I guess drm-misc-fixes might be easiest since there's a bunch of other fbcon/font stuff in the queue in drm-misc from Peilin.

You can take it:

Applied to drm-misc-fixes, thanks everyone!

Would you be kind enough to let us know when this lands in Mainline please? We'll need to back-port it to start fixing up our Stable kernels ASAP.

TIA.

Signature · 4 lines
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#22 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

Quoted 3 lines · Lee Jones

Would you be kind enough to let us know when this lands in Mainline please? We'll need to back-port it to start fixing up our Stable kernels ASAP.

Sure, I will keep track of it, and update here when it happens. Thank you, and sorry again for the trouble,

Peilin Ye

#23 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

In reply to Lee Jones

Hi all,

Quoted 3 lines · Lee Jones

Would you be kind enough to let us know when this lands in Mainline please? We'll need to back-port it to start fixing up our Stable kernels ASAP.

Patch is in mainline now:

9522750c66c689b739e151fcdf895420dc81efc0 Fonts: Replace discarded const qualifier

Thank you,
Peilin Ye

maintainer
#24 lore raw

Re: [PATCH v2 1/1] Fonts: Replace discarded const qualifier

Quoted 10 lines · Peilin Ye

Hi all,

Quoted 3 lines · Lee Jones

Would you be kind enough to let us know when this lands in Mainline please? We'll need to back-port it to start fixing up our Stable kernels ASAP.

Patch is in mainline now:

9522750c66c689b739e151fcdf895420dc81efc0 Fonts: Replace discarded const qualifier

Now queued up for stable, thanks!

greg k-h