From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522AbdHPGzb (ORCPT ); Wed, 16 Aug 2017 02:55:31 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:38636 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbdHPGza (ORCPT ); Wed, 16 Aug 2017 02:55:30 -0400 Date: Wed, 16 Aug 2017 15:55:45 +0900 From: Sergey Senozhatsky To: "Rafael J. Wysocki" Cc: Sergey Senozhatsky , Petr Mladek , Steven Rostedt , Jan Kara , Andrew Morton , Peter Zijlstra , Eric Biederman , Greg Kroah-Hartman , Jiri Slaby , Pavel Machek , Andreas Mohr , Tetsuo Handa , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [RFC][PATCHv5 07/13] printk: register syscore notifier Message-ID: <20170816065545.GA522@jagdpanzerIV.localdomain> References: <20170815025625.1977-1-sergey.senozhatsky@gmail.com> <20170815025625.1977-8-sergey.senozhatsky@gmail.com> <1616919.1QsxM0VBqp@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1616919.1QsxM0VBqp@aspire.rjw.lan> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 or did I misunderstand your question? -ss