Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2573976rwb; Sat, 24 Sep 2022 10:39:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7R/NWYbfPTlWx4NjvMNm4URamr18PkHHG5FwF2brKs3UQDDwPjT+gSjcaRL9DkwZTtWI/I X-Received: by 2002:a63:942:0:b0:43c:428d:16a9 with SMTP id 63-20020a630942000000b0043c428d16a9mr8315101pgj.423.1664041176288; Sat, 24 Sep 2022 10:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664041176; cv=none; d=google.com; s=arc-20160816; b=dbIMfv48FZG9ZMDpHsXV5os55IN6K8Z+a1TSTXXj1vcHCaeBGSGsXoR3XXJp+RZ+qa 0JiS18Tc1JbMYTjgaq4yybQ4DNUkkWmQkE68NOHHQIziChyp9qTXw27uDFlTCLRzFSfj CqSKgrzsUL0v241tlie7Sw/nGIW8RCQWOzKM2xTB/KBQsjkH74w7NRfDzmXpecAvbaf3 8+5LFPoZKio7qKU4Jk9wcofNMDQYwC0OMW49Jw+Qt1Zl3HhEWipxxDNilV9kHAMnI1nE 7I8qMVbZ7voHngNSAHPiaNvnDJNQay4W7pGbbC3nzOtCVwLQSkbC9/B9g0rEz1nO4Zo1 +DpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=y6poo9KDmdm/sZFgB6cknF0Tk1ReVR7T2pNZf5ISH80=; b=Du6AYMtiIU1z7j1CqsPgXerHv/8Tl4P7W9x9AneF9BBeU/2jRBmS1PKLHFgnvvbhWx MpI2/VaaSGZFQtLQsG2U3QL5PxdSrJtbDPZNipp+pLQ3+q6KylO9WxTg4PjUlpNn3uRw hldBoRYl5F4psKFlIBgvqNbzbZ8LmVdLL7W4x9pnCpf/YbHeStPiaH6pDlJYceAyGQEc pTwvxUk07HQA+mhmtMQv21uiVmRE22JyH0nxg1CYgx1CpbGRKgKD6vlciiJW9A/zd0XX LG+w4F2P/LqwnSnn59h0cwZ1GHBCdZYHwHVWlttSoWXVBWHAG5umOSEpt7l9yNd/JTWY DuIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=ChfeE5hr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a65594f000000b0043882f3e6fesi13070293pgu.440.2022.09.24.10.39.22; Sat, 24 Sep 2022 10:39:36 -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=@gmx.net header.s=badeba3b8450 header.b=ChfeE5hr; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229495AbiIXRVA (ORCPT + 99 others); Sat, 24 Sep 2022 13:21:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiIXRU7 (ORCPT ); Sat, 24 Sep 2022 13:20:59 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AC4B63A5; Sat, 24 Sep 2022 10:20:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1664040039; bh=jUU/GHPsMUSoCCNnDWS/BoBB81LG++oXGXwk/mXpgb8=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=ChfeE5hrcDGqjTwmWHM6nhJdFLbnG9ugrUHktQelxxBUnUw1COGGaVbZYKunLdY3y oGlm6fIDuMxG6JyZcBh95HxAULZ4NFjy/jbJQXegVwAU3mjX1bmbN4zgLLfQJfra4o NXocIIfgKWoPq+TBUE97savwb5oMAyewW1ZsO3EM= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from p100 ([92.116.155.187]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MbRfl-1p8zk60DYP-00bqXE; Sat, 24 Sep 2022 19:20:39 +0200 Date: Sat, 24 Sep 2022 19:20:36 +0200 From: Helge Deller To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , Greg Kroah-Hartman , linux-parisc@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH printk 11/18] printk: Convert console_drivers list to hlist Message-ID: References: <20220924000454.3319186-1-john.ogness@linutronix.de> <20220924000454.3319186-12-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220924000454.3319186-12-john.ogness@linutronix.de> X-Provags-ID: V03:K1:/2YDIKcSg2pNPoQopaGy9wV+dOO91R12jtUK5/VkDrL9Jmo7/zb M0YZZoi0XE/S64cT3ywtbPfh5MnVx2wMrO91jJc37zdcIDXpvPaj9KUU/NuA6m3lFap1ceS 3Dk301T92BT4nLlx+MYqvcCAfML7fIWh+3T3QP46ECiLt3JcjsfqBpeHvTL2voXCJhzZKJQ XY0ITXzzbVNJ11buQgvrg== X-UI-Out-Filterresults: notjunk:1;V03:K0:+qNRF9TEP/I=:jfMTNh3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ObfhiKs6kZDX9oVjFqppBV2HhdojH3ozT2bxMKqiH2pL hItAJcW4yT9Aae1XBGhMgLyQc7uSJPfEBtr+UycuSW+MM1B5bdqor3fv3vwNWouQHCqY2G7Xs 53q0To9HliwysgdOqvXbMtHDuQ Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, 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 Hi John, * John Ogness : > From: Thomas Gleixner > > Replace the open coded single linked list with a hlist so a conversion t= o > SRCU protected list walks can reuse the existing primitives. > > Signed-off-by: Thomas Gleixner > Signed-off-by: John Ogness > --- > arch/parisc/kernel/pdc_cons.c | 19 +++---- > fs/proc/consoles.c | 5 +- > include/linux/console.h | 15 ++++-- > kernel/printk/printk.c | 99 +++++++++++++++++++---------------- > 4 files changed, 75 insertions(+), 63 deletions(-) > > diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons= .c > index 9a0c0932d2f9..3f9abf0263ee 100644 > --- a/arch/parisc/kernel/pdc_cons.c > +++ b/arch/parisc/kernel/pdc_cons.c > @@ -272,15 +267,17 @@ void pdc_console_restart(bool hpmc) > if (pdc_console_initialized) > return; > > - if (!hpmc && console_drivers) > + if (!hpmc && !hlist_empty(&console_list)) > return; > > /* If we've already seen the output, don't bother to print it again */ > - if (console_drivers !=3D NULL) > + if (!hlist_empty(&console_list)) > pdc_cons.flags &=3D ~CON_PRINTBUFFER; > > - while ((console =3D console_drivers) !=3D NULL) > - unregister_console(console_drivers); > + while (!hlist_empty(&console_list)) { > + unregister_console(READ_ONCE(hlist_entry(console_list.first, > + struct console, node))); > + } > > /* force registering the pdc console */ > pdc_console_init_force(); Thanks for doing this!! I had to add the hunks below on top of your patch to make it compile and boot sucessfully on parisc. Maybe you could fold those into your patch? Thanks! Helge diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c index 3f9abf0263ee..f15998aa47a8 100644 =2D-- a/arch/parisc/kernel/pdc_cons.c +++ b/arch/parisc/kernel/pdc_cons.c @@ -262,8 +262,6 @@ void __init pdc_console_init(void) */ void pdc_console_restart(bool hpmc) { - struct console *console; - if (pdc_console_initialized) return; @@ -275,8 +273,8 @@ void pdc_console_restart(bool hpmc) pdc_cons.flags &=3D ~CON_PRINTBUFFER; while (!hlist_empty(&console_list)) { - unregister_console(READ_ONCE(hlist_entry(console_list.first, - struct console, node))); + unregister_console(hlist_entry(console_list.first, + struct console, node)); } /* force registering the pdc console */