From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 3746525782D for ; Mon, 15 Dec 2025 15:46:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765813568; cv=none; b=FFHRjHVydhV5Die/hwJL8Kk9l9QymfSOMg3bMcLpziEQWz+j/+USh0TZD2BfioBIiHL/Sc/7PHGDDMORHikxd/sQvXMF1kpgdUZRd9vS6zmxsZrXv68Sslb2NP7ZKglEGMmsILcJRtSYX+/bTcOkcyIxWmxDRhhyGQ6Dfd4dqCw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765813568; c=relaxed/simple; bh=o39b/jLCWo7PBl08ggd4VmwH0oWSsZCqcP+o3hMM8tk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QK5813DBp7Aqkx3Q01VvBARk2dRTbVPlGtK7hHlHAwjXTmnDE4IU87vSNFJ7v+sMb6eYh65tfC/j3+FXwqmeSLlx+P6dXk+ivmIeCQ7SFiCrDi0FAO5ip1TlPccgO7mC1exByQUXdiob6BSqwD3SK6HVTzIeoNTzABKeR9N/LoY= 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=Jl9R5hIh; arc=none smtp.client-ip=209.85.128.49 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="Jl9R5hIh" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-477563e28a3so27601935e9.1 for ; Mon, 15 Dec 2025 07:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1765813560; x=1766418360; 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=d6JfhVrsDRUYR0znw7PF2A14GrzFwlQpn8CTBMp8rN8=; b=Jl9R5hIhabLIKUZakSGhGAkPBGOLqRIWGpVGnRWqZTIA22qOpCL6EynVG8tdgHk0pw 0Y6BHh5Mll9fMsJ41NWTNoPcFuhfldt3lpIGYRlbvHhRY7nZiuM84aiglfwV92R4elu6 GsQ3QmurR2qOtu9LuMNEkxLg2vwS1wBOPR5EG4uSS1dgqO5viC9bRoG9DtwzUbSEWm+g OEQXZUjgAXIpjxMclZcPNywOVzfcYrQJkzPxt37S+z8/OpjZlJQkrVs5YmlWHEbyn+Jb Pm2K9VMVT4wAoBp7evCURgif9kLtHFKkGG+1p/PyqSahUK4mhaegnOPQzDy30Nvc2RTy TnRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765813560; x=1766418360; 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=d6JfhVrsDRUYR0znw7PF2A14GrzFwlQpn8CTBMp8rN8=; b=hEAoF1zNGfxojNLunEcOjB8AU1NQ3XE90xTcp8XvxqkJu+J+mGnKENSoNUOYq8C/Z3 ifbRTEU/KEioNt96eOX0PtIe3eFhZtQFBPQ9mIZaZIX4SA2Cef6HXNIB4rcLy66n9sx8 UXcJ/5u35PhgTobxaFmmCHnvagI0YaFi3NQgZhsYeVOcqRpzF7qByDzI4BlhqE6mp8uX /rXrd6Umh03zjie6qN6NAe35cQ6/EswWKz3wZSR2yoFOeM+luLkAfQmUze50BIH79/YT w7WuASqlniwxV6yYBo1iqg7UM0EvEfwh23DmL3ZWspocJwCwTmy9JM7fOQM9/OKI1lYE dKJw== X-Forwarded-Encrypted: i=1; AJvYcCVOriSNDC+6aV3+xnAGsru0dyscmMvxZoX/Hok/xJbJGb0oV2icWrB1nFIqeF4Z0sT9dBzGZixztE3l57M=@vger.kernel.org X-Gm-Message-State: AOJu0YxF4dOZa5gFpqn7OvRT8cEbGsgemfiAuCzIZsbNqms0XHWHtihf k2I+Y3X8wv6HQvgBmB7nFbM8iMTrceKDBgR5KSLVAifi31x35cMkSOIh3EYHJG3CDP9e34D/hXV fve/c X-Gm-Gg: AY/fxX7ExxaZCwxUFBmS3Gg81crv81zNOTmD+qs7tdMB86kgPh/DlutOAFVGbUi0GpM GYsIUyLw84Bd5jSMUOuCiS7suJLUrurnk5DqfOk2cwsQFdRl9gAZ+L04fsMGQj1IL86AcYfHQjy xL9dbBPM5i/uYdrlaAHVm5fM084UmZyBFLr5mjK8gvWnGeSek1deeLgF0m3P/Ho4wGu/e3+Ge5W 1IgGoI+/h4k1TgufIxHhkazoPNuDiZRXAevDDjOnFRvBii/gqGZtjw5KjsZ47G5uTrierTTcSUO gQCa1fqoeIvDIeWoMPTCgX8DfEF8xZvnjIb5KYCqXhZfXSUTHEuDmIhZ7wqXORV4/lgskxl0oRB ntJ79hYZ3mnH5n1BMdXREU0zpjZbJJ+hI+Qlw1MHLUZGv9XICeIW8ojCHU3IUXF01TA9jrH2HZ7 9HPkJcuakTV7gRgA== X-Google-Smtp-Source: AGHT+IEL2ySYtEiaRYvZXiXlVF7s0hOwCkdZdWshaGqSsdP2jwyOVBD8hvkUfg2yLLiKTJ9Af1DarQ== X-Received: by 2002:a05:600c:46cb:b0:471:665:e688 with SMTP id 5b1f17b1804b1-47a8f2cacf3mr128997195e9.17.1765813560470; Mon, 15 Dec 2025 07:46:00 -0800 (PST) Received: from pathway ([176.114.240.130]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a8f3a206csm69943435e9.3.2025.12.15.07.45.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Dec 2025 07:46:00 -0800 (PST) Date: Mon, 15 Dec 2025 16:45:57 +0100 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Breno Leitao , linux@armlinux.org.uk, paulmck@kernel.org, usamaarif642@gmail.com, leo.yan@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, rmikey@meta.com Subject: Re: [PATCH v2] printk/nbcon: Restore IRQ in atomic flush after each emitted record Message-ID: References: <20251212124520.244483-1-pmladek@suse.com> 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: <20251212124520.244483-1-pmladek@suse.com> On Fri 2025-12-12 13:45:20, Petr Mladek wrote: > The commit d5d399efff6577 ("printk/nbcon: Release nbcon consoles ownership > in atomic flush after each emitted record") prevented stall of a CPU > which lost nbcon console ownership because another CPU entered > an emergency flush. > > But there is still the problem that the CPU doing the emergency flush > might cause a stall on its own. > > Let's go even further and restore IRQ in the atomic flush after > each emitted record. > > It is not a complete solution. The interrupts and/or scheduling might > still be blocked when the emergency atomic flush was called with > IRQs and/or scheduling disabled. But it should remove the following > lockup: > > mlx5_core 0000:03:00.0: Shutdown was called > kvm: exiting hardware virtualization > arm-smmu-v3 arm-smmu-v3.10.auto: CMD_SYNC timeout at 0x00000103 [hwprod 0x00000104, hwcons 0x00000102] > smp: csd: Detected non-responsive CSD lock (#1) on CPU#4, waiting 5000000032 ns for CPU#00 do_nothing (kernel/smp.c:1057) > smp: csd: CSD lock (#1) unresponsive. > [...] > Call trace: > pl011_console_write_atomic (./arch/arm64/include/asm/vdso/processor.h:12 drivers/tty/serial/amba-pl011.c:2540) (P) > nbcon_emit_next_record (kernel/printk/nbcon.c:1049) > __nbcon_atomic_flush_pending_con (kernel/printk/nbcon.c:1517) > __nbcon_atomic_flush_pending.llvm.15488114865160659019 (./arch/arm64/include/asm/alternative-macros.h:254 ./arch/arm64/include/asm/cpufeature.h:808 ./arch/arm64/include/asm/irqflags.h:192 kernel/printk/nbcon.c:1562 kernel/printk/nbcon.c:1612) > nbcon_atomic_flush_pending (kernel/printk/nbcon.c:1629) > printk_kthreads_shutdown (kernel/printk/printk.c:?) > syscore_shutdown (drivers/base/syscore.c:120) > kernel_kexec (kernel/kexec_core.c:1045) > __arm64_sys_reboot (kernel/reboot.c:794 kernel/reboot.c:722 kernel/reboot.c:722) > invoke_syscall (arch/arm64/kernel/syscall.c:50) > el0_svc_common.llvm.14158405452757855239 (arch/arm64/kernel/syscall.c:?) > do_el0_svc (arch/arm64/kernel/syscall.c:152) > el0_svc (./arch/arm64/include/asm/alternative-macros.h:254 ./arch/arm64/include/asm/cpufeature.h:808 ./arch/arm64/include/asm/irqflags.h:73 arch/arm64/kernel/entry-common.c:169 arch/arm64/kernel/entry-common.c:182 arch/arm64/kernel/entry-common.c:749) > el0t_64_sync_handler (arch/arm64/kernel/entry-common.c:820) > el0t_64_sync (arch/arm64/kernel/entry.S:600) > > In this case, nbcon_atomic_flush_pending() is called from > printk_kthreads_shutdown() with IRQs and scheduling enabled. > > Note that __nbcon_atomic_flush_pending_con() is directly called also from > nbcon_device_release() where the disabled IRQs might break PREEMPT_RT > guarantees. But the atomic flush is called only in emergency or panic > situations where the latencies are irrelevant anyway. > > An ultimate solution would be a touching of watchdogs. But it would hide > all problems. Let's do it later when anyone reports a stall which does > not have a better solution. > > Closes: https://lore.kernel.org/r/sqwajvt7utnt463tzxgwu2yctyn5m6bjwrslsnupfexeml6hkd@v6sqmpbu3vvu > Tested-by: Breno Leitao > Signed-off-by: Petr Mladek JFYI, the patch has been committed into printk/linux.git, branch rework/atomic-flush-softlockup. It is fixing a real-life problem. I am going to give it few days in linux-next and crete pull request by the end of this week or at Jan 2, 2026 (before or after my Christmass vacation). Best Regards, Petr