All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH REPOST] alpha: Replace bogus in_interrupt()
@ 2020-11-13 13:58 Sebastian Andrzej Siewior
  2020-11-14  0:25 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Andrzej Siewior @ 2020-11-13 13:58 UTC (permalink / raw)
  To: linux-alpha
  Cc: Andrew Morton, Thomas Gleixner, Sebastian Andrzej Siewior,
	Richard Henderson, Matt Turner, Ivan Kokshaysky

From: Thomas Gleixner <tglx@linutronix.de>

in_interrupt() is true for a variety of things including bottom half
disabled regions. Deducing hard interrupt context from it is dubious at
best.

Use in_irq() which is true if called in hard interrupt context. Otherwise
calling irq_exit() would do more harm than good.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: linux-alpha@vger.kernel.org
---
Repost of
   https://www.spinics.net/lists/linux-alpha/msg06721.html

 arch/alpha/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 7462a79110024..1589467e75282 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -134,7 +134,7 @@ common_shutdown_1(void *generic_ptr)
 #ifdef CONFIG_DUMMY_CONSOLE
 		/* If we've gotten here after SysRq-b, leave interrupt
 		   context before taking over the console. */
-		if (in_interrupt())
+		if (in_irq())
 			irq_exit();
 		/* This has the effect of resetting the VGA video origin.  */
 		console_lock();
-- 
2.29.2


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

* Re: [PATCH REPOST] alpha: Replace bogus in_interrupt()
  2020-11-13 13:58 [PATCH REPOST] alpha: Replace bogus in_interrupt() Sebastian Andrzej Siewior
@ 2020-11-14  0:25 ` Andrew Morton
  2020-11-14  8:05   ` Serge Belyshev
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2020-11-14  0:25 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-alpha, Thomas Gleixner, Richard Henderson, Matt Turner,
	Ivan Kokshaysky

On Fri, 13 Nov 2020 14:58:32 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> From: Thomas Gleixner <tglx@linutronix.de>
> 
> in_interrupt() is true for a variety of things including bottom half
> disabled regions. Deducing hard interrupt context from it is dubious at
> best.
> 
> Use in_irq() which is true if called in hard interrupt context. Otherwise
> calling irq_exit() would do more harm than good.
> 

Gee, how to test it.  Does anyone run current kernels on alpha?

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

* Re: [PATCH REPOST] alpha: Replace bogus in_interrupt()
  2020-11-14  0:25 ` Andrew Morton
@ 2020-11-14  8:05   ` Serge Belyshev
  2020-11-14 18:39     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Serge Belyshev @ 2020-11-14  8:05 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Sebastian Andrzej Siewior, linux-alpha, Thomas Gleixner,
	Richard Henderson, Matt Turner, Ivan Kokshaysky

Andrew Morton <akpm@linux-foundation.org> writes:

> On Fri, 13 Nov 2020 14:58:32 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
>
>> From: Thomas Gleixner <tglx@linutronix.de>
>> 
>> in_interrupt() is true for a variety of things including bottom half
>> disabled regions. Deducing hard interrupt context from it is dubious at
>> best.
>> 
>> Use in_irq() which is true if called in hard interrupt context. Otherwise
>> calling irq_exit() would do more harm than good.
>> 
>
> Gee, how to test it.  Does anyone run current kernels on alpha?

Hold my beer:

--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -134,8 +134,10 @@ common_shutdown_1(void *generic_ptr)
 #ifdef CONFIG_DUMMY_CONSOLE
                /* If we've gotten here after SysRq-b, leave interrupt
                   context before taking over the console. */
-               if (in_irq())
+               if (in_irq()) {
+                       printk ("in_irq(): true\n");
                        irq_exit();
+               }
                /* This has the effect of resetting the VGA video origin.  */
                console_lock();
                do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);


and then sysrq-b over serial console:

[   56.531250] sysrq: Resetting
[   56.531250] in_irq(): true
[   56.531250] Console: switching to colour dummy device 80x25

halted CPU 0

halt code = 5
HALT instruction executed
PC = fffffc0000310040
Resetting I/O buses...
>>>

Tested-by: Serge Belyshev <belyshev@depni.sinp.msu.ru>

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

* Re: [PATCH REPOST] alpha: Replace bogus in_interrupt()
  2020-11-14  8:05   ` Serge Belyshev
@ 2020-11-14 18:39     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2020-11-14 18:39 UTC (permalink / raw)
  To: Serge Belyshev
  Cc: Sebastian Andrzej Siewior, linux-alpha, Thomas Gleixner,
	Richard Henderson, Matt Turner, Ivan Kokshaysky

On Sat, 14 Nov 2020 11:05:08 +0300 Serge Belyshev <belyshev@depni.sinp.msu.ru> wrote:

> Andrew Morton <akpm@linux-foundation.org> writes:
> 
> > On Fri, 13 Nov 2020 14:58:32 +0100 Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:
> >
> >> From: Thomas Gleixner <tglx@linutronix.de>
> >> 
> >> in_interrupt() is true for a variety of things including bottom half
> >> disabled regions. Deducing hard interrupt context from it is dubious at
> >> best.
> >> 
> >> Use in_irq() which is true if called in hard interrupt context. Otherwise
> >> calling irq_exit() would do more harm than good.
> >> 
> >
> > Gee, how to test it.  Does anyone run current kernels on alpha?
> 
> Hold my beer:
> 
> --- a/arch/alpha/kernel/process.c
> +++ b/arch/alpha/kernel/process.c
> @@ -134,8 +134,10 @@ common_shutdown_1(void *generic_ptr)
>  #ifdef CONFIG_DUMMY_CONSOLE
>                 /* If we've gotten here after SysRq-b, leave interrupt
>                    context before taking over the console. */
> -               if (in_irq())
> +               if (in_irq()) {
> +                       printk ("in_irq(): true\n");
>                         irq_exit();
> +               }
>                 /* This has the effect of resetting the VGA video origin.  */
>                 console_lock();
>                 do_take_over_console(&dummy_con, 0, MAX_NR_CONSOLES-1, 1);
> 
> 
> and then sysrq-b over serial console:
> 
> [   56.531250] sysrq: Resetting
> [   56.531250] in_irq(): true
> [   56.531250] Console: switching to colour dummy device 80x25
> 
> halted CPU 0
> 
> halt code = 5
> HALT instruction executed
> PC = fffffc0000310040
> Resetting I/O buses...
> >>>
> 
> Tested-by: Serge Belyshev <belyshev@depni.sinp.msu.ru>

Thanks ;)

Here, have that beer back - I kept some for you.


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

end of thread, other threads:[~2020-11-14 18:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13 13:58 [PATCH REPOST] alpha: Replace bogus in_interrupt() Sebastian Andrzej Siewior
2020-11-14  0:25 ` Andrew Morton
2020-11-14  8:05   ` Serge Belyshev
2020-11-14 18:39     ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.