Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7668353rwi; Mon, 24 Oct 2022 18:36:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5gCR2GnzYrzOerGQFNQzavGFGgmIJ9s7KwbRK0qWRBsCAptCmY5rsQdjj6jGCtUvYtVNYa X-Received: by 2002:a05:6402:5212:b0:45c:c37d:4be2 with SMTP id s18-20020a056402521200b0045cc37d4be2mr32752433edd.31.1666661804179; Mon, 24 Oct 2022 18:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666661804; cv=none; d=google.com; s=arc-20160816; b=ivuXki4taO60j8phNqHbu4+jDX1pXuzYIqV7/eq9B2a/erNEbOwujUgkEBBO5VKdvr r9/ZJuOPeFmSLAlc4YN2N7uKUVRDEYO3p6/dQcNLGVtEjcqz/x7aYAv4bujuDCIYmIFo 1bv9I/tadz++AEsmuv2QggfDboNh0oFUdBE65gm1cEOsMu8qHUUrcxtkPDMpPeg6POeX JTUJYS7Mmds7UHQ45YYKiXjmYA9xs/BqxFA7y9SlZ6tNOpSrbQV/wCtP9OS25pociMbE UKPRl2+OLFB9khgpHNJPhTlmxn+oSPosnNBPeskh/dbgsdSYmmIyBGpbgDX947bXxUN0 kpFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=/J+E57FepHa+VPoHH/vCuYiisEoXCo25k1eOwk+X83Q=; b=q8xrInAN7bHKDhs8hJYLDnOOR00PGIvjsRsuqAxeFTUy2v4z3is1iLPNYke2xaZF1W XWx9fk6Y5ZKw9tA8udVKQqD7g18xqeaG/33VodllN7eKi92A3rj6bS8S0aq488e/13gi V0EhAGi9ClAPhJICNsF877uIHFa/7g7YXA+kcp/RDQwk7mQidZjzXAEYwGJxh9peBKAc +Tedvt7x1GNQZhP8MAsurkR3dkthZFmcnVjM7MNGvq8KKr/72GmkmVdxQmCxTupItXrW +B2zchePGu666xkkVw5wKrKoTnHCs3FmNxz/lej42U6Vl244JV/10iU6EFrMYBLPaXwE l3JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LT4xjotE; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ae8-20020a17090725c800b0078e25345011si1405927ejc.926.2022.10.24.18.36.18; Mon, 24 Oct 2022 18:36:44 -0700 (PDT) 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=@chromium.org header.s=google header.b=LT4xjotE; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231599AbiJYBW2 (ORCPT + 99 others); Mon, 24 Oct 2022 21:22:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbiJYBWK (ORCPT ); Mon, 24 Oct 2022 21:22:10 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DD7054CB4 for ; Mon, 24 Oct 2022 17:49:49 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id ot12so8910490ejb.1 for ; Mon, 24 Oct 2022 17:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/J+E57FepHa+VPoHH/vCuYiisEoXCo25k1eOwk+X83Q=; b=LT4xjotEAQR+rhahuuC7tR5xBqJe9l3UB1hAIpYccMggPOooSk4KhuAaRudbslGZ9O q+Bi3Z/UsVAZ7vS4NyzfUydTnIt6ntqcgJ9O3pk2xZkcp1u2mriPc4Eb+65LxBjyVP4W kbUnb6o6ie3vaTcKX+BW3LO94wVzl2CJ7Z8j8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/J+E57FepHa+VPoHH/vCuYiisEoXCo25k1eOwk+X83Q=; b=Farwgg0bUiSQrAzE3AbaphAJSQaSmjf01eIgQT3Ut5mlIHpaEabNoPAOD+QUwpx2f1 EpHdaM8SSzR2/p84URVVjOOq8mZlhOH9Nmo1uOU8+XI5nD0UCiCL2ogd+xkHLZHJi0Ja AXtIbiFc4XSC39YePRBFfhpSzsr+5KFHl2i+VXL2Qej5U2NyoxwI7YvzKIOj32yUUIyN h7LE4YLdNpwLrn4wI1L8HKhL0PqgS6sRj2NYCMgflWV6A5h6CUvy5n+01+KyvRzam7hf 8asPGLsO0MYuVUn3X/IVOSmd0wT24UML/UOi41d6OWz/4oUQJVffHJjOyV6KUHQcjmUu aIWw== X-Gm-Message-State: ACrzQf39qWVwxcsdCtRflBR/B59pJ86Q9A1Y3utJMkc8P8K7TG6BDTeP DwEKO9NyTGE3EDceafcHq/DDi1gDMvYopDXy X-Received: by 2002:a17:907:8a0a:b0:78d:b87d:e68a with SMTP id sc10-20020a1709078a0a00b0078db87de68amr28760082ejc.301.1666658987308; Mon, 24 Oct 2022 17:49:47 -0700 (PDT) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com. [209.85.221.52]) by smtp.gmail.com with ESMTPSA id hb31-20020a170907161f00b007803083a36asm557704ejc.115.2022.10.24.17.49.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 17:49:46 -0700 (PDT) Received: by mail-wr1-f52.google.com with SMTP id z14so4988950wrn.7 for ; Mon, 24 Oct 2022 17:49:46 -0700 (PDT) X-Received: by 2002:adf:f641:0:b0:236:737f:8e00 with SMTP id x1-20020adff641000000b00236737f8e00mr4396527wrp.659.1666658985935; Mon, 24 Oct 2022 17:49:45 -0700 (PDT) MIME-Version: 1.0 References: <20221019145600.1282823-1-john.ogness@linutronix.de> <20221019145600.1282823-13-john.ogness@linutronix.de> In-Reply-To: From: Doug Anderson Date: Mon, 24 Oct 2022 17:49:34 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH printk v2 12/38] tty: serial: kgdboc: use console_is_enabled() To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Jason Wessel , Daniel Thompson , Greg Kroah-Hartman , Jiri Slaby , kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Oct 24, 2022 at 3:46 PM Doug Anderson wrote: > > Hi, > > On Wed, Oct 19, 2022 at 7:56 AM John Ogness wrote: > > > > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > > > Signed-off-by: John Ogness > > --- > > drivers/tty/serial/kgdboc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c > > index e76f0186c335..b17aa7e49894 100644 > > --- a/drivers/tty/serial/kgdboc.c > > +++ b/drivers/tty/serial/kgdboc.c > > @@ -533,7 +533,7 @@ static int __init kgdboc_earlycon_init(char *opt) > > console_lock(); > > for_each_console(con) { > > if (con->write && con->read && > > - (con->flags & (CON_BOOT | CON_ENABLED)) && > > + (console_is_enabled(con) || (con->flags & CON_BOOT)) && > > . I guess this is OK, but it feels a little pointless. If we're > still directly looking at the CON_BOOT bit in con->flags it seems > weird to be accessing CON_ENABLED through a special wrapper that's > marked as a `data_race`. In our case it's _not_ a data race, right, > since this function continues to hold the console_lock() even at the > end of the series? I personally would drop this patch but if you > really want it I won't object. I realized that my statement isn't quite true. It actually only holds console_list_lock() even at the end of the series. Still, it seems weird that we're declaring the `data_race` on CON_ENABLED but not CON_BOOT ?