From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 211EF142E7C for ; Mon, 6 Jan 2025 16:08:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736179700; cv=none; b=dEqiEtlCxOOcf4mzq4IF3lwrvaUAcUrplYbfJwHX9OABwEI2vLzqdLJOr3XpJLSbQnc9hrMCH87SpdlEmKPc8aF2f/BpsNyyIEL5DGI/uzvgr7lqzNlJsjqwoo3fY9dJ7yvQh4pEuTm6eB+eMFmiFlv8IuABZexea00cuX4ojGw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736179700; c=relaxed/simple; bh=HzCwECKMPbPm3yZQ+TTA8/ZnxUJavEy/mJgVrOI9A2s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GCW0BhO5YH9j6wSh3xBPdZ/X20QqhdxU+u3l2pR0FAf4jIUWodRzNM9GxHE9bbFYG8V3eni1W9iAxk3wqpQ/qFOmK1zgoPG2/AOe2bNvQkNF8mTPVFYcj2D5532u6hLHgm5LSmhR8s6VGaK9rtts80eIcvUsKv1Pzsa2AAi+WkE= 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=fQGc2QhU; arc=none smtp.client-ip=209.85.128.51 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="fQGc2QhU" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4361f65ca01so144849795e9.1 for ; Mon, 06 Jan 2025 08:08:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1736179696; x=1736784496; 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=kNx2YaBCkVTFXvj8GvoFFTeweWA/AsfbEa+1+l6TR2s=; b=fQGc2QhUwcabe1dwyzh1/nWJkw1jnS/MbeFv7uh/+jCy589ku+xVAo7fZqLd54S9xZ UVIiXKRoZk904awR5tlVD7+lubAbmUpkGxGq2VuSlcHG9IxTlraBHGBxIkmsmCaG9GF5 3sCtc0Txo4MOGeqr0Fh5rQn1CpOUorxo+nmdt+obep/uMeFdQg+RiFzMBN2knwZNyJbK LRR5Qsa5nYqmWGMi2AcnALXjchV/ZIvtm0UTwtuJtoJ77pTMNJ8wyIERPQNVM2X4DXg0 B5G0jIHBxrmFPoYdvAWGCo2OIsFVhTElLm+ABiI1eWHDVQM3oTpdrvK+pYorpZEUq7dK 004g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736179696; x=1736784496; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=kNx2YaBCkVTFXvj8GvoFFTeweWA/AsfbEa+1+l6TR2s=; b=l+3PKJFmaNjZD41Yjq17jx7wxIiKK9TtTIql6z0g9Tajw3DRwYkPEqmsvPBkzu5wWA xCdrW7h1OVd1193Dn18n8J2JU3HjsOgUkXZVlXvi18UrR9ymIlwKhXR9GkZlN9OCdRWT JO+C1MsgFxtrR0CoVSukSJZZa/wudFrAS48l3RHFfasudfBOdXZ4ceTpBqqUiVtFbbJX NoxOR+x3Hf9oVRPPGsbGnKj+iICS1lMiIPXsZp/g8yDGPof/G+kDztTaGKXf3XBuPqF1 hdGmWIbeRRl+3d/kUzWPTudJPseDZg5uLw7gq0gDiCf0yIBvZXh1fRNexqTUiKlL/KRQ TGog== X-Forwarded-Encrypted: i=1; AJvYcCXm4fI5KC85VQqKb4l7fJVMDxEK174rLVLh0vdZA1Cn0YRTMWh4g69GkxJmKW0gI9hzSvK9VygP7pXLIqE=@vger.kernel.org X-Gm-Message-State: AOJu0YxTZH9kw8NfLjZXp5ph3oVHB54/oUY4Hu7ifUHLitaIbQ35OiWi WeJ5TyfDcFQMzNT7jIaCtBk5VYAJobm/4BwRVPvJ++gBKKhp9Ee6JmA6kb9nn7g= X-Gm-Gg: ASbGnct9EMGYcAHue6b0sTcApmKysFc+8EJKqcH5hhwxxJbQk0hJ3Qoup1z7w/lY9Gx xsJJQWCzHYcGNMulBTIYgrkjZDT7ec96f69IZqKzaMw4HfRDaAr8fUq19vPUoXdj6nEQbOZnEeW /8k+9wXF2Ku68+3VJCQDhLv3KbECn4WpmhjYKUR64/ViHeI6Fwuo1XVabY8Q5n9woGnlaOnhfLP 6u/gnCdxr11BDaNmkOMunnXrPzVGj5/YXlwGM0AJZ6PTVB+dhqzsgGjJw== X-Google-Smtp-Source: AGHT+IHIJLNV7U4yP8Zx4j4ON92Jhq2nTGr+leOp6meyU6yQ2fuUJjgEX2zs5siU/2wF61oWKK8bwQ== X-Received: by 2002:a05:600c:1d2a:b0:435:330d:de86 with SMTP id 5b1f17b1804b1-4366790d3c0mr554899015e9.0.1736179696410; Mon, 06 Jan 2025 08:08:16 -0800 (PST) Received: from pathway.suse.cz ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4364b053e91sm634449185e9.1.2025.01.06.08.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 08:08:16 -0800 (PST) Date: Mon, 6 Jan 2025 17:08:13 +0100 From: Petr Mladek To: John Ogness Cc: Greg Kroah-Hartman , Jiri Slaby , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Esben Haabendal , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko , Matt Turner , Tony Lindgren , Arnd Bergmann , Niklas Schnelle , Serge Semin Subject: Re: [PATCH tty-next v4 5/6] serial: 8250: Switch to nbcon console Message-ID: References: <20241227224523.28131-1-john.ogness@linutronix.de> <20241227224523.28131-6-john.ogness@linutronix.de> <84h66exeka.fsf@jogness.linutronix.de> 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: <84h66exeka.fsf@jogness.linutronix.de> On Sun 2025-01-05 02:03:41, John Ogness wrote: > On 2025-01-03, Petr Mladek wrote: > >> --- a/drivers/tty/serial/8250/8250_port.c > >> +++ b/drivers/tty/serial/8250/8250_port.c > >> @@ -1406,9 +1416,6 @@ void serial8250_em485_stop_tx(struct uart_8250_port *p, bool toggle_ier) > >> { > >> unsigned char mcr = serial8250_in_MCR(p); > >> > >> - /* Port locked to synchronize UART_IER access against the console. */ > >> - lockdep_assert_held_once(&p->port.lock); > > > > We should explain why it is OK to move the assert. > > > > IMHO, most poeple would not understand the port lock is needed only > > for UART_IER manipulation and not for UART_MCR manipulation. > > > > We should probably explain that even the UART_MCR manipulation > > is synchronized either by the port lock or by nbcon context > > ownership. Where the nbcon context owner ship actually provides > > synchronization against the port lock in all situations > > except for the final unsafe flush in panic(). > > Correct, although the "except for the final unsafe flush in panic()" is > the reason that even an nbcon context ownership assert could not be used > here. Good point. Well, lockdep should be disabled by debug_locks_off() before nbcon_atomic_flush_unsafe() is called. I hope that we could keep the assert. > > A comment might be enough. > > OK. I will extend the comment at the new lockdep_assert site explaining > why the port lock is only guaranteed to be held for the toggle_ier==true > situation. Thanks. > >> + bool console_line_ended; /* line fully output */ > > > > I wonder if the following is better: > > > > bool console_line_ended; /* finished writing full line */ > > I would prefer to make it more technically exact. It would require a > multi-line comment and this header uses 2 different styles for > multi-line field comments. > > How about: > > /* > * Track when a console line has been fully written to the > * hardware, i.e. true when the most recent byte written by > * the console to UART_TX was '\n'. > */ > bool console_line_ended; Looks good to me. Best Regards, Petr