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=1796142573; b=iJX2DJGiI1sZsaFGNYRv9327X0wnLLZOB2/cQRup+8tOxB5XP169hcawQDhOTAwzpLfc FHXPfjJibMbZxggILzXDbBdPOV25biBlIwT61jTWqcHzfP0twPfpdWcj/Qotwq7RJKKAN lXZSi4OFAchmJintIML1/InZgkbW11KgpbCrtwJH7sgrVphU1fIciCJ4wMzG3uvhYlkiz lVhM/EYmMwfS1D7/Gv5bgcaHKodCQ9mQRAXJQlm5QUbO1c9dqbJiFoP2dtXHnCGnkP+c6 IcvRaWNXJgBIAUs0xLbwNVaxNaMrRjV3gGcEzC6MHnddRXh3qP+XT+U/Cwv+b92nqxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796142573; h=DMARC-Filter:From:DKIM-Signature:DKIM-Signature:To:Cc:Subject: In-Reply-To:References:Date:Message-ID:MIME-Version:Content-Type; bh=oV+1bw/lXG7Bp90tJ84RY/nynfSgqRfwmQ3TEXG118k=; b=Wh6wKXy+mvIpgFQtX06uM8U11NqgPls0r73CMqoEr/YkdsZjPqY1hxD7urVVUH8ZlWDQ cXU4go5yjEtGokfMhKfFKFW89ISzXP3iEMR0y0+PfEZgBpoE5VSZlq33yMSXFvlbUfA55 diZ78SvtuLs+2hVU4qfX3Zg6UAo93hRfacwn+jFgK5VzrbQgWU9hmvoE2HYY282dbddDw 10Kbhx6vQo4VRVTkXVljdCv0vu4zqDnc4cpTHkSRhnRWMqso5O/wHQ/qa3CO1gdyUHkoO Th0d+7otORXtYb7xJHoMDbyTPE2DduVpN6xoucP8bPmVwpS5FoCbkc8fSdbJT6IWcyw== 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=vODsrM5B; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=lumueO1M; 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 F15A0606A338; Tue, 1 Dec 2026 16:29:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F15A0606A338 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=vODsrM5B; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=lumueO1M From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1796142570; 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=oV+1bw/lXG7Bp90tJ84RY/nynfSgqRfwmQ3TEXG118k=; b=vODsrM5Bs+LbijEcvEl5MOT1/i9GXb2luL3WRO4TV+HnXAVVWmQJtKu42JIZoRKu0LpqJA 7Nt5RF+IkoWSyHdCQggQky71d4/HaacCuFwHrD3QjwsqM5zTblDC/2/PLzCTSBxXFtvqm1 ku2Ukp3QOVbLS03Wovy1iuTW5orMEPSHZDyHmYq5x2tczf68LPnwhji1mexPWErborXh2q sQZvKFM0MULpjmdsRhW0oKpX4+5J77GHMUGCgXc3O1/XfnIOvEXH7r0CzErwWj3LJR93Jp wiQgZ0dCRyFVrdp+BBADJbiQeAqvS8KlGYUBtdEchXd6nHhLHFXcpunG7CjJog== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1796142570; 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=oV+1bw/lXG7Bp90tJ84RY/nynfSgqRfwmQ3TEXG118k=; b=lumueO1MLRHyvqaH021bbsDrZbRxckXNI/2tW6YYnqIOIn9JAtxpeJveuSdc5Lxdt43t6U 5So94qXIlRnHSUCg== To: Eliav Farber , 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, Eliav Farber Subject: Re: [PATCH] serial: core: Don't spin for nbcon ownership with the port lock held In-Reply-To: <20261201145819.10941-1-farbere@amazon.com> References: <20261130155133.37435-1-farbere@amazon.com> <87zeuq1b6j.fsf@jogness.linutronix.de> <20261201145819.10941-1-farbere@amazon.com> Date: Tue, 01 Dec 2026 17:35:30 +0106 Message-ID: <87ld696k2d.fsf@jogness.linutronix.de> X-Mailing-List: linux-serial@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-01, Eliav Farber wrote: > If you want the trylock wrappers reused anyway, this keeps the assert > valid and leaves the normal path on spin_lock(): > > static inline void uart_port_lock(struct uart_port *up) > { > spin_lock(&up->lock); > if (__uart_port_nbcon_try_acquire(up)) > return; > spin_unlock(&up->lock); > > while (!uart_port_trylock(up)) > cpu_relax(); > } > > Which one do you want in v2? Thanks for working out the details. My suggestion was a really bad one. We do not want to convert spinlocks into busy-wait trylocks, even for the nbcon case. Your original version looks good. Sorry for the noise. Reviewed-by: John Ogness