[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mtjl3xsc.fsf@jogness.linutronix.de>
Date: Mon, 24 Jan 2022 17:32:27 +0106
From: John Ogness <john.ogness@...utronix.de>
To: Stephen Brennan <stephen.s.brennan@...cle.com>,
Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>
Cc: Stephen Brennan <stephen.s.brennan@...cle.com>,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] printk: Drop console_sem during panic
On 2022-01-24, John Ogness <john.ogness@...utronix.de> wrote:
> Something like:
>
> @@ -2731,7 +2731,8 @@ void console_unlock(void)
> * there's a new owner and the console_unlock() from them will do the
> * flush, no worries.
> */
> - retry = prb_read_valid(prb, next_seq, NULL);
> + retry = (pcpu != raw_smp_processor_id()) &&
> + prb_read_valid(prb, next_seq, NULL);
> if (retry && console_trylock())
> goto again;
> }
Sorry, that hunk is obviously garbage. I meant something like:
@@ -2731,7 +2731,10 @@ void console_unlock(void)
* there's a new owner and the console_unlock() from them will do the
* flush, no worries.
*/
- retry = prb_read_valid(prb, next_seq, NULL);
+ if (panic_in_progress())
+ retry = (pcpu == raw_smp_processor_id()) && prb_read_valid(prb, next_seq, NULL);
+ else
+ retry = prb_read_valid(prb, next_seq, NULL);
if (retry && console_trylock())
goto again;
}
I'm sure there is a cleaner way to code that.
John
Powered by blists - more mailing lists