linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] openrisc: don't printk() unconditionally
@ 2021-07-19  2:33 Randy Dunlap
  2021-07-19  4:38 ` Stafford Horne
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2021-07-19  2:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, kernel test robot, Jonas Bonn, Stefan Kristiansson,
	Stafford Horne, openrisc

Don't call printk() when CONFIG_PRINTK is not set.
Fixes the following build errors:

or1k-linux-ld: arch/openrisc/kernel/entry.o: in function `_external_irq_handler':
(.text+0x804): undefined reference to `printk'
(.text+0x804): relocation truncated to fit: R_OR1K_INSN_REL_26 against undefined symbol `printk'

Fixes: 9d02a4283e9c ("OpenRISC: Boot code")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Jonas Bonn <jonas@southpole.se>
Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Stafford Horne <shorne@gmail.com>
Cc: openrisc@lists.librecores.org
---
 arch/openrisc/kernel/entry.S |    2 ++
 1 file changed, 2 insertions(+)

--- linux-next-20210716.orig/arch/openrisc/kernel/entry.S
+++ linux-next-20210716/arch/openrisc/kernel/entry.S
@@ -547,6 +547,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
 	l.bnf	1f			// ext irq enabled, all ok.
 	l.nop
 
+#ifdef CONFIG_PRINTK
 	l.addi  r1,r1,-0x8
 	l.movhi r3,hi(42f)
 	l.ori	r3,r3,lo(42f)
@@ -560,6 +561,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
 		.string "\n\rESR interrupt bug: in _external_irq_handler (ESR %x)\n\r"
 		.align 4
 	.previous
+#endif
 
 	l.ori	r4,r4,SPR_SR_IEE	// fix the bug
 //	l.sw	PT_SR(r1),r4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] openrisc: don't printk() unconditionally
  2021-07-19  2:33 [PATCH] openrisc: don't printk() unconditionally Randy Dunlap
@ 2021-07-19  4:38 ` Stafford Horne
  0 siblings, 0 replies; 2+ messages in thread
From: Stafford Horne @ 2021-07-19  4:38 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, kernel test robot, Jonas Bonn, Stefan Kristiansson,
	openrisc

On Sun, Jul 18, 2021 at 07:33:09PM -0700, Randy Dunlap wrote:
> Don't call printk() when CONFIG_PRINTK is not set.
> Fixes the following build errors:
> 
> or1k-linux-ld: arch/openrisc/kernel/entry.o: in function `_external_irq_handler':
> (.text+0x804): undefined reference to `printk'
> (.text+0x804): relocation truncated to fit: R_OR1K_INSN_REL_26 against undefined symbol `printk'
> 
> Fixes: 9d02a4283e9c ("OpenRISC: Boot code")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>

Thanks!

This looks OK to me, I will queue it for 5.15 unless anyone thinks it should go
in now.

-Stafford

> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Jonas Bonn <jonas@southpole.se>
> Cc: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
> Cc: Stafford Horne <shorne@gmail.com>
> Cc: openrisc@lists.librecores.org
> ---
>  arch/openrisc/kernel/entry.S |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- linux-next-20210716.orig/arch/openrisc/kernel/entry.S
> +++ linux-next-20210716/arch/openrisc/kernel/entry.S
> @@ -547,6 +547,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
>  	l.bnf	1f			// ext irq enabled, all ok.
>  	l.nop
>  
> +#ifdef CONFIG_PRINTK
>  	l.addi  r1,r1,-0x8
>  	l.movhi r3,hi(42f)
>  	l.ori	r3,r3,lo(42f)
> @@ -560,6 +561,7 @@ EXCEPTION_ENTRY(_external_irq_handler)
>  		.string "\n\rESR interrupt bug: in _external_irq_handler (ESR %x)\n\r"
>  		.align 4
>  	.previous
> +#endif
>  
>  	l.ori	r4,r4,SPR_SR_IEE	// fix the bug
>  //	l.sw	PT_SR(r1),r4

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-19  4:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-19  2:33 [PATCH] openrisc: don't printk() unconditionally Randy Dunlap
2021-07-19  4:38 ` Stafford Horne

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).