Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp827971ybm; Wed, 27 May 2020 08:58:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzememvNhgnY0uTi1DyIhIfW+wCYzBMxTwWm4+Itx4MPmbb7YKlRZ4nuD7Sa+sV1nLv2Cru X-Received: by 2002:a17:906:c828:: with SMTP id dd8mr3837076ejb.550.1590595111816; Wed, 27 May 2020 08:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590595111; cv=none; d=google.com; s=arc-20160816; b=ZJ1T2EzLsz/tvNA7b+PxBCYJKVr87e4PH42z7gKwQESoQvq19Mt5ei4Sb0obMBh/jQ EYWznWuIBdsQ+50Ae0EvnydYLGAXVDCVRh9I4dyY0ND8j8+/qydg0xGHHtkSf616kjSg bkHurFF/hspb1wYBQUjG1YFBHG/DG8jsgPfEYWl579n8DMbJdr6p0U9rU+w061Bq3QD8 hTbfEZJuqz4+icLXlLGbL/TIaeK9HKgD8kS41Rq2vvjjzfaBvFtyas6uwoWampf5EETr poDPkBBZC9RzT7wiMmhuqS5lIq4qzbrsKG6GBdXlUMZ2bexbRhBzaBCnYerYvUvo/WMh IlSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=34HLjmK1c/0lja18IFDaAvizeeni+8A0+yLrcuOnt6s=; b=y8keiAu4SvHkZZZvVBnwZ7aE+8WKig6wdXh1AJ736D//bcH0JLiNOIn6oYXnEqpdEl fHJ+2helwOE4qFOGO0YA28nncTc0aE63YpVWn7bfv1ElbL08y8e4ZCI505phOEz34k9Z IIofGUfeomCMqwoJySmW5iw1yLqL5e32Dg/m8Uz/xlmjK27nJ5Xz+2UiJtDoy5Jregeu ISp1K2V1ZSdCNG2x+Po80JsONIvajHLJ3945BZKhyGp0c3ngyARwBQubBLMmspwOydfA cU0fsG5ol4kSzHiRHFKp8tTXan0wABVNW0fHuFf6X1JslshVLQPzvB3tXrmt8fGjzUbM WwBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SOduy4lk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si1797958edv.545.2020.05.27.08.58.08; Wed, 27 May 2020 08:58:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SOduy4lk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389221AbgE0O0z (ORCPT + 99 others); Wed, 27 May 2020 10:26:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389036AbgE0O0y (ORCPT ); Wed, 27 May 2020 10:26:54 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DD95C08C5C1 for ; Wed, 27 May 2020 07:26:53 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id j16so11759556wrb.7 for ; Wed, 27 May 2020 07:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=34HLjmK1c/0lja18IFDaAvizeeni+8A0+yLrcuOnt6s=; b=SOduy4lkCkwjmI0QeG65K/wrRqpjJZA/vXAizxeSh0GB1X8T15UW2rQCpNPvZgrKfZ O91e+QYG9T2eKn58qnQRjF5eEBbiQfXs2puDFq3m0jTb52GKancfabRHa8DrG2THbNE+ Hi2jgORhG/V5iVIuSLPTlRiHz9c4kHi9UT4cbBt+WI7+pyU+NHFUjhQMrSFGo7rtGb8e zeFvPgPAMaqpygmZGccY2Yt/MDKdxOjyDXZKK0tHqj1CcJRf9QXC9jeR/HQZxCZYfroa rOD9nOv2x+sUwCVjog7sroyYWZezkHh0+lMbl5x2HvE9vZLQh7sCI1ENH0K7ed+I0MfN 4F/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=34HLjmK1c/0lja18IFDaAvizeeni+8A0+yLrcuOnt6s=; b=PVLnDabHbvQAuk7oZsHLpIYK+6+0v1dGFmnnPAM+n+e7XwHYqipO54Kqwur7wYA+xJ c3nkA6rbLfyg4uk/FH8aDiumI53411p+AOow7OT9tmifOW0eESFKktwWqTJWUOhe5R1C EaXXUm5cZRPie9Q4TOeIftJZrpAdPhwkclUODnZhj3pWjej7Cucwm5WdBG2wzfGAvrMe 5FsYKhaNcjp6+vuRRTdvNKe6Mv0Qc9Cqdl0ZtdRtoseU+fz0CAydy4aH7B9bW9ZhH9RI H3IJC92jJtZTwKvrjT9Ntmhf27hQQdM80AdiYuOYe4QovtycqIjrQX4TP0N/pEvJjRqj A/tg== X-Gm-Message-State: AOAM532w/AjlzMGxkaSwfpv8WGrJGCKQX794jaXHJtUAjXf0nCMSkXcN UCqgW5fVzZynre7gnEzKaIDNLBs8LGc= X-Received: by 2002:adf:f601:: with SMTP id t1mr15339842wrp.244.1590589612081; Wed, 27 May 2020 07:26:52 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id h5sm2998033wrw.85.2020.05.27.07.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 07:26:51 -0700 (PDT) Date: Wed, 27 May 2020 15:26:49 +0100 From: Daniel Thompson To: Sumit Garg Cc: kgdb-bugreport@lists.sourceforge.net, jason.wessel@windriver.com, dianders@chromium.org, pmladek@suse.com, sergey.senozhatsky@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/4] kdb: Check status of console prior to invoking handlers Message-ID: <20200527142649.aa3kgqvo2n4q4kyx@holly.lan> References: <1590560759-21453-1-git-send-email-sumit.garg@linaro.org> <1590560759-21453-3-git-send-email-sumit.garg@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1590560759-21453-3-git-send-email-sumit.garg@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2020 at 11:55:57AM +0530, Sumit Garg wrote: > Check if a console is enabled prior to invoking corresponding write > handler. > > Suggested-by: Sergey Senozhatsky > Signed-off-by: Sumit Garg Reviewed-by: Daniel Thompson > --- > kernel/debug/kdb/kdb_io.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c > index f6b4d47..349dfcc 100644 > --- a/kernel/debug/kdb/kdb_io.c > +++ b/kernel/debug/kdb/kdb_io.c > @@ -564,6 +564,8 @@ static void kdb_msg_write(char *msg, int msg_len) > kdb_io_write(msg, msg_len, dbg_io_ops->write_char); > > for_each_console(c) { > + if (!(c->flags & CON_ENABLED)) > + continue; > c->write(c, msg, msg_len); > touch_nmi_watchdog(); > } > -- > 2.7.4 >