From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Rusty Russell To: Miche Baker-Harvey , Greg Kroah-Hartman Subject: Re: [PATCH v3 2/3] hvc_init(): Enforce one-time initialization. In-Reply-To: <20111108214504.28884.61814.stgit@miche.sea.corp.google.com> References: <20111108214452.28884.14840.stgit@miche.sea.corp.google.com> <20111108214504.28884.61814.stgit@miche.sea.corp.google.com> Date: Fri, 11 Nov 2011 15:00:31 +1030 Message-ID: <874nybqo0o.fsf@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Stephen Rothwell , xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Anton Blanchard , Amit Shah , Mike Waychison , ppc-dev , Eric Northrup List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 08 Nov 2011 13:45:04 -0800, Miche Baker-Harvey wrote: > hvc_init() must only be called once, and no thread should continue with hvc_alloc() > until after initialization is complete. The original code does not enforce either > of these requirements. A new mutex limits entry to hvc_init() to a single thread, > and blocks all later comers until it has completed. > > This patch fixes multiple crash symptoms. No, it doesn't: not now your previous double-hvc_init patch has been reverted. It's easy to show this is the case though: replace mutex_lock() with: if (!mutex_trylock()) { WARN(1, "hvc_console: mutex is stopping us!\n"); mutex_lock(); } If you get that warning, then your mutex is doing something. Thanks, Rusty. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH v3 2/3] hvc_init(): Enforce one-time initialization. Date: Fri, 11 Nov 2011 15:00:31 +1030 Message-ID: <874nybqo0o.fsf@rustcorp.com.au> References: <20111108214452.28884.14840.stgit@miche.sea.corp.google.com> <20111108214504.28884.61814.stgit@miche.sea.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20111108214504.28884.61814.stgit@miche.sea.corp.google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Miche Baker-Harvey , Greg Kroah-Hartman Cc: Stephen Rothwell , xen-devel@lists.xensource.com, Konrad Rzeszutek Wilk , Benjamin Herrenschmidt , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Anton Blanchard , Amit Shah , Mike Waychison , ppc-dev , Eric Northrup List-Id: virtualization@lists.linuxfoundation.org On Tue, 08 Nov 2011 13:45:04 -0800, Miche Baker-Harvey wrote: > hvc_init() must only be called once, and no thread should continue with hvc_alloc() > until after initialization is complete. The original code does not enforce either > of these requirements. A new mutex limits entry to hvc_init() to a single thread, > and blocks all later comers until it has completed. > > This patch fixes multiple crash symptoms. No, it doesn't: not now your previous double-hvc_init patch has been reverted. It's easy to show this is the case though: replace mutex_lock() with: if (!mutex_trylock()) { WARN(1, "hvc_console: mutex is stopping us!\n"); mutex_lock(); } If you get that warning, then your mutex is doing something. Thanks, Rusty.