Messages in this thread | | | From | John Ogness <> | Subject | Re: [PATCH 4/4] printk: Drop console_sem during panic | Date | Mon, 24 Jan 2022 17:32:27 +0106 |
| |
On 2022-01-24, John Ogness <john.ogness@linutronix.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
| |