Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp916545lqb; Wed, 17 Apr 2024 14:59:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqg7w9iwdujATQ6/kIAGJaeGTOj9Qun7gkGfo0BpPcO8uKV2dYei30x7xm1HHZwQHl0suS1TYeJqHESaMqu10oQ/zXOcwwSQv9wXbLQA== X-Google-Smtp-Source: AGHT+IHuaCafl5AkQlEbydS/VCkNjtHKU9F7WGooUuTOoutbjQT5I4LrEYz0ZHLCyZcT497qVpPO X-Received: by 2002:a17:902:b285:b0:1e8:2c8d:b74a with SMTP id u5-20020a170902b28500b001e82c8db74amr864971plr.10.1713391184200; Wed, 17 Apr 2024 14:59:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713391184; cv=pass; d=google.com; s=arc-20160816; b=zjnEeGc3glW5sRVzgUMTRVGtm5HmB7i23QumqNIvscPrG7agDnhkn80ZuTNDTSigWR EVIC+SFh5pa4fBae8R8cksyiFlilVPQ9uf6f1KU93PbbibfwFwhruRvsdP/HWXq3nLEM LWQZFLxdpW6fuVbQHs1qiTdctpsJHeNUc4Js5J8nDcntNMuwF2VHwrk7X2myd3RgRBLe rp8R5vyHdxGWFarU9N6MgOQKwfq+XMOUkMLiGPqA8lEATEGhnvkpNhpHy5P3K91S89MA PSWACL/9VIeN1xHzraaZfZtIJye61koZkTSOsFbrAyFZogRGDLEa44fkd5/70xhztUOl a2vA== 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=nyuJ8mRZERV0q9WMSxzJ1SqPvH/eh2GfSaBY2YWfdjg=; fh=pKnPKUsir0uEGSsor+4Zc2vgbu+g+ayvUgsdzkuXaoA=; b=mW2ofsGyMDzsO/Wi7V564VCc88kN5UlfPi3xvOHsmDp4blqvT6kt4/YP1MJilCbWG4 qx/fVtzCU5vQLx9kQiSjj8BCNKSfkMqtNT9MZ0LCtDPL9j40m/3nyt/EC3dDnLfYS3Rx XsOSFapWJTlFy8NQFq8tDKWUaAKsRH8itK5uSISKXOi8+uY8mUvagFaPOmTVLqek77WN ENcrZvJchUoAx9rUpktUeBvW+3WfnuN6okf/xFIcW/ctBpx9l+OTW9tKyrAzKs+HVeHW PgzSUaE6mY5CiRXPqupI43X9oP1JvAk1tPlXvL0pM5L8eQUY5ddOxsNf3MUiyiPHUkWB kbYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=mEyX9j7x; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=g0tJY04K; 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-149271-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149271-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b6-20020a170903228600b001e0abb2c775si138139plh.474.2024.04.17.14.59.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 14:59:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149271-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=mEyX9j7x; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=g0tJY04K; 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-149271-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149271-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CC0942847AB for ; Wed, 17 Apr 2024 21:59:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9878212E1DE; Wed, 17 Apr 2024 21:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mEyX9j7x"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="g0tJY04K" 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 3721547F7C for ; Wed, 17 Apr 2024 21:59:34 +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=1713391176; cv=none; b=MtmvCK0bNCsvvazpPsTtVi6f+0JhHo2cPoeNg9ur69nqbQWSNroUeQLv1BJCcy+2Kb/6/BV3qrBQ6GfQNZlVteAL2I96xMh228Az+dKfDmIOeDGmSrWdOYZ8EmmfarevvjcD/40GefDOoT73Ml5VsxpZhkyepy7HOpUypS0JIjc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713391176; c=relaxed/simple; bh=qn6C4wVA3cOLV4VVI1/w/7nAgPug70X0Whx5wVdf/EM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=JB+XhWGQCCyynhVY8VYpkcIKQLSoV9klXl1g2ewsM6uSAk4wG2xZxIYcVGsgsGtpVrlRhGNZewTu4y0pJIxMW96srT+sihKrGf61OTOKw1x6zhWNuVw0mWHPZI8/1kjlu1YG9wkMBgBzvkMpyc5p/p6itbQAEJFJ3uZ3npJ0nQA= 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=mEyX9j7x; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=g0tJY04K; 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=1713391172; 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=nyuJ8mRZERV0q9WMSxzJ1SqPvH/eh2GfSaBY2YWfdjg=; b=mEyX9j7xVIJ9vqCryCfwshRlv8O9ha/ZPkIvPj5rvQYqXQ9crX2j6tjEKEOpclvcLe7xIP 6sEYsrEyiKV2ByazwZaMwKbNsmTeH9Wa2bv4crOqI/X3qUIF/lfQHA81ML+vTKq/pTRKSJ wmvSyRje9dTtQVOQ3O32gvGn/wNc+0jcYr4y/Wmm+Xc1Eu8/aF57F3f552TaOidcF3oChf yAIAjIVpN+UwEy87QpUyec0SrT3WVfjXIElWaWTWITaQduzI5Omr8WW7UcRYDWQYYBBAmR sLsUw5BGAe53YwVFGLybbha633K6FTBkROYiI1TfrOaTEIe04+qfogHkUdLwVg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1713391172; 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=nyuJ8mRZERV0q9WMSxzJ1SqPvH/eh2GfSaBY2YWfdjg=; b=g0tJY04KqAKNcNKkhm+6VF0cYnY0uNl8m+VJD3OjXThdAMnTe6x+J+QAq9UBJTD7lcO552 /h5DPkCt13MEF4Cg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH printk v4 17/27] printk: nbcon: Use nbcon consoles in console_flush_all() In-Reply-To: References: <20240402221129.2613843-1-john.ogness@linutronix.de> <20240402221129.2613843-18-john.ogness@linutronix.de> Date: Thu, 18 Apr 2024 00:05:29 +0206 Message-ID: <87sezjodku.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-04-11, Petr Mladek wrote: > console_flush_all() is called from console_unlock(). > It might be called in atomic context. But the current > owner might be theoretically scheduled out. Nice catch. This problem was introduced in this series after you pointed out that return value of nbcon_legacy_emit_next_record() did not match the semantics of console_emit_next_record(). > I see 3 possible solutions: > > 1. Enforce that nbcon context can be acquired only with preemtion > disabled. Not acceptable. > 2. Enforce that nbcon context can be acquired only with > interrupts. It would prevent deadlock when some future > code interrupt flush in NBCON_PRIO_EMERGENCY context. > And then a potential nested console_flush_all() won't be > able to takeover the interrupted NBCON_PRIO_CONTEXT > and there will be no progress. Not acceptable. > 3. console_flush_all() should ignore nbcon console when > it is not able to get the context, aka no progress. This was the previous implementation, but as you point out, it is an issue that console_flush_all() is no longer reliable. I will continue this topic by responding to your follow-up message. John