Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp3287401lqo; Tue, 21 May 2024 12:07:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFVXim/yQAAwAmpPDe9+pRBQGCiccn5IpBerh8416T494iPJcHrBx8XPgeYeop4f2+xGwxpeUpaZBN6Be04IamFmGjPB7CdxIeue6fvA== X-Google-Smtp-Source: AGHT+IFJJHnpNuGWziOG9jt1DWkfl/NyZtZkTHnocc8m3FT6pJECO1ySe6PjaehwQO/zZZOWFJlf X-Received: by 2002:a17:906:3519:b0:a62:ad6:4286 with SMTP id a640c23a62f3a-a620ad6439amr296242766b.7.1716318460621; Tue, 21 May 2024 12:07:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716318460; cv=pass; d=google.com; s=arc-20160816; b=oFyBCi3W3YKvrPWkR/OTbpINbQ+KAsEABXiuPDMsJrkCGIx2cAdvhJfOo/f2VW3iUY dgjrw/n4cK2F1Nnl4KDG/lfB4vzaU3Yz6N/qoeIvr4UbkGuFoXXsJaacuVc4Hr/SZwkA lfsak1a9RiF2jhLhDE2+VtggTFXOlMHJAeY81V7zPjoi1vxkBDDCXSSepWJmyB9nZO55 rrHwcyuNsAe3rkNQFkcfkxqyZoUAuwLTl/aYKjSw4v2zwOV5b0SHx5rJ2B8ZcSGwL79e 7uC3ZNQAzIDj4av6ZPBXSvTVCDBjRJRCze+X5Us7FRzlaVmXCvIUGZATy9yoBGcML9li 3n4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=ppUtLbpu54U428XjsLiaEeb2s73JCEqX0+Mtd4NH/l4=; fh=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=Y90voztCLAD+2cLoSDPJW21K/I9YRwz/V8rRjzdiS9JZ4Jj9OGvx6lJCEiPEsOd/yH mGb815Z+ntYhcHCDrwwnWA8O7bpeiToj2La+X0c4NG77/j76C19shRSIwqiw1tE3nz4i ppGamjWA4mwxvllff2k8vruJUp83BxqnMqDV+6+ESmm36xbFQUH3GjRA4nIashk5h1Jg 8qKZQn2yBpVdoIpkVEHrXV4zpX5gFEBoUUebe8dWS0jmHrMjm2Q9Bh7VaGNAwW6c/RD3 VBe6YtYTOvVOn/hbEkZEyJgiRHeY0XpMJYCcPkflLhzdguacPcmzkU9/2BOTdhvXGUOR TDgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=P4AX6Tf6; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-185366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185366-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17ba39b8si1534102966b.551.2024.05.21.12.07.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 12:07:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=P4AX6Tf6; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-185366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185366-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 57F011F2321C for ; Tue, 21 May 2024 19:07:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 95FB214901E; Tue, 21 May 2024 19:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="P4AX6Tf6"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="c1SblpWy" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 345AF142916 for ; Tue, 21 May 2024 19:07:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716318451; cv=none; b=lxqXiclB8uZnhX3PrXOUMVfAEyIiKBjSVRfPhzucsJjQC72RK5b+kHpiRZUMNZT97fXGOC/kHoGZk4idShZPnzUQai1HFuL1XnMoMp8NTZsimG4XYT/43CWHJ0sirrkVQJFIDPQyeFf7jz7enjtSR+cs16Xzi9/uI5muUTWxWxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716318451; c=relaxed/simple; bh=UV1GwPjRYKJek6MZ689XDfh23nHLwYeqapg2ckKYh4Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=A7OBEbTCigrmPMwKDu1+6hV2OLeUhYITrahXDtygloj156O7s28uyiPp58Qwv3xGN9mxv555n7YAhl/t1PK9GnUpiqHb2Pf4DQC8vWT8D4F01dabcWO+1rSdOPvcnBXFZqMgug//ky2lRjzhDloB3KMJT9/DWGBTXu2jM+dtXNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=P4AX6Tf6; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=c1SblpWy; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716318441; 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=ppUtLbpu54U428XjsLiaEeb2s73JCEqX0+Mtd4NH/l4=; b=P4AX6Tf6BLCdrGmVzfVNnL/DZbUvT94AtZ1pnnkQm16sBcxjFh3wNoXsyAlUXnLkPxt8Wd VKLcpGmezk0/Gb8gmC+Xd7UwTLrbDZyadlR6ZoclMyCx5JiQ1T54BHh5zFCfsYwBlzNHE0 QmRt0Yu2jbBOQlE3utCug9u7ZeSJAQDg5DKSwK2US/9FnGH2qiiROAK6X5IcT9BPCB5xqE ZDE/lVdoHQpW1O/HTsKlLpSdyAI371U2MRAF5wMeEP3uYVZ0z7CLWT7NcS9iqoHyKwGGY/ tmrVVU+An2oYyL0PPNvpNcOnyzZQrcJ3RZbyg5VQ67VIg1dnKVUi0u3thCjFxQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716318441; 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=ppUtLbpu54U428XjsLiaEeb2s73JCEqX0+Mtd4NH/l4=; b=c1SblpWybs74zN6Oz72KDKlAkV0vsDrQTMsk4T38lilQNpKnvyYRJFVWrk7FjkvndUoYpg 00wT8M5ncyGfwJDg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v5 19/30] printk: nbcon: Provide function to flush using write_atomic() In-Reply-To: References: <20240502213839.376636-1-john.ogness@linutronix.de> <20240502213839.376636-20-john.ogness@linutronix.de> Date: Tue, 21 May 2024 21:13:09 +0206 Message-ID: <87seybdlwi.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On 2024-05-20, Petr Mladek wrote: > What about reshufling the code a bit? > > [...] > Your proposal is fine and is easier to follow. Thanks. >> + /* >> + * This context must flush any new records added while the console >> + * was locked. The console_srcu_read_lock must be taken to ensure >> + * the console is usable throughout flushing. >> + */ >> + cookie = console_srcu_read_lock(); > > In principle, this should not be needed because the console is > added/removed under con->device_lock() in > register_console()/unregister_console(). And this function > nbcon_driver_release() should be called under the same lock. I added a comment here to make it clear why it is needed. It is about making sure the console is _usable_ during the flushing, i.e. it prevents console_suspend() and console_stop() from exiting while the flush is in progress. I will leave this as is for v6. John