From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760230AbbA3SyA (ORCPT ); Fri, 30 Jan 2015 13:54:00 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:55072 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbbA3Sx6 (ORCPT ); Fri, 30 Jan 2015 13:53:58 -0500 Date: Fri, 30 Jan 2015 18:53:56 +0000 (GMT) From: "Maciej W. Rozycki" To: James Hogan cc: Aaro Koskinen , Ralf Baechle , David Daney , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Hemmo Nieminen , stable@vger.kernel.org Subject: Re: [PATCH v2 2/2] MIPS: fix kernel lockup or crash after CPU offline/online In-Reply-To: <20150130182316.GA30459@jhogan-linux.le.imgtec.org> Message-ID: References: <1421355719-17576-1-git-send-email-aaro.koskinen@iki.fi> <1421355719-17576-2-git-send-email-aaro.koskinen@iki.fi> <54CB5B59.5050203@imgtec.com> <54CB9C6D.1080506@imgtec.com> <20150130175532.GE591@fuloong-minipc.musicnaut.iki.fi> <20150130182316.GA30459@jhogan-linux.le.imgtec.org> User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 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 Fri, 30 Jan 2015, James Hogan wrote: > > > Hmm, kernel/printk/printk.c does have: > > > > > > static inline int can_use_console(unsigned int cpu) > > > { > > > return cpu_online(cpu) || have_callable_console(); > > > } > > > > > > which should prevent it dumping printk buffer to console. CPU shouldn't > > > be marked online that early, which suggests that the console has the > > > CON_ANYTIME flag set, which it probably shouldn't if it depends on > > > module code. call_console_drivers() seems to ensure the CPU is online or > > > has CON_ANYTIME before calling the console write callback. > > > > > > A quick glance and I can't see any evidence of netconsole being able to > > > get CON_ANYTIME. > > > > It does not set the flag. But flags are kept in module's static data, > > so the original problem stays. > > > > A. > > Ah yes, of course. This approach looks correct to me then. In such a case shouldn't the flags be copied out on console registration to a structure that is guaranteed to be accessible at all times? Maciej