Re: [RFC][PATCHv5 07/13] printk: register syscore notifier

Rafael J. Wysocki
2017-08-16T13:07:43Z

On Wednesday, August 16, 2017 8:55:45 AM CEST Sergey Senozhatsky wrote:
> On (08/15/17 13:56), Rafael J. Wysocki wrote:
> [..]
> > > +static int printk_syscore_suspend(void)
> > > +{
> > > + printk_emergency_begin();
> > > + return 0;
> > > +}
> >
> > Somebody looking at suspend/resume code paths only will be wondering why
> > you need this, because we should be in the emergency mode already when
> > it is called.
> >
> > It would be good to add a comment about the kexec context here.
>
> ok, will add.
>
> > > +static void printk_syscore_resume(void)
> > > +{
> > > + printk_emergency_end();
> > > +}
> >
> > This will turn the emergency mode off during resume before the notifier
> > added by the previous patch AFAICS. Is this intentional?
>
> emergency modes can nest. so it's OK to have
>
> printk_emergency_begin() +1 // on
> printk_emergency_begin() +1
> printk_emergency_end() -1
> printk_emergency_end() -1 // off
>

OK then.

Thanks,
Rafel