From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752027AbdHPNHn (ORCPT ); Wed, 16 Aug 2017 09:07:43 -0400 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:41995 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751287AbdHPNHm (ORCPT ); Wed, 16 Aug 2017 09:07:42 -0400 From: "Rafael J. Wysocki" To: Sergey Senozhatsky 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 Subject: Re: [RFC][PATCHv5 07/13] printk: register syscore notifier Date: Wed, 16 Aug 2017 14:59:16 +0200 Message-ID: <6360139.oCRz49aLWI@aspire.rjw.lan> In-Reply-To: <20170816065545.GA522@jagdpanzerIV.localdomain> References: <20170815025625.1977-1-sergey.senozhatsky@gmail.com> <1616919.1QsxM0VBqp@aspire.rjw.lan> <20170816065545.GA522@jagdpanzerIV.localdomain> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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