Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp275683rdb; Mon, 22 Jan 2024 21:41:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfRGMq9WsuDpXS8K+mc7W925GaDGIVKqL0Vg6D0JW6tCirl8Qq0g20yDGeXe9qOas0omxi X-Received: by 2002:a17:906:2b54:b0:a30:9854:7d10 with SMTP id b20-20020a1709062b5400b00a3098547d10mr441993ejg.66.1705988511622; Mon, 22 Jan 2024 21:41:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705988511; cv=pass; d=google.com; s=arc-20160816; b=myF9znDaLfj++74KLs2etbFNVKAWKGCn22D3J1tc9mzuQU+PYGORa5p2AMZD6t6wpU QpZP4aExh3Yp+O4Eqe1FyLDQgOiB2UVdJX3UQYr+hpivxTBTzroclAWibB2G4Hjd1C4J 5pCl4NgeNcEljwTTvE6OWSjirEftEK5lfGosjBhUan1Lj8tvWTOhJzdZMz9FTigQLC5/ pFxgkSvLKUH0rbqEBbLoMCPw1/cgvEI9DaPVoj25TyTP+DkMnL00fYN20GL4wARV+QDq OWpUNHhUkP/mi/v1wFtfb9eT0sVu4u6Y4XKxHuMjOw6x1yVQtXQSK/22uSf7xjydjbe9 B8SA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=XYb9NVWgkQg/qd2NKo6NwvmLgZ5sSeXdTBd2KFiD0MU=; fh=3n9yk9H0aP61VWOkjV8qJHqEh2nN7MsL3m9A3XvFOBk=; b=BsF9C9Jhtj7GJOPRLsI2+Ql7XGA/flUzTxDk6KcDy0T2AEL0Li1i5VQW6RgpW/Wp7/ 4NI7FeIy/Cy1TsH6DQ9R9MBk3G7J/yPZQWRfa7DHomxEzZ6BUvPL9M6Nf3C5DppsOoBe 6adYCQhBLR0ANs7sLNIbL4icdp4jr/HydvM/RIt94G66wgxsgYhjPPqUzwgUeGKxyjOp 0NtztE7LLNifRcIziUt59vq5sBZRfYmh+p0Q/NuzJaS8ImNa7bAi5GWmjAI1HGgO1mGq qY+xq/x0Nt7K9GkMroZRPTkXaq1F5DXH/4BCus6jkYar5gb9TSqSqFlzjsIx1oEcSqa8 59lA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IWC6hzHt; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-34730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id w1-20020a1709062f8100b00a2a73607836si10854111eji.1026.2024.01.22.21.41.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 21:41:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-34730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IWC6hzHt; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-34730-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-34730-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 0FFC21F26632 for ; Tue, 23 Jan 2024 05:41:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A21F25680; Tue, 23 Jan 2024 05:41:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IWC6hzHt" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 405734432; Tue, 23 Jan 2024 05:41:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705988462; cv=none; b=sWjU/OK6gRJ096pADm2JDTRnX4JP9kPn9iiRuvaCixe6lzyqcTkJ92XVMOiMBIcufp0BTtkp2uIS4l4umePLOgXwpGv6S2nl2uSwrSp40AhYI5ZrnFZW+y4M3lbiSNoDYvGWc4uLerBm9v7ycMsBT8uRk7+XXkV6is1T+4c5kI0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705988462; c=relaxed/simple; bh=gdiyFjvMqWMG/af6i2COjazfjxZBQgaYcm1PP8azrvk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ABGPyMgZ1wyz0rPGM+d7sU6mGrzXiqX3jWBxw44D+UtsJpFIuHeddD5mmnCLInLIReRA5lXgREJUajC+BMnvmLGCDU8vfX+KEo7XhoECGP4CvtWn/0AT5UQZmrsXLiVkNDjmXsJYSVWKY3x3BXpXeDvHqETc/iGQKKxbqAqJDQg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IWC6hzHt; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705988462; x=1737524462; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=gdiyFjvMqWMG/af6i2COjazfjxZBQgaYcm1PP8azrvk=; b=IWC6hzHt+hGgDxM8mnhmOKjK757opWdvGQIPrJ3S1sCrDPlWBKRCNmyI WkGNJg1nbwrHGt0hybHhtSNKtWLhEcm1GOdFE6qIUV5EwZNj3Q1o5BAt9 FWKtG/ludALKUDMf4YAMM+By83qOCitlD3yGyrrHi9ZzIdJprr8XHxyXa npxwAFEokZiWIetHfUHRqzC54fEfMtHWKtt/xQ21kPIr/6WZX6hvgJ4WN 6CCgWYvGTQuC6+duNL7wvvSsWTgbdfhYjVn2jQa0TDFo+2NopWKIuscQ9 uX+ctZsI+4jgHf/75tq1fX5Zv4NGM8tVCJKtFll+SYteqZsQeKimV+oeW A==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="14770175" X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="14770175" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 21:40:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="1472008" Received: from junxiaochang.bj.intel.com ([10.238.157.86]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 21:40:47 -0800 From: Junxiao Chang To: bigeasy@linutronix.de, tglx@linutronix.de, rostedt@goodmis.org, linux-kernel@vger.kernel.org Cc: john.ogness@linutronix.de, hao3.li@intel.com, lili.li@intel.com, jianfeng.gao@intel.com, linux-rt-users@vger.kernel.org Subject: [PATCH 2/2] printk: nbcon: check uart port is nbcon or not in nbcon_release Date: Tue, 23 Jan 2024 13:40:33 +0800 Message-Id: <20240123054033.183114-3-junxiao.chang@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240123054033.183114-1-junxiao.chang@intel.com> References: <20240123054033.183114-1-junxiao.chang@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Try to release nbcon only if current uart port is nbcon, as it does in nbcon_acquire. Signed-off-by: Junxiao Chang --- kernel/printk/nbcon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c index b53d93585ee71..d8c6f30adde8b 100644 --- a/kernel/printk/nbcon.c +++ b/kernel/printk/nbcon.c @@ -1623,6 +1623,9 @@ void nbcon_release(struct uart_port *up) .prio = NBCON_PRIO_NORMAL, }; + if (!uart_is_nbcon(up)) + return; + if (!up->nbcon_locked_port) return; -- 2.34.1