Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754134AbdGNMkb (ORCPT ); Fri, 14 Jul 2017 08:40:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:50676 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754080AbdGNMk3 (ORCPT ); Fri, 14 Jul 2017 08:40:29 -0400 Date: Fri, 14 Jul 2017 14:40:26 +0200 From: Petr Mladek To: Matt Redfearn Cc: Sergey Senozhatsky , Sergey Senozhatsky , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, Steven Rostedt , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] printk: Unconditionally unregister boot consoles if in init section Message-ID: <20170714124026.GA32632@pathway.suse.cz> References: <1499337481-19397-1-git-send-email-matt.redfearn@imgtec.com> <20170707044537.GB7478@jagdpanzerIV.localdomain> <0212d098-e307-2ea1-cb41-1e81d545da56@imgtec.com> <20170711124308.GA3393@pathway.suse.cz> <86ff1193-8485-4b14-492f-627720c1d868@imgtec.com> <20170712111117.GD3393@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170712111117.GD3393@pathway.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1407 Lines: 33 On Wed 2017-07-12 13:11:17, Petr Mladek wrote: > On Tue 2017-07-11 15:41:50, Matt Redfearn wrote: > > On 11/07/17 13:43, Petr Mladek wrote: > > >IMHO, the reasonable solution is to move early console code and data > > >out of the init sections. We should do this for the early consoles > > >where the corresponding real console is registered using a deferred > > >probe. Others should be already replaced by the real console when > > >printk_late_init() is called. At least this is how I understand it. > > > > This seems like the most reasonable way forward to me as well, > > though sadly will lead to some post-init kernel bloat. > > > > I still think, however, that this patch is a reasonable change to > > make. > > The thing is that this patch "silently" makes the keep_bootcon > option almost unusable. I was wrong here. I thought that most early consoles used the init section. It was mentioned somewhere and I looked a wrong way. But this is not true. In fact, it seems that there are only few of them. Most early consoles have struct console and the write() callback in the normal section that is preserved. Matt's patch and the keep_bootcon option makes sense to me after all. Let me to resend Matt's patch with some small improvements and one more patch that improves the check of early consoles that use init section. I'll keep Matt as the author of the first patch. Best Regards, Petr