From patchwork Wed Jun 13 14:51:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Gerault X-Patchwork-Id: 9274 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 12A1323E4F for ; Wed, 13 Jun 2012 14:51:46 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id C8C11A186DA for ; Wed, 13 Jun 2012 14:51:45 +0000 (UTC) Received: by ggnf1 with SMTP id f1so513843ggn.11 for ; Wed, 13 Jun 2012 07:51:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=eEd4niIX4nDzlyx4SOczObS+Wgrx+4vXdKYjAvrBogI=; b=F0QEp6XPJqtJadu+GkxVqdt4r6XBgbAQoeREMYr/GAt1eBpAidfCfjNybHVfklYpZA s5Vp1VQXgaSF0pLrd8Avm7KuBNbuiSr3SY+uJLVAH9Q6dANjLKGtrG18IEPfnv3KkJSL zHgt7hzdPUhtonIQelp6cQOljRSNeci7n4tlIn/bLWL6+3M/p9mwYUW/cW7cQhJeFJbR FhrpvFrb2kiEEmgVKCM5ysc8rVR/9wXay35ghoV3UZicDSX/MCtxwuMuNSurvYrzoaY2 pRXgKyP9zm9CaqcMBYrOjkoDZnI0cCzCZLGGEJ2l0y/dOyrJhkc07lDNAQCv+gCYNJsB 5oEg== Received: by 10.50.203.39 with SMTP id kn7mr10735642igc.53.1339599100923; Wed, 13 Jun 2012 07:51:40 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp26171ibb; Wed, 13 Jun 2012 07:51:39 -0700 (PDT) Received: by 10.14.99.202 with SMTP id x50mr7415763eef.19.1339599098922; Wed, 13 Jun 2012 07:51:38 -0700 (PDT) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com. [207.126.144.149]) by mx.google.com with SMTP id z14si1077468eef.61.2012.06.13.07.51.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jun 2012 07:51:38 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of aurelien.gerault-xsig@stericsson.com) client-ip=207.126.144.149; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of aurelien.gerault-xsig@stericsson.com) smtp.mail=aurelien.gerault-xsig@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKT9io9/HlXz8s0Y2soXEuxkD0eFxU+6+W@postini.com; Wed, 13 Jun 2012 14:51:38 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 19C8661; Wed, 13 Jun 2012 14:51:13 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id C2F5678; Wed, 13 Jun 2012 12:02:31 +0000 (GMT) Received: from exdcvycastm022.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm022", Issuer "exdcvycastm022" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 02A82A8065; Wed, 13 Jun 2012 16:51:28 +0200 (CEST) Received: from lmenxs05.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.30) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 13 Jun 2012 16:51:33 +0200 From: Aurelien Gerault To: , Greg Kroah-Hartman Cc: Aurelien Gerault Subject: [PATCH] printk: Ensure oops printing if console is locked Date: Wed, 13 Jun 2012 16:51:08 +0200 Message-ID: <1339599068-25215-1-git-send-email-aurelien.gerault-xsig@stericsson.com> X-Mailer: git-send-email 1.7.10 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQkIZrMeXQ71JD80bRaFdsrJV5oeozzDm5YBxIdwns44TSH8hWnQ2kaFEEAJzoqSj5mOz9wD From: Aurelien Gerault Ensuring that oops & panic messages/backtraces will be printed in console, even when the console is locked. If console is locked by someone else but an oops is ongoing, force unlocking / re-locking to display the oops. Signed-off-by: Aurelien Gerault --- kernel/printk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/printk.c b/kernel/printk.c index 6d24237..be2a625 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -1014,6 +1014,11 @@ asmlinkage int vprintk(const char *fmt, va_list args) */ if (console_trylock_for_printk(this_cpu)) console_unlock(); + else if (oops_in_progress) { + /* force releasing / acquiring console lock to print oops */ + console_unlock(); + console_lock(); + } lockdep_on(); out_restore_irqs: