From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=193.142.43.55 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796201731; b=ha2xDHTqOcJXeHl+3UeP6FlI8JwOox3oJKltvjFPnf+6UwoOZExR+DM5Sqg4k9wDmGDz Aht7hn+UhJ1Ysrq1MPNWwSSe8kUq2ryBws2CibxYUUE+coirlCpVX3vvlxYiq7OdFjz6I 14SmdPjw31kuf+3qi7c5hMUpgLBZhjF+XefIJ2Ic/bXUIliGIim33Bk6zHRQp/Lf153Z4 Fp7okqLbfO0AvIXNkZuU+PPxfuqMdGbb2ROexOTa2Hfl3SxRve8D/IlvKEiEGfL6t/5k6 o9nZCmFTdnPVew9PsnmdaA0hCZxk9yCd1yGGsb5PfhrjdvgV6zpasF6McjSHGBAbaDA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796201731; h=DMARC-Filter:From:DKIM-Signature:DKIM-Signature:To:Cc:Subject: In-Reply-To:References:Date:Message-ID:MIME-Version:Content-Type; bh=KfEjBSLrHZk5YnPFbYLz9ekAIpKFrK6m37WqDoxjkKw=; b=hORCBFX828TXCKrNCr8KoPIw9XlIXZ/sZr1omJQ4EW2wTfwcLZgEEnRIu2S7G3EusN1l oRYVO44UGk1dpprtN9Gn96pyPb0IGcyI1IAa4MW+Jk8erphcZXw37WfhC3u1J1ZNANb+c dHg91D+Do0GA1xKTE4B7lLI4pCOuVgT1bZg4gDYczibm/wellKzTn+XNbrziGTSxZC7eb oFn1U0rvM7dHJj7+0+AS9MhbdIPBRJ3vOorhZEZfhW0RHbWynfKLA6PnsZfX5OnjvXOBC aFVcZxszIhs8askOd05NSWn5r1Bh+l6bRn1YimpITONozAeJt3+pbNrCYAVKzIdQccA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=DWFjgD53; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=aB4cpqEr; arc=none smtp.remote-ip=193.142.43.55 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D5B8606A339; Wed, 2 Dec 2026 08:55:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4D5B8606A339 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.a=rsa-sha256 header.s=2020 header.b=DWFjgD53; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=aB4cpqEr From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1796201729; 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=KfEjBSLrHZk5YnPFbYLz9ekAIpKFrK6m37WqDoxjkKw=; b=DWFjgD53B7489cJSQercgxfFOTt+xhQX+qM/9C2SH5VGxTLVCrnUgKL9Y5Ya0dk/yYlHR5 PmRmZmIaIOIaLRhf/L8r6fbKwwTXgrObErczgImTNfbaQz2xv3NqN3lFw7EAIHkuNtdLUx d1ABSqnhpKrSqzwdVcyVrCiEQtCM3Ek6bKIlr5I1yMw6pw+8feUJi+HTZXJDGK4vM4VZG/ UW1t1VE52v+0KW8DDT3it2uSaVmtoTBDlRA+aLryaYVS6WXyZ/AjP2ivBDKC+NzZgqQ1sN 5Hz5m6qRffuucVY9zOFRp77iU4UXSSqBM0dSWa7XrXfHZv+fpaHXUxjWKW25Lg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1796201729; 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=KfEjBSLrHZk5YnPFbYLz9ekAIpKFrK6m37WqDoxjkKw=; b=aB4cpqErlAbEQiXjWV4Ue88lTcew/oM8mKBfecH+uwfSzNhG9T2yRxd67t4fVZWSZHT2ZK 06FbyZJXO5lpl+CQ== To: "Farber, Eliav" , Greg Kroah-Hartman , Jiri Slaby Cc: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , "printk@lists.linux.dev" , "linux-serial@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] serial: core: Don't spin for nbcon ownership with the port lock held In-Reply-To: References: <20261130155133.37435-1-farbere@amazon.com> <87zeuq1b6j.fsf@jogness.linutronix.de> <20261201145819.10941-1-farbere@amazon.com> <87ld696k2d.fsf@jogness.linutronix.de> Date: Wed, 02 Dec 2026 10:01:28 +0106 Message-ID: <87v75coydb.fsf@jogness.linutronix.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain On 2026-12-02, "Farber, Eliav" wrote: > Would you like me to send a v2 that fixes the commit log per your > comments, with your Reviewed-by added? The diff is identical to v1. I do not think it is strictly necessary. > uart_port_lock() and its variants take the port lock and then spin until > they own the nbcon console context, which synchronizes port->lock users > against the write_atomic() callback. During a panic on another CPU the > only acquire still allowed is a reacquire by the context that lost > ownership, see commit 571c1ea91a73 ("printk: nbcon: Allow reacquire > during panic"). The wrapper's acquire is not one, so it is always > refused and the spin never ends. > > A panic on another CPU only has to land between taking the port lock and > acquiring ownership. The CPU is then left holding the port lock, and in > the _irq and _irqsave cases with interrupts disabled, so it stops > answering the stop IPI from panic(). Triggering a panic from a shell on > the serial console reproduces this: a CPU enters the wrapper while the > tty is transmitting and never leaves it. On an 8250 console the panic > output slows to tens of milliseconds per character and never reaches the > reboot. This commit message provides more context, so I certainly am not against you posting a v2 with the updated message and my tag. John