Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp214130lqs; Thu, 13 Jun 2024 08:10:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXTwJV1Xrugvc00aCLRPFqjjK6McH2ojB55dT64nhBqTvnJZyg0G3yGehZaxaMh184eam3zCRQESDcEz77531055i3R9G0SQs4ueuarWA== X-Google-Smtp-Source: AGHT+IECSt+fE7OszkQgU3sPkVC7xZLxDvqmiNsDXTGFMz3nL1tvqyP5+hMOIojJJYd/Ip+X4ddC X-Received: by 2002:a05:622a:50a:b0:440:f0be:4bcf with SMTP id d75a77b69052e-4415abd8408mr45342591cf.21.1718291416477; Thu, 13 Jun 2024 08:10:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718291416; cv=pass; d=google.com; s=arc-20160816; b=OPHnI5rCBbDZ3jJULJxrBg0FqFZLq/l1jtlS8m19MtAuP9o+vN0sBNjI/PfCEBaHfs RzlFtXefni2mmVnapyQGxfKg/FAHkSZhisQPbaKHQWzHZHrLcaVWW2OgbF8alBpNkzOh J94S2qEqXvUjPYv1+P8LG5wOKjK/nzhew0j4X9IYbh+HtpIPX3xIdY3sdfKch8St/BXg zgzPYQKDbxAAsxUr5ro9GWYMkzi227kZGuso2XOIZNgJsD6yULNzQjG7noPbiAuO2ZJN SR5ImTyQ7xktZCDMd2WCjB8a6swpIYerAvmyilBUr0DPwEzuRCh+mmxyebyqchZpOn/C TG5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DUpmZmbwF/doBo8lYAmVjQsaX/5wvkCX86E3yP6G0po=; fh=qvrC7YxJymWLQaE/Q2qKRBAwSriAL8TnE6WEgYqC9rg=; b=YwIlfvksfbVOdxCWc7PKS2XmikykemQ4dr0PUW5IBXvZKqx0V8ktO42CG6QcpnQ5BZ eIgpcBM2mE3B3FLJ1rXadeXZaAxgEl3kBj6fe+pnlDA71djZSLPOLvDgd3W0gdoVFPJI l/1b8yw1BwU7OaQWFVdgOZdO+yg7gg7uOepFmU1Wb0+gLp3s7SqF0vhaJVrrqJpwi3Du Gh24FWG33L7A5489lVPy8AiguYK1gfVCZYadzA0BfRGGe4fD42sBOfq6GqdnjuDMdxHf PzJD47lI3h+wFvOl6XPzHU5oOkGhTuvbB32FPRh2I7CFSYrAm2iCK5hsfTjdORymf3O3 xiEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=JNrnrdOQ; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-213500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213500-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-441f31030e7si15787561cf.741.2024.06.13.08.10.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 08:10:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=JNrnrdOQ; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-213500-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213500-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2E6D31C227C6 for ; Thu, 13 Jun 2024 15:10:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 57DB4148FFF; Thu, 13 Jun 2024 15:10:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="JNrnrdOQ" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A1951474A8 for ; Thu, 13 Jun 2024 15:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718291412; cv=none; b=Yc+vouV7QRDyAmEbdj03qRXKmL237em2SHw8iDvNu4KdT7bqvLw478xt9U/kQkqnHvjnqqv3QYua6bhSHX8LA0q/N2sstPHuRo0LN5fOTBbWdFYrrKabn3J9xXZLQzTwUCw5GiY/hDjq/RIMJ78b/HIVV7X2WNyLfWHQosKIvLc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718291412; c=relaxed/simple; bh=zgLUNykya9wnvckHbmFmydV6QZiIUXVYlktMP2XJO2U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YexNOCCp68KPnANUo3Hg/6HVRy4yBUwAiod9rIzxrfCdYPLcPyC9lhjgEz1C2f6MfnDHfUYdP/iUS1ubgf+78TfjWicBdR3SsHJoS1/3uq/X4o4K6w7Us1St7CzeId12GJBu7htLO03PBJMQsUHLluKivEzFDbvNBpXUiB2/eZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=JNrnrdOQ; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a6f176c5c10so143845366b.2 for ; Thu, 13 Jun 2024 08:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1718291409; x=1718896209; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=DUpmZmbwF/doBo8lYAmVjQsaX/5wvkCX86E3yP6G0po=; b=JNrnrdOQY0imuMaMdfx0WQNxn249JweCXcfCQb9boCM0uq65mPwCmDpa+5m5Axsz3M w9dgx4+LvPG8FSK+URaa6ZeI/bRgRQa+vDWPisyNNFexRZ2mDWGYpbUBko/kOC4m00Cd IIdRKxj3Ck0zOBoUQlA4YlOJfg49thyieNqT1QXfpqjWK5QVOi5/1Fb7+aU+fpbK7L28 TvDEfavicpRRSGbt5U0RI52MrpEghgw1d0meuIPLsCzc8h66g1fL7ef59L/ErU2chx5h ri1HO1czEHkesO1Uo1KmSp40UdBcM9WR/9MhUguBcW00OVmpkmTRmhu/Ipgota/CQD6i AHGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718291409; x=1718896209; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DUpmZmbwF/doBo8lYAmVjQsaX/5wvkCX86E3yP6G0po=; b=MV9lXcun3QUWQQTUtJdPgn4AwrB6wPoFZVe1mPRJ0ksKftxKB4ZFI/sKo44jWwe2gT cMtx7ENffW7vo9v5QYUezomKPrZAUHU9foE+0LBFfKEJ+mP/d56oo8vamcWN7n7FnCzg 3WUe78zqeqgp4pGXJOTZP+ANEAjvwfhuU3IS/zG7KiiQeb/ncCw++s0z537KZdglM2Ds EQsw5K/jTKPuEaUpiEYaIPsIxOEjP8Kh3Yh2docul1nBevIpRrhrjCliX97/XofRZmNe 8kNI9lQhvwETEyGVv9fzcjOORNF4OBvfcAP1pMFE5r8St3OBI2WsTW9Mn2xkYeke/oka s30A== X-Forwarded-Encrypted: i=1; AJvYcCUIeqM+I7jlUZNaarWT+Q1A3x7R97B1cj5gVEbCR7mZBG++ZINH9NImOivfKv5WyTLmNwY0spZEt5dGiDEVQXplbClUOLFmSoJ5SPRm X-Gm-Message-State: AOJu0YxGhMvW6Jyo3OXI25XKNn2lF7H164Vw5Qtp2AN/bUQ776BszgqW Rm456jBua3Vu9CnCWSkIVD2LnMimfIl/uoL3QMjF8KHmc1O9WLuMYpEKoS+i36a8htWO+6z2kST z X-Received: by 2002:a17:906:382:b0:a6e:f72f:4aa9 with SMTP id a640c23a62f3a-a6f60d297famr2017366b.25.1718291408729; Thu, 13 Jun 2024 08:10:08 -0700 (PDT) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56ecdce5sm81101366b.108.2024.06.13.08.10.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 08:10:08 -0700 (PDT) Date: Thu, 13 Jun 2024 17:10:06 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk: nbcon_atomic_flush_pending() is safe only when there is no boot console Message-ID: References: <20240603232453.33992-1-john.ogness@linutronix.de> <20240603232453.33992-6-john.ogness@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; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu 2024-06-13 14:52:24, Petr Mladek wrote: > Boot consoles are not serialized with the nbcon consoles via the nbcon > console context or con->device_lock(). The serialization is possible only > via the legacy console_lock(). > > The decision whether nbcon_atomic_flush_pending() should and can be > called safely is similar and closely related to the decision > whether the legacy loop should be used. > > Define printing_via_context_safe symmetrically with printing_via_unlock. > Allow to call nbcon_atomic_flush_pending() only when it is needed and safe. > > --- a/kernel/printk/internal.h > +++ b/kernel/printk/internal.h > @@ -192,6 +193,15 @@ extern bool have_legacy_console; > */ > #define printing_via_unlock (have_legacy_console || have_boot_console) > > +/* > + * Specifies if printing on nbcon consoles is needed and also safe > + * when serialized only by the nbcon context. If @have_boot_console > + * is true, the nbcon consoles must be serialized with the boot > + * consoles using the legacy console_lock(). > + */ > +#define printing_via_context_safe (have_nbcon_console || !have_boot_console) Oops, this should be: #define printing_via_context_safe (have_nbcon_console && !have_boot_console) Best Regards, Petr