Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3945568rwb; Fri, 30 Sep 2022 10:23:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Fas1rkwcquAktSPcutjq57cPUPeMF2UwLki+8yNwXjkTOc4zqVR92j0N0nbh20DCpudYl X-Received: by 2002:a62:6406:0:b0:54e:fa79:ba40 with SMTP id y6-20020a626406000000b0054efa79ba40mr10230152pfb.60.1664558615861; Fri, 30 Sep 2022 10:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664558615; cv=none; d=google.com; s=arc-20160816; b=V4nbcU9jKbfatU9m/iEJICqnvD4Sb64pN9hFLYctuh5pqmO/90/NlJa0foRg/FqsIK 3xsanfZ0cQFCjUNcqYHyUZMEaOebsMYrJrZHab6UhDgs+ip1X95CTfTqFxMHA5hxQ5hN FgZo/fh7Hbu2amQIlYX2Nb9LAz4A9jSo9MLOPSsV2XruoHyNZy4VOpyaBiGR8N75srzW xqPCwcqg2S6OkGXHYPO2atj/kh2sDCsOp86i8yRz5fXSkNNRCr/ACqomtDOvBT9X7ECV 5fGZIWGkmE8iKfoKmHz7Sk/vLQ4wsIgawqfcCGyMX77GzdRTCt5ni3cMIUVMdomXbrK1 YasQ== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MRJRGeNCndhddfWuXMROjmu5TMGjEPmg2duBf2GyWWY=; b=h4+R1y2CYXPo9wLWC0gLn4RzOmBVSb0FW25Sd4/ikLMSNv6r/pKQ5Ez3+YYgWhwa5Y fhKhO5fB8I4CnuqUxmdD3wT7/Z5nqVg4n264QgW0OUx15rNd79nsqEaoUwz8yUJEUZ9B UTgm86kQiLPun6GHyn6/iiz0nnHzUU5idIncmFoThI/HAsaiiPTmUVI8Qy4iLdXc4Nl8 tTYnUdjpSwAkt1aXdJtgQSqbKzmY2+rIB5GwUqSP/JwYCx8bjcpsW66L0T/ohHFvfxsk b+XcmXEX2lGeVUxC0wxJRczOsmJxbq8St1nG1J9J7waGOPFT+M486/JwgdfoY5sjQBs9 UBmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=dtvC2lxm; 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 190-20020a6301c7000000b004412bb6b27asi2707372pgb.55.2022.09.30.10.23.22; Fri, 30 Sep 2022 10:23:35 -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=dtvC2lxm; 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 S232248AbiI3QyY (ORCPT + 99 others); Fri, 30 Sep 2022 12:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231186AbiI3QyW (ORCPT ); Fri, 30 Sep 2022 12:54:22 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F071D849C; Fri, 30 Sep 2022 09:54:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1664556837; bh=ldg00G/wOIf7Qazf8S9AtlVvQqdt/1Q1UHQGxZlMAfU=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=dtvC2lxm4XY+waJRyTPKDh8o7AqtSxi/mqumk5ku35/hW+3uh/a8GtBVkBeV1cZLt YiiVX2ETdvxdjsWBhMdC83M9S7xj70phyNZNKs5oAWSRos+WS6j7dZVj/PUOt/5eMF Qgc743ru8Jjgooq+Xmgqyoab7Hn+M6HvrQ3fSDqg= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.169.174]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MBDjA-1oW4zr1rxO-00Cfc7; Fri, 30 Sep 2022 18:53:57 +0200 Message-ID: Date: Fri, 30 Sep 2022 18:53:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH printk 11/18] printk: Convert console_drivers list to hlist Content-Language: en-US To: Petr Mladek , John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, "James E.J. Bottomley" , Greg Kroah-Hartman , linux-parisc@vger.kernel.org, linux-fsdevel@vger.kernel.org References: <20220924000454.3319186-1-john.ogness@linutronix.de> <20220924000454.3319186-12-john.ogness@linutronix.de> From: Helge Deller In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:aBlMY1mOVOI1dI1ab3QDjCUN0O+T72bechUGsrQ2kel+bzopEPw 2sAUdeM/uWL6UZjE3QV/86EnRurXVWiTW9ZN3vzVXlLfeYV1oyNIod1hIkkkT/QiOcba+Gc FJffe6z4FFvuKQWG2uORErUXpg2hUxVItE/HOiUd+E7jwAVWh/vk/jCuTV7aVEqHZf/tEmS htfdSzdkp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ZI3FkxLNtobJXYIHMipwXQ3p NwUCwuf84pAJmHIe1eeav9ptjh3sXBwDcgJUTQBkwwC5LoVDEVxgh0z+R7QPC6vnYtAlLi4Ox JmXd5c+QtZXg8hG0yylsh4XXHsU2LZfFaTKt+jq2zoFy2Ac326G96hqYrPLsjEqynSCQ19hBT 23oWB9GsWeoWjeVdGi2zkL8eAN X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,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 9/30/22 16:20, Petr Mladek wrote: > On Sat 2022-09-24 02:10:47, John Ogness wrote: >> From: Thomas Gleixner >> >> Replace the open coded single linked list with a hlist so a conversion = to >> SRCU protected list walks can reuse the existing primitives. >> >> --- 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))); > > The READ_ONCE() is in a wrong place. This is why it did not compile. > It should be: > > unregister_console(hlist_entry(READ_ONCE(console_list.first), > struct console, > node)); > > I know that it is all hope for good. But there is also a race between > the hlist_empty() and hlist_entry(). I wonder if pdc_console() is still needed as it is today. When this was written, early_console and such didn't worked for parisc as it should. That's proably why we have this register/unregister in here. Would it make sense, and would we gain something for this printk-series, if I'd try to convert pdc_console to a standard earlycon or earlyprintk de= vice? Helge