Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1011581rdb; Wed, 24 Jan 2024 01:58:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IET6P/oB6nqVG3EdNAvxDEmz3IG2lhZ7ixIyNCyGjqV8/R5A1H2a45iAEg0tYA72ODrWBvx X-Received: by 2002:ae9:f20a:0:b0:781:3a8a:8eca with SMTP id m10-20020ae9f20a000000b007813a8a8ecamr8163101qkg.46.1706090299296; Wed, 24 Jan 2024 01:58:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706090299; cv=pass; d=google.com; s=arc-20160816; b=ZwXWdY6mq72bFHAW+4iuK9tNfs3ctRBiqhHZbCrc/9BXX0csor8zX2ywsIHL+aTVXL On21rY+X2xNbP1g/C8sIZ1HmF+un4Lp3lMsZ78ePxHOFBKVfGlO4kkpSx4BQROFttQL0 A1w7y1Vl4rkW+s27FLDPd80leVzt16ByL3HJHLVEQkhs72QXh34Bybbt9cGv+RulRtdy rmv0DguDXBO3BRxKepZC/u9lrNX+Z1jId/UPDoQGdyTM4Fq/wIQNzXZop16+TO91yG8t TYkSoOPMirUVMYK4lbY3+wyjgSlrp/Qd1ZjNj+NzmrYkChE3pn8CbMimtoujRInffzY8 3TKA== 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=3wmf3wu6pEhYmgZge+vax11EPN8UmQlBJ3MKJwRgPqg=; fh=9r9dEnw/3HBXWR7ip5o6X+YCKdU88ZZ1yWf67g3Wh14=; b=ur/NNkOnDUM7NOiXb3HWVfreL4BQjXTVL8g/Zyrb7DmrvPTCqk0bqIMECaZ0grMy9T EFDMqJUxxiz1cdbuFwsTHm74387brOr22QL2cTG59X5bzYdP+rRZBGxrMuon23PJkImm 7paa5QSEwmrS6xB2TXrzFZMeQUZX71xCzy1RvElhAOUy1EqjKrG1WocHUAETGaDMPo79 Lt7K/p92AxbsH6UwZ7nv3LGZHkxK+PSrYaRIRiXQYX/PI7V/SweRg75O0Q9O0uEr8/4A woy+n6GI/IFIAnqpQfVy5EdsQ2qCHtCuNzckGgyxewFNjgxg2ge2uUOmWWkgrzcSfr2j DUjQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ijr98ALA; 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-36759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36759-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f11-20020a37ad0b000000b007836d1e9b51si9487837qkm.247.2024.01.24.01.58.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 01:58:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-36759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ijr98ALA; 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-36759-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-36759-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0E9C01C21CD4 for ; Wed, 24 Jan 2024 09:58:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA833182C7; Wed, 24 Jan 2024 09:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ijr98ALA"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JuE8dMyG" 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 8A24418B02; Wed, 24 Jan 2024 09:57:47 +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=1706090269; cv=none; b=UhH8mHu7HYw7VaC0gsGA+eRj/JACf86YmuwrNi2iwJ3PRdb1Vqg3zfv3Zkf3yxtaSFtNnvrV4/63ei61OVTDARY/8Ocs5EjFf7upYMg8LtxNqL4DH6UxYsVS9LdLnjYfldSeVIHxubnFkBYGmv3PuHQUWs20WI58ADK3y1BFR28= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706090269; c=relaxed/simple; bh=3wmf3wu6pEhYmgZge+vax11EPN8UmQlBJ3MKJwRgPqg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=CfjTCubJcNcHERzdQGxuuGEG6NGc5jsQ3JcS5SWVtQ/trL/TF2cK65HLuDFJsIA6fWtgvlir9/0tyXUn65oClnUUd+RFc9qQ3eP6NejsHFG1GTQHNc40mir2yixT+aH69SfOPz/IRPMZA9kajQofJFcFnUVrs11SnoSb0N2H1N4= 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=ijr98ALA; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=JuE8dMyG; 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=1706090265; 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=3wmf3wu6pEhYmgZge+vax11EPN8UmQlBJ3MKJwRgPqg=; b=ijr98ALAOMm+t8LvziczWeSUz9wq06w/YopVNxVBw66PvgsdRX0VIYvHIMptN1Ws1LdMF3 Hr8m/aaj0YBlzl8GTC9N5tuT74SijcaVho8xhgPVYK604MMuMTRZJlUPNKJK8O1DeQtbbk ckCoUkG6UU9fNkjkqNx9DqgygCuTNDjIeNoEypTPKYNwF5p6d2W41StumFcHARc2eGOp6R k+JYowCM3HWCBztcI56Ld67Jr1d6de0g9ViYDxg1GXipfI4SPeMvP6QlZDwK5p9NII0XVB Z+bgzCD8+BzeQZxh3Jp6D7zCe3WtBJYGJ3dxdg70SJm5AflBFZhq19zj7TS2OA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706090265; 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=3wmf3wu6pEhYmgZge+vax11EPN8UmQlBJ3MKJwRgPqg=; b=JuE8dMyG1DzirAos71dCRDjOy5/p1omOuBndfeO5yDfRmn3PjR1Y4ky6aesAnUtAKEnMcw fHO0dp4q6MSbhsCA== To: Junxiao Chang , bigeasy@linutronix.de, tglx@linutronix.de, rostedt@goodmis.org, linux-kernel@vger.kernel.org Cc: hao3.li@intel.com, lili.li@intel.com, jianfeng.gao@intel.com, linux-rt-users@vger.kernel.org Subject: Re: [PATCH 2/2] printk: nbcon: check uart port is nbcon or not in nbcon_release In-Reply-To: <20240123054033.183114-3-junxiao.chang@intel.com> References: <20240123054033.183114-1-junxiao.chang@intel.com> <20240123054033.183114-3-junxiao.chang@intel.com> Date: Wed, 24 Jan 2024 11:03:39 +0106 Message-ID: <87il3j9hpo.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-01-23, Junxiao Chang wrote: > Try to release nbcon only if current uart port is nbcon, as it does > in nbcon_acquire. The release needs to undo what acquire did. Why should it have its own checks that would cause it to _not_ undo what acquire did? Keep in mind that an nbcon console could be unregistered while another CPU is holding the nbcon lock. The port lock (and nbcon lock) are protecting access to the hardware. They are not related to console registration/unregistration. John