Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp314707rwb; Wed, 9 Nov 2022 02:55:47 -0800 (PST) X-Google-Smtp-Source: AMsMyM6P6DA5qCaJtH3Gt+cNdww7wCSgVOZhJLpReTvktIVZH+wKYkO1aK1rfopqHHQcpKMUEH7+ X-Received: by 2002:a05:6402:c07:b0:461:87ab:78aa with SMTP id co7-20020a0564020c0700b0046187ab78aamr60457292edb.258.1667991347284; Wed, 09 Nov 2022 02:55:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667991347; cv=none; d=google.com; s=arc-20160816; b=Gcf9aO5Mms84LuWiW0v+F2iHGpEilsxJywBn+6UvUN3cCAas8X9xlff4zzVON7hNP4 vrshDbaQsjG6r+cDB+B8FI1Flgbd6ve7k4XpZWGnEUs7mouZvtz/Xpfd0wjk52VC0L9u NVZtB/rjneuf3l9YpZIVJHMsriGsiWy1lZ+wwMFGjqRKIFvi/W1mNXvy9+5Vyv4ffxJQ HYt/4uZY4oclPD+CkbbJo5YSlTLoH2AZcqKbdosh+mtfiCKeR416Z+wJXb8Ix9xPV9ts 6HCSiq+nQN8FtSTfkXOqsyotgLK57g4pdwXfIbzFX+xgZxEOt8vyfTmJ+X6o/FxzDGGp IF5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=kPAk+3cLOj2C0i9syAj3cq39vfGjg5hFSD8YkhVNKCk=; b=LvRCaVrDf558p4iP4gcZAA6nQosenxkmDPqajlisBeLfGIR4nCz7UH+H2dPPGa3WVE 0TBRx6NA7mGKsxZsJicn9o859dLki+2e0WPbFb7ee8JzfR1sXx7ciGK/Z+InDqlyB0eA 9ihmNlrf+owhG1VEUE2jpSeLg7idtLqQZDWaaO0jsoqS/hJWZRO6KbpgQMtWcjlGEt6b IJsPnyiM/1PhDBCafyXpOmpBF+d061+/oWBGBZfsTgjHEjhxtoUCUdRpo6ZALQgQAhJx Djyhm2IG6rm/Q1qJonj7VCDcdllOPdLIsnq8IEgc+3o0mnEvOsTpJ3S0E9SSQ+JE1yH0 BguA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=KGQPt3Bu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=LsawK0XI; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020a170906975500b007ad8bd5a3b2si16669418ejy.263.2022.11.09.02.55.25; Wed, 09 Nov 2022 02:55:47 -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=KGQPt3Bu; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=LsawK0XI; 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 S229817AbiKIJor (ORCPT + 93 others); Wed, 9 Nov 2022 04:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbiKIJoq (ORCPT ); Wed, 9 Nov 2022 04:44:46 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEBB422BE4; Wed, 9 Nov 2022 01:44:45 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1667987084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kPAk+3cLOj2C0i9syAj3cq39vfGjg5hFSD8YkhVNKCk=; b=KGQPt3BuMB8UxOiIeFc+7+g3uFtm5Q+FCy0D1VPuuhLPP7wqeYjclkvf1RZxSMfB6ZYBCt O5f5FF0udqPW6CI/S0q6BcPp+Y5RSQoTsPStReWTA85+wKkTrJjAgTbSEAeoXsA3kVvFE7 PEXiLJdpH/khQx7aMlU8mUKl1Y4fvdVWoa8Ty7z8J5eH3ft0N/k/3y6tPQqkXFUeFJWakU WtOA5VwvhTYQ/TBB3pnQwMlyenIw21lmNsyYhrjRRERT4DVCo4owgVakHWDZhAnMSIzOfY kwrI2VjoZ+EHwYrhzKzN6fxSAY1G9IMwfNLmcCELUTNB4I5Se7wkQhlDwQTqeg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1667987084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=kPAk+3cLOj2C0i9syAj3cq39vfGjg5hFSD8YkhVNKCk=; b=LsawK0XIGHqnjIumlhGVKLy3i3Z9JVErl5RyBoTCpwhm33D+5Tr+t5xSfti/otQSEWiBov Du2+ohG3YC9rpIDQ== To: Daniel Thompson Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Jason Wessel , Douglas Anderson , Greg Kroah-Hartman , Jiri Slaby , kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org Subject: Re: [PATCH printk v3 36/40] tty: serial: kgdboc: use console_list_lock for list traversal In-Reply-To: <20221109090631.wbtar2ho45x5yanl@ash.lan> References: <20221107141638.3790965-1-john.ogness@linutronix.de> <20221107141638.3790965-37-john.ogness@linutronix.de> <20221109090631.wbtar2ho45x5yanl@ash.lan> Date: Wed, 09 Nov 2022 10:50:43 +0106 Message-ID: <87tu388nsk.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-11-09, Daniel Thompson wrote: >> @@ -463,9 +476,14 @@ static void kgdboc_earlycon_pre_exp_handler(void) >> * serial drivers might be OK with this, print a warning once per >> * boot if we detect this case. >> */ >> - for_each_console(con) >> + cookie = console_srcu_read_lock(); >> + for_each_console_srcu(con) { >> if (con == kgdboc_earlycon_io_ops.cons) >> - return; >> + break; >> + } >> + console_srcu_read_unlock(cookie); >> + if (con) >> + return; > > This change isn't mentioned in the patch description. I will move this change into its own separate patch. tty: serial: kgdboc: use srcu console list iterator Use srcu console list iteration for safe console list traversal. Thanks. John