Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp25048lqb; Thu, 14 Mar 2024 04:38:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmy/iuY+SRqjFwiVlPpgKYBXWaO98buEVqvNCoptZlusz4TC3mwXGSFd7c6PsGzflPZqWzKCMFnhmZuyASZKxyedt6eVUYyhTX/dTsZw== X-Google-Smtp-Source: AGHT+IE9/s9LGXAbIhc3oIiovEOZcXk3Fma3XkOSPRPpyEHHUV6GROBVMsXVDGOrCZ0hXNws+Gss X-Received: by 2002:a05:6a00:1883:b0:6e6:269d:1a38 with SMTP id x3-20020a056a00188300b006e6269d1a38mr1538788pfh.25.1710416287749; Thu, 14 Mar 2024 04:38:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710416287; cv=pass; d=google.com; s=arc-20160816; b=oy3hQcJufllROHRAZPHIwdNU5LCmBzl80jG/0ZaZffr7iCpoNZaciENhzeEUd2eJl6 wLh2Mg6KUrjNAbKtWcPrhGjMesdTEG/xDCWQ4D8ujRn8PprdAhzeM7lYPwPy3B2OrZne /kQ+leCOmQt1G85rUrVBwzIl8zqW8RMrRH3jC96Kn+Bj8GiSMhcjiFlFal5Yn2OeLgUw Hk2DvPBDWJbcj+cxnpNe1Jo+aipoFqsREvX4MPECFKQrbx96Hfa7I9/71kYIkLTbfIVa 4lS6CM9g6vmuXwUsCizzYUmhEwvRJDCRcaESizKkpa+7BWSk5Ac0xgE4ithLkZSIfLXF 5DFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=/ilylSZ4fB6JbX0i94fDbr4TmqyjCjG1jilSqcfHbcc=; fh=LiLYlMa6KZWJUENf24gKOlwrbTBodCmk+bKrfztZPYA=; b=phojlEMKkFDzGZPlygzEuFgD3g+rnYesUD3lltb1wCF9lYtfTtF4Ot9FawBED2+38d AQEBiWefOVkyr9PpWGUkZe+rbchrz1heuvgm0rj8IEmJayf7UWdeM2xJbSUyTE78gtnV JDc41uKYUKQJO4f8GpWjLjv3suBoYMLgnWxh3L9ggByT/UwDsN/3dVNeiWlHdf1brQor XA90Tkz8M2vgYUxg/3/kRNJmww13w7DyeaQSnJnPMVfmPds9mlSlAbpTtY2dHfPp0G+3 uUSFyWJsV65lKrXytd29avUpRfGwmmz13mezwDoYISL/jD50GdCeXeGduA1qS5TWmD7L Qp7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RGzdHmjQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-103183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c7-20020a62e807000000b006e64772d362si1249438pfi.399.2024.03.14.04.38.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Mar 2024 04:38:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-103183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RGzdHmjQ; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-103183-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-103183-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 11AEDB23AFD for ; Thu, 14 Mar 2024 11:38:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF8BD6EB6E; Thu, 14 Mar 2024 11:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RGzdHmjQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JePSg32f" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96ED06E616; Thu, 14 Mar 2024 11:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710416274; cv=none; b=Q5UMlbgBI6j8Sne1XA4gdI7UwwKxhdoqysnWxu2j36PcPOsHslQAQJUx7GXitciK1Yiyoriz5rW7b6lv8U9T273WzJR/gbMftS+MqleA1Mho7ae/MFwKRbHkG31ba1Cbcahs5a2MdfsnbMkpWbvn9xZ3m4UpETknxi2FIjfiJzo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710416274; c=relaxed/simple; bh=49HK3jmXBhAvpfLxYxAAHhwX8AvYNeMI2CAUOSp4u6Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Dz/Pl+T+FQmVgYlrMugPbPN5J8CT8GM00dyvDkOtOZuPm66Ug5f2E29ZTK97qFtoutywR5aaV5EIPYCZjvggpnSGVTP2JlW/VXbW8IjkO2+lN9sof79B8AbNFg6Omeg0veV7klxxfYN312HMekrtpdMLN3IfYz9/xcBjnzXYX54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RGzdHmjQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JePSg32f; arc=none smtp.client-ip=193.142.43.55 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 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1710416270; 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=/ilylSZ4fB6JbX0i94fDbr4TmqyjCjG1jilSqcfHbcc=; b=RGzdHmjQRGnzAWmaXfQfjVaozUvcqZ8rs6iSNVxuMBLOqYa4VfSCtNc7hVshbOaIhDlqmm cpTtji10VTokmafOD1LWNJ1efu+Acf9mdvlepRaezomP8elp5zsv3Aam+cyYHnP9Opzqi6 sGNoz6qJKe51m/dMCSiBgdT5SPGO0d99jnqG5DwDF0CUMSy0ZHfQ2CIh3h27M0ZhZ6TXl5 pKYwyRW3c2Jxg/5Qbw3LwRNPSW0esRHsJWn10iIUhc5fEN9BaXYvB5lR+l1DbtYVNLvrCm Wfdziw8NeYwvFcy6LIL39yb6AO6+BpoP/JvdzXWssVEE7tSQ1PCHtclkGqNjPQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1710416270; 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=/ilylSZ4fB6JbX0i94fDbr4TmqyjCjG1jilSqcfHbcc=; b=JePSg32fc3LNu7eI5M8ldwg78TRdVRezHPo24DcdksAkkrqWQFtBr8sQMCrXPrL9TWhumP T3mMALUz6SZkU6CQ== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Jiri Slaby , Ilpo =?utf-8?Q?J=C3=A4rvinen?= , Andy Shevchenko , Tony Lindgren , Geert Uytterhoeven , Justin Chen , Jiaqing Zhao , linux-serial@vger.kernel.org Subject: Re: [PATCH printk v2 08/26] printk: nbcon: Implement processing in port->lock wrapper In-Reply-To: <87le6oy9vg.fsf@jogness.linutronix.de> References: <87le6oy9vg.fsf@jogness.linutronix.de> Date: Thu, 14 Mar 2024 12:43:06 +0106 Message-ID: <87zfv1kpst.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 On 2024-03-11, John Ogness wrote: >>> + if (!uart_is_nbcon(up)) >>> + return; >>> + >>> + WARN_ON_ONCE(up->nbcon_locked_port); >>> + >>> + do { >>> + do { >>> + memset(&ctxt, 0, sizeof(ctxt)); >>> + ctxt.console = con; >>> + ctxt.prio = NBCON_PRIO_NORMAL; >>> + } while (!nbcon_context_try_acquire(&ctxt)); >>> + >>> + } while (!nbcon_context_enter_unsafe(&ctxt)); >>> + >>> + up->nbcon_locked_port = true; >>> +} >>> +EXPORT_SYMBOL_GPL(uart_nbcon_acquire); >> >> I would prefer to split the uart and nbcon specific code, for >> example: > > Can you explain why? This code will not be used anywhere else. No need to respond to this point. The v3 will be quite different here, but will follow your suggestion. I am splitting the uart-specific code into serial_core.h and calling a generic nbcon function for the nbcon locking. John