From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796054960; b=Mf9cCJq0wIbQ5nnBOH2G9ZrJv4crVt6ofz1xwwHrTZFU41tKUfVuhjStE6KQMdV6lNOX F3+vOjQCMOAZsF+oJoA67gZPA0dQfBnt552fDQt4Pfw+L7dzK/WqKw5RuEZub9xZu26+d Ryn36HwnlGFftyvzhr0c1ltjCaiHQVGo1MSxPBc9yKCgUaLlV9TfbJuWg8LubEvxTZ0iA qD83peenTf52RR3uixbfx9KQ1SfxiJFGgbJAh8QJiTzNoHbG4QhRoNgBKaLKEf8IAmYGA 4nBL2saSPc3drMcSfyE3IArgWLhY6PvXB/jI6Y/1ltep/mwZ6EKcf9eg2A9J3G/W+kA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796054960; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=FiGJSPXfOKkfMVH+ptebSBESRO+ahkfnhdnkUXjJCS0=; b=IDkHHZlxDYCDZMwEm7QRIcAqXTKLJz2BU1cjkezXKwaoDLs153m9kBmUa8ua1XtO5iGQ 6W9jC7Uk7aa9Jj4q2sYCMM96dJptw+2md9N6ukF3+7P6ul/V4Jh4FU5Zc/9H8QVoR0gyz OgeeS7cRDQiEv4ziHos7RNkYfp+49nGa02Uwb2lq8ereDRUi/j10GGnW6qKE4pap8YPNN +mCnGhhxHtU91jzn8sM68fSDtjtja2bk1oK3EsNTHSB23c9+UDRNSEV8dIFnx1cEITFnQ NTKQvfWEGNbVYGcVAQWwwfvmwKh8ctfwwOXARgorui+gm/S/m6qLMXeBeVhLQkdDlUA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oUoDpF31; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 605DD606A31C for ; Mon, 30 Nov 2026 16:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oUoDpF31 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA0C31F0089A; Mon, 30 Nov 2026 16:09:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796054959; bh=FiGJSPXfOKkfMVH+ptebSBESRO+ahkfnhdnkUXjJCS0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=oUoDpF31jKPfbfdi4Bn2CWGVxaaU7ba5uHWx4zpUDA9VSWQQnTidAV25bChYdHhiW vBODluVKVOTETqiQrRL3bAb474+iAkvqsugnpUK2ktRwLtPJjK/TmRhH0AmhEWeie3 elb+RuceZbYbkTGDSdaVpIjueyKu3Ja252xVKMUNCU67TG38l8+NW37cDoi+dQ5/KD UH/VduF3BkYDRKxrKI4qZP7LxR0DEgOCytwjK1Xh5WIgA3M6/7OSaBCbVhPGNhrRMH PtjRpboGOi6zNy8r6he8ni2LZz+9J06l8Aw82EBVh/QSbCVv7OrgrpLVBJXpCwOFqO C5xVyV7G2vWwg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] serial: core: Don't spin for nbcon ownership with the port lock held Reply-To: sashiko-reviews@lists.linux.dev To: "Eliav Farber" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261130155133.37435-1-farbere@amazon.com> References: <20261130155133.37435-1-farbere@amazon.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 16:09:19 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > 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. The context is requested at > NBCON_PRIO_NORMAL, and while another CPU is in panic that request is > always refused, so the spin never ends. >=20 > The CPU is left holding the port lock, and in the _irq and _irqsave > cases it is left 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. >=20 > Fix this by retrying with the port lock released and interrupts > restored. __uart_port_using_nbcon() is re-tested on each attempt because > the console can be unregistered while the lock is dropped. A caller that > already has interrupts disabled still spins, but no longer holds the > port lock. >=20 > This message and change were written with the help of an AI coding > assistant. I reviewed everything, corrected a few things, and tested > the result on arm64 hardware with an 8250 console. >=20 > Fixes: 4126f149c48b ("serial: core: Acquire nbcon context in port->lock w= rapper") > Cc: stable@vger.kernel.org > Signed-off-by: Eliav Farber Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130155133.3743= 5-1-farbere@amazon.com?part=3D1