Message ID | 20221107141638.3790965-11-john.ogness@linutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2078758wru; Mon, 7 Nov 2022 06:21:06 -0800 (PST) X-Google-Smtp-Source: AMsMyM7y7iaz5ff1ZFnsKNXtUOniPbQkh3rPqPh/59NadoPzyqJ+nUPY/b60LOaZIovNUv6IPqvF X-Received: by 2002:a17:903:26cd:b0:188:4c74:e1de with SMTP id jg13-20020a17090326cd00b001884c74e1demr26865251plb.56.1667830865859; Mon, 07 Nov 2022 06:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667830865; cv=none; d=google.com; s=arc-20160816; b=u05/eG5PyS3JsvTgCC++lYZ2lrdgOZqhCntpjRenj6n+/aLTJHsZHcT2nTTAaHldGH h8OYAbOBxc6oqGYXvVj9oioAzx13W2gsvr9mxTGuacmCsWwshA/tgzjX/123TWpZz0ra 5Mlv7WwoYpFGeSE9ly06RkmAHTOO5VA17cDoGIVa+mAx7ttKFxASw+4E7evB0/9tFrsH CPLDxmDPh8D3nBfLg8eTVWEd9zR4DjnW6hgIjzogFq7gT+HuWAkqaRx2u8TzfmF31iUz Jay2Q2brTnqgoxAxzpC8jwTT1C9VAusDKGreZLnmMkr5CQ/lCsVOISsFDUrmaI3wP/tv +0mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=vshPUjs+tNn2er+3l3r7gbH9xPovLwtdpxV7dKrVCmE=; b=cBhcUFuOLgijG1UHJbFaGeD0FJTvBdpbBRHBsJW9d/OMEHB0UjYEAOUFZU7vOWx2ne +pBaAyHRja9BZ7R25fYCbwp/xfqEMUyA5o2joRfXmktXJ5ptngqJZgvFimKLFr0f2LHF mjg36Hjr58LZL6CBixQZSQFiITvJQW+eIjWW+lNQbLit7JaI9Gm4OuvxeWPsE5dlRbuu Dg5E0rQiYzDtQtSlEU9qNJ+7GE6d0EvFVOQVJ7TXl9GvWU6xXeKRWxmgfCayFLCyyc5p gLA3VbvwYDMB0kH62UM0mQcDqq2JQ6MRGwKx+LalqYJ5+/+TPh7yWm8/qAc6vaktyUv/ nZPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zb1YAY8y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ZL1s3Yfc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls8-20020a17090b350800b00202eab3e1b5si18215193pjb.10.2022.11.07.06.20.51; Mon, 07 Nov 2022 06:21:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=zb1YAY8y; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=ZL1s3Yfc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232258AbiKGORb (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 09:17:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232123AbiKGOQr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 09:16:47 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8781C1BE94 for <linux-kernel@vger.kernel.org>; Mon, 7 Nov 2022 06:16:46 -0800 (PST) From: John Ogness <john.ogness@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667830605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vshPUjs+tNn2er+3l3r7gbH9xPovLwtdpxV7dKrVCmE=; b=zb1YAY8yix2bhnE9pEpra80m87LTA6TzAm/0q2w3BOf6hMO2dBz7XVLtQC4AWi7Rx/T9Rq Aapv50ZZ4tgM5ZXneMvSzyhKYN5TLNn9FaVKB4bgNTg1txoIlhp1zXkvNt8eIksoMJEDk6 p5qPCcq4LL6MerdYTjAdkNHfjKLalhZ6aZNE9mYD43rhaqBSposGNpPQn1pQwvZS7sONZC Ul1tEqaeZGzVsQG81yIVl/TBsS8XEodDUC6fikF5eK9zJOjk1oHRNx4V+ZXNIDODyKjxv9 HCtzgOwxyP33M3cRS/eG/Bcp9S7W4kg1DWu74crGl0WGtsOpNvke0+xprx9CDA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667830605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vshPUjs+tNn2er+3l3r7gbH9xPovLwtdpxV7dKrVCmE=; b=ZL1s3YfcydPxFz4H6XCS1dV85J+S6JAdu8CXSSZE4dwbrB21amSpVdsz60/p/XSVKBlY8m fXkhjhG8i2JCSECA== To: Petr Mladek <pmladek@suse.com> Cc: Sergey Senozhatsky <senozhatsky@chromium.org>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linutronix.de>, linux-kernel@vger.kernel.org, Jason Wessel <jason.wessel@windriver.com>, Daniel Thompson <daniel.thompson@linaro.org>, Douglas Anderson <dianders@chromium.org>, Luis Chamberlain <mcgrof@kernel.org>, Aaron Tomlin <atomlin@redhat.com>, kgdb-bugreport@lists.sourceforge.net Subject: [PATCH printk v3 10/40] kdb: kdb_io: use console_is_enabled() Date: Mon, 7 Nov 2022 15:22:08 +0106 Message-Id: <20221107141638.3790965-11-john.ogness@linutronix.de> In-Reply-To: <20221107141638.3790965-1-john.ogness@linutronix.de> References: <20221107141638.3790965-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748847417876192228?= X-GMAIL-MSGID: =?utf-8?q?1748847417876192228?= |
Series |
reduce console_lock scope
|
|
Commit Message
John Ogness
Nov. 7, 2022, 2:16 p.m. UTC
Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). Signed-off-by: John Ogness <john.ogness@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> --- kernel/debug/kdb/kdb_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Nov 07, 2022 at 03:22:08PM +0106, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness <john.ogness@linutronix.de> > Reviewed-by: Petr Mladek <pmladek@suse.com> > Reviewed-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Daniel.
On Mon 2022-11-07 15:22:08, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness <john.ogness@linutronix.de> > Reviewed-by: Petr Mladek <pmladek@suse.com> > Reviewed-by: Douglas Anderson <dianders@chromium.org> > --- > kernel/debug/kdb/kdb_io.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c > index 67d3c48a1522..550fe8b456ec 100644 > --- a/kernel/debug/kdb/kdb_io.c > +++ b/kernel/debug/kdb/kdb_io.c > @@ -559,7 +559,7 @@ static void kdb_msg_write(const char *msg, int msg_len) > } > > for_each_console(c) { > - if (!(c->flags & CON_ENABLED)) > + if (!console_is_enabled(c)) Same as with the 9th patch. I would prefer to merge this with the patch switching to the srcu console list iterator. It will explain why the racy check is needed here. This change does not make sense without the other. Best Regards, Petr
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c index 67d3c48a1522..550fe8b456ec 100644 --- a/kernel/debug/kdb/kdb_io.c +++ b/kernel/debug/kdb/kdb_io.c @@ -559,7 +559,7 @@ static void kdb_msg_write(const char *msg, int msg_len) } for_each_console(c) { - if (!(c->flags & CON_ENABLED)) + if (!console_is_enabled(c)) continue; if (c == dbg_io_ops->cons) continue;