From patchwork Thu Jul 12 13:29:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Rostedt X-Patchwork-Id: 10521685 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D6A44603D7 for ; Thu, 12 Jul 2018 13:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF7002926C for ; Thu, 12 Jul 2018 13:29:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3305292A7; Thu, 12 Jul 2018 13:29:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B51EE2926C for ; Thu, 12 Jul 2018 13:29:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9F7C86E261; Thu, 12 Jul 2018 13:29:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E69B6E261 for ; Thu, 12 Jul 2018 13:29:41 +0000 (UTC) Received: from gandalf.local.home (cpe-66-24-56-78.stny.res.rr.com [66.24.56.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1FD83213A2; Thu, 12 Jul 2018 13:29:40 +0000 (UTC) Date: Thu, 12 Jul 2018 09:29:38 -0400 From: Steven Rostedt To: LKML Subject: [PATCH v2] console: Replace #if 1 with a bool to ignore Message-ID: <20180712092938.22e33641@gandalf.local.home> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Petr Mladek , Linux Fbdev development list , Sergey Senozhatsky , Bartlomiej Zolnierkiewicz , dri-devel , Hans de Goede , Thomas Zimmermann , Andrew Morton , Sergey Senozhatsky Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Steven Rostedt (VMware) There's been discussion on the fb list about the addition of WARN_CONSOLE_UNLOCKED() inside the fb code. The complaint is that when the fb module is loaded with lockless_register_fb the console lock is not taken for debugging reasons. With the addition of WARN_CONSOLE_UNLOCK() within the fb code, this causes the console to fill up with warnings when trying to debug the fb driver. There's also a #if 1 that enables the warning which was added before git history, and we look down on constant #if's in the kernel nowadays anyway. Remove the #if 1 and add a ignore_console_lock_warning boolean that can be set by drivers to ignore the warning in order to do debugging. Link: http://lkml.kernel.org/r/717e6337-e7a6-7a92-1c1b-8929a25696b5@suse.de Reviewed-by: Hans de Goede Acked-by: Sergey Senozhatsky Signed-off-by: Steven Rostedt (VMware) Acked-by: Petr Mladek Tested-by: Thomas Zimmermann --- Changes since V1: - Added comment to describe ignore_console_unlock_waring variable - Abide by 80 character limit Index: linux-trace.git/include/linux/console.h =================================================================== --- linux-trace.git.orig/include/linux/console.h +++ linux-trace.git/include/linux/console.h @@ -200,11 +200,14 @@ void vcs_make_sysfs(int index); void vcs_remove_sysfs(int index); /* Some debug stub to catch some of the obvious races in the VT code */ -#if 1 -#define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) -#else -#define WARN_CONSOLE_UNLOCKED() -#endif +#define WARN_CONSOLE_UNLOCKED() \ + WARN_ON(!ignore_console_lock_warning && \ + !is_console_locked() && !oops_in_progress) +/* + * Set ignore_console_lock_warning to true if you need to quiet + * WARN_CONSOLE_UNLOCKED() for debugging purposes. + */ +extern bool ignore_console_lock_warning; /* VESA Blanking Levels */ #define VESA_NO_BLANKING 0 Index: linux-trace.git/kernel/printk/printk.c =================================================================== --- linux-trace.git.orig/kernel/printk/printk.c +++ linux-trace.git/kernel/printk/printk.c @@ -66,6 +66,9 @@ int console_printk[4] = { CONSOLE_LOGLEVEL_DEFAULT, /* default_console_loglevel */ }; +bool ignore_console_lock_warning __read_mostly; +EXPORT_SYMBOL(ignore_console_lock_warning); + /* * Low level drivers may need that to know if they can schedule in * their unblank() callback or not. So let's export it.