From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F454C76190 for ; Thu, 25 Jul 2019 18:38:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A7402190F for ; Thu, 25 Jul 2019 18:38:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Q/XoOpyX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbfGYSiN (ORCPT ); Thu, 25 Jul 2019 14:38:13 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:35934 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbfGYSiM (ORCPT ); Thu, 25 Jul 2019 14:38:12 -0400 Received: by mail-pl1-f195.google.com with SMTP id k8so23746753plt.3 for ; Thu, 25 Jul 2019 11:38:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=npxna6+n+4ONaMcGcCGKLmZp/6GRMXWyfhc+QLsiEVw=; b=Q/XoOpyXq46zTo5ehcCTQ0NqiAPD05+1WN7Ekt3ELa8yoSSDktWSfi5vLOX6UKFj4d Hv2rrV1BKlNMnv0dvTfZae3PwzcH4Vd+wij3CQ8z8hdzn8rZDpoLMu+HiYoPKY41lu3U Y2HPP/F+5Kfa4x1tqhZhfbcjX6AhxnP8ywR8U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=npxna6+n+4ONaMcGcCGKLmZp/6GRMXWyfhc+QLsiEVw=; b=RPgERSDjU6hn79lKRewR5dgZKHLMn4YokKh2e7v8w5PUmlQFb6+wemZpbVAEBWb3VC dfyCMxJlKimy5Sk+AZxuKSQ+RdH1mxYQ+HVAmfIbWQ7mZTHqs6XgwhJz+Oh9rWpps4Px 6dNuaiAaCeoypmmPgbpmtQsIr6UiaS8wcqa23S99TEHunsauVkbRAdyX6xFdA1eBEtGe 3ptuxpr0tzR8zRYMYJEcUa6RzmrvyJBx6PIr9mIp7a4+FAOjkSyNkEpTyXEWOanOcQw7 ghhbVyebzGpbPZlXrHTqxL+l7i1sgZB0tF97EsgrFhr65Bi8DrnK5v6/EI7AmXsRGvXC 67tg== X-Gm-Message-State: APjAAAVbuqGHjuY6xINZaIvAI0BIMy03X0GAlWr44cx0xJqpWJnc9gkb 0u8C6j6ivJnwQ3K2P5GexEM4Bw== X-Google-Smtp-Source: APXvYqzcg6tbTZXUi/ksxaA2L3t2OfQeJvaYoa8UKfYplKmCwDz4Z4M5u5LmMv5+PdG1eLWIRRO7rA== X-Received: by 2002:a17:902:1566:: with SMTP id b35mr94613083plh.147.1564079891325; Thu, 25 Jul 2019 11:38:11 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id l26sm47484684pgb.90.2019.07.25.11.38.10 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 11:38:10 -0700 (PDT) From: Douglas Anderson To: Jason Wessel , Daniel Thompson Cc: Daniel Vetter , Maarten Lankhorst , Sam Ravnborg , Douglas Anderson , Jiri Slaby , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH] kgdboc: disable the console lock when in kgdb Date: Thu, 25 Jul 2019 11:35:51 -0700 Message-Id: <20190725183551.169208-1-dianders@chromium.org> X-Mailer: git-send-email 2.22.0.709.g102302147b-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After commit ddde3c18b700 ("vt: More locking checks") kdb / kgdb has become useless because my console is filled with spews of: WARNING: CPU: 0 PID: 0 at .../drivers/tty/vt/vt.c:3846 con_is_visible+0x50/0x74 CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.3.0-rc1+ #48 Hardware name: Rockchip (Device Tree) Backtrace: [] (dump_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0xb0/0xd0) [] (dump_stack) from [] (__warn+0xec/0x11c) [] (__warn) from [] (warn_slowpath_null+0x4c/0x58) [] (warn_slowpath_null) from [] (con_is_visible+0x50/0x74) [] (con_is_visible) from [] (con_scroll+0x108/0x1ac) [] (con_scroll) from [] (lf+0x44/0x88) [] (lf) from [] (vt_console_print+0x1a4/0x2bc) [] (vt_console_print) from [] (vkdb_printf+0x420/0x8a4) [] (vkdb_printf) from [] (kdb_printf+0x44/0x60) [] (kdb_printf) from [] (kdb_main_loop+0xf4/0x6e0) [] (kdb_main_loop) from [] (kdb_stub+0x268/0x398) [] (kdb_stub) from [] (kgdb_cpu_enter+0x1f8/0x674) [] (kgdb_cpu_enter) from [] (kgdb_handle_exception+0x1c4/0x1fc) [] (kgdb_handle_exception) from [] (kgdb_compiled_brk_fn+0x30/0x3c) [] (kgdb_compiled_brk_fn) from [] (do_undefinstr+0x180/0x1a0) [] (do_undefinstr) from [] (__und_svc_finish+0x0/0x3c) ... [] (kgdb_breakpoint) from [] (sysrq_handle_dbg+0x58/0x6c) [] (sysrq_handle_dbg) from [] (__handle_sysrq+0xac/0x154) Let's disable this warning when we're in kgdb to avoid the spew. The whole system is stopped when we're in kgdb so we can't exactly wait for someone else to drop the lock. Presumably the best we can do is to disable the warning and hope for the best. Fixes: ddde3c18b700 ("vt: More locking checks") Cc: Daniel Vetter Signed-off-by: Douglas Anderson --- drivers/tty/serial/kgdboc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c index bfe5e9e034ec..c7d51b51898f 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -277,10 +277,14 @@ static void kgdboc_pre_exp_handler(void) /* Increment the module count when the debugger is active */ if (!kgdb_connected) try_module_get(THIS_MODULE); + + atomic_inc(&ignore_console_lock_warning); } static void kgdboc_post_exp_handler(void) { + atomic_dec(&ignore_console_lock_warning); + /* decrement the module count when the debugger detaches */ if (!kgdb_connected) module_put(THIS_MODULE); -- 2.22.0.709.g102302147b-goog