From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (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 0E14C32A3F9 for ; Fri, 14 Nov 2025 14:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763132131; cv=none; b=Q15KrSvIBKsFb+i2cMiy3FTMxvqN2ruBfDMKYJiu1rexX6VFrsjjSTpBbTJ7H/3ynBGpXbhe3z9pvvgX0kAzIG67LPlH0kkeQ1l7flyl8/gL7lnx6gsXa+Ai+gJfIj0Ym0vhOtSvek6WNjhqh8YCcv6szyBACIp+Hdvm2aSz9OY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763132131; c=relaxed/simple; bh=2Khq+clUZPAnTgX8+cOpXF7s2qoRd84f1QccmectT60=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eLsoaIQ/Js9olZdSPfCgmeh4GDLyR4Iumo9fxW72Y9jl6sfVo+Os0qBYzPNLmXQHxZpzxKZEBDjdsA30uHukrI0dzPVfdmJ/o/6LAW1+PmJ54irfGEoiNEzfaAmGOp8Yk+IFGv19RoxkapxaBcDfdmby7h8z4+lw5bD8602Us84= 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=gJYfOWMW; arc=none smtp.client-ip=209.85.218.51 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="gJYfOWMW" Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-b713c7096f9so263009466b.3 for ; Fri, 14 Nov 2025 06:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1763132126; x=1763736926; 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=HDzBp/INwp+nibTWfFPJwgjZkiTPte/DobTvzSfhc24=; b=gJYfOWMW/a2/mvzhAdwixNybVhMDLe8ppWD9QSzWdX2ecxR5sDO652vNNywaVfNuEz DmyKdMEna1IbULw+D6Ooo+4mEeSEpeBHi1aaXhm2E/w7IaDY8iBfdQxosMxFdPETd1VE C3RjFx4GSX7Afuai8ae7HgliGZhQesFEdGCuCMFB0sdbfdYCME8CAlGGigkzZAiH0bmK YQ+sW5SN0+eJ3NwMBKXa053PTj/753LAK0hk9oTpQN23/lSzfkXgGqFXyIRyQYYT3cma ovPhvKf4HxKVIk3tZDwF+HADGJZ4flS/n48Z+w4ENrhF+EJVRzSKSaJ03/pWuaDQPY8g Yhwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763132126; x=1763736926; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HDzBp/INwp+nibTWfFPJwgjZkiTPte/DobTvzSfhc24=; b=LqxTzGudcqQEYvtT96NGbalYrR+UFnWvAIfDzNhqL3AW+xjuLG62Y05AS5PKoPxiX9 Swa/fzZNfBW7WOpz0wAvlmFqiAnPv0tw68vg/ZHvX7wV9os7sJ6po7ZNVxfuWx5CfYM9 oZHW1ZjnAvCHLfPuk8Mpmih84QdfGsfmoBre8KAg24kiDHwg4jSSqueQC1oKlBVd1ID0 JOxvVcD7j+/uwiyszg2/Fe2v7wFFlUyzQ1vBJbSXXSdFEwmAMfKYtUwSq0OBBlMYscO3 WcLpxwv2z60GaiEVUDv9amsAab3ryZuA5TJ3F5xjYqC85FO8KyEJboc8vtoYX7Q9vdoo DTVA== X-Forwarded-Encrypted: i=1; AJvYcCUDbTb2wtT54SrYEW9q3O+PSDETs9VdMG211DDRsoJ8FVnwYsDYIVDMX4W3iJNMk8hu1dMUelwbq2dgvEI=@vger.kernel.org X-Gm-Message-State: AOJu0Yyg6SViR/eoNmW/ZFEiV0RAEeWzCqTlEhzFLPS00R+B9JekwDAR PRCnw7eneA2FiQbTXkgdtLG+AbnbflH7b6zWecihlqQDKestC/fkumNB71eHtcS/QZcAEoNsAyE hNohh X-Gm-Gg: ASbGncvJOtkwxJ1N500ni4IWJJuFdRfjsiSsq9cEMdhZweHpbbZ5UuvXV2EZEt4CMcL kKh1RlOsIM1OtKQT+43Tw2v8Up8VDX1jM0KK6YpEQuJ0S1O4O+9gUSJtFac+bYDHsyc5bhKvJKz DECfUREuj1NKHLIQZPW1Hr3b0EZmErO1+blUcBpfCik+tI1Bl9FZPIMRu1cRBXI3AhoKBlH5ixz NXCisc913YsoUIbmS0sE1nUbJoLFZZqwwIODEw7w3gNd/x2alk5OAbQ+iQb9Rkjw7+V8wfocbc/ QXmEeEhGJhqJ3vCUvn31PAdqMcb1yLUpLz02bZZDa0zPESLkTN1t2ESqt8sn1+7QDq3N92e9Lbu Xua+5Ax3h6UkAL8IxI2KmIn5lcGt+Gr2qRBATP8snMlUCOJiMrsTEA8OSq4gDtiMKxSRVellVcf K1XnU= X-Google-Smtp-Source: AGHT+IF+i2WhjuFis09P1HmbNsLUwVUwMcIFjOCk5FIhnMXjfFaPahdHVqojAAaz8G1W/NE/AKf0zg== X-Received: by 2002:a17:906:c10b:b0:b3b:5fe6:577a with SMTP id a640c23a62f3a-b73677ece6fmr307763166b.8.1763132126316; Fri, 14 Nov 2025 06:55:26 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6433a3f8767sm3899788a12.9.2025.11.14.06.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Nov 2025 06:55:25 -0800 (PST) Date: Fri, 14 Nov 2025 15:55:24 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Sherry Sun , Jacky Bai , Jon Hunter , Thierry Reding , Derek Barbosa , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH printk v2 2/2] printk: Avoid scheduling irq_work on suspend Message-ID: References: <20251113160351.113031-1-john.ogness@linutronix.de> <20251113160351.113031-3-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: <20251113160351.113031-3-john.ogness@linutronix.de> On Thu 2025-11-13 17:09:48, John Ogness wrote: > Allowing irq_work to be scheduled while trying to suspend has shown > to cause problems as some architectures interpret the pending > interrupts as a reason to not suspend. This became a problem for > printk() with the introduction of NBCON consoles. With every > printk() call, NBCON console printing kthreads are woken by queueing > irq_work. This means that irq_work continues to be queued due to > printk() calls late in the suspend procedure. > > Avoid this problem by preventing printk() from queueing irq_work > once console suspending has begun. This applies to triggering NBCON > and legacy deferred printing as well as klogd waiters. > > Since triggering of NBCON threaded printing relies on irq_work, the > pr_flush() within console_suspend_all() is used to perform the final > flushing before suspending consoles and blocking irq_work queueing. > NBCON consoles that are not suspended (due to the usage of the > "no_console_suspend" boot argument) transition to atomic flushing. > > Introduce a new global variable @console_irqwork_blocked to flag > when irq_work queueing is to be avoided. The flag is used by > printk_get_console_flush_type() to avoid allowing deferred printing > and switch NBCON consoles to atomic flushing. It is also used by > vprintk_emit() to avoid klogd waking. > > Add WARN_ON_ONCE(console_irqwork_blocked) to the irq_work queuing > functions to catch any code that attempts to queue printk irq_work > during the suspending/resuming procedure. > > Cc: # 6.13.x because no drivers in 6.12.x > Fixes: 6b93bb41f6ea ("printk: Add non-BKL (nbcon) console basic infrastructure") > Closes: https://lore.kernel.org/lkml/DB9PR04MB8429E7DDF2D93C2695DE401D92C4A@DB9PR04MB8429.eurprd04.prod.outlook.com > Signed-off-by: John Ogness The changes look goot to me: Reviewed-by: Petr Mladek Best Regards, Petr