From nobody Tue Dec 2 01:28:37 2025 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 85067340D9A for ; Fri, 21 Nov 2025 10:21:23 +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=1763720485; cv=none; b=ogGq7AElwU9Fdq6cL3IbG3Whcs8/tW9k3S8CkGKhE2HxELrXcFduL46lTUVHX9u6MK9lrv7wgVZIzdOaq1OVH9yUT9sAIq4IGFS5yy+332ujv9SkrSCTUF0k1Fp/iB/nG3UXEXtez24uiMtam4QZX5OPcg0M9B3BejNxnh076TM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763720485; c=relaxed/simple; bh=tNfIHi0Y+GGnOQ1ooZQr6v/QcSmj2cjDJNdVE9b037U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=oGUCEMrF7kKLkqlsKq0CM7fXw7seBBokTT/g1LbiSoqHp3Mv05nYRaQWMsb05eWvDWca1oqaBH7q+Da+6UYtElSKkJN1f4o8yCvBg0ls0AAPt2JoxJHgotQmOwKXqRWp+RkqKn3umdOOM62ez0dqGIl7IEDXN8fhjhjeMuLjVwU= 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=KA9Yv9k8; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=EYfqmwp7; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="KA9Yv9k8"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="EYfqmwp7" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1763720481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=b1LxHe1ZOh/ehbfxEnUMrSDhwOUrt6+cCceuBnycWeM=; b=KA9Yv9k8C8nWu/TyzATJGI+1TCBX3mwAdM1XfDqkDW7QbrvMAydO07FSZJBtHe1Qp79DBk pLG48FZYQVBa0BE41k8w5VI0hwCyZPVPFj1VNE0/WhQv4rvU0Q/0PqRb3FwjZPZVKjSfUj atd4vaFM5CMyjlAoOCb6n7+WYRq7OHLHdkMsg4YLWsm57rIM6Z7MAZLQSmhB+F9k//9SaS mn6n1piGv0ry+21GjOSh1jpSDklkl3+Itxo64++adPg2dfa3IqeEHuS3UF6dpA+EjpgDUH VbGq0TTLBlBZlT1LPYodVz1d7C1TVMFqyH5w4S2gmVStWjycdmU2rcHoJXya4g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1763720481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=b1LxHe1ZOh/ehbfxEnUMrSDhwOUrt6+cCceuBnycWeM=; b=EYfqmwp7WgVxjWWzUAmUP3XzRmChwxZjGRlq7n2ciBAu8H+F6ytXKXVjLrnoS+uAvGkQ5C TdnYeo4e8gQcuVCw== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Sherry Sun , Jacky Bai , Jon Hunter , Thierry Reding , Derek Barbosa , linux-kernel@vger.kernel.org Subject: [PATCH printk v1] printk: Avoid irq_work for printk_deferred() on suspend Date: Fri, 21 Nov 2025 11:26:00 +0106 Message-ID: <20251121102010.359369-1-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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With commit ("printk: Avoid scheduling irq_work on suspend") the implementation of printk_get_console_flush_type() was modified to avoid offloading when irq_work should be blocked during suspend. Since printk uses the returned flush type to determine what flushing methods are used, this was thought to be sufficient for avoiding irq_work usage during the suspend phase. However, vprintk_emit() implements a hack to support printk_deferred(). In this hack, the returned flush type is adjusted to make sure no legacy direct printing occurs when printk_deferred() was used. Because of this hack, the legacy offloading flushing method can still be used, causing irq_work to be queued when it should not be. Adjust the vprintk_emit() hack to also consider @console_irqwork_blocked so that legacy offloading will not be chosen when irq_work should be blocked. Link: https://lore.kernel.org/lkml/87fra90xv4.fsf@jogness.linutronix.de Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- kernel/printk/printk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index b1c0d35cf3caa..c27fc7fc64eb5 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -2393,7 +2393,7 @@ asmlinkage int vprintk_emit(int facility, int level, /* If called from the scheduler, we can not call up(). */ if (level =3D=3D LOGLEVEL_SCHED) { level =3D LOGLEVEL_DEFAULT; - ft.legacy_offload |=3D ft.legacy_direct; + ft.legacy_offload |=3D ft.legacy_direct && !console_irqwork_blocked; ft.legacy_direct =3D false; } =20 base-commit: 26873e3e7f0cb26c45e6ad63656f9fe36b2aa31b --=20 2.47.3