From patchwork Sun Feb 18 18:57:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 202835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp911307dyc; Sun, 18 Feb 2024 10:58:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUu+u0zvqWsLXW5hBwrveN5XKaaD27zrjqVheZwSnQIHX6RAdEgHg63YCSAkrVebFCV3+Wb4VF0SqPKRcxQkW3Tv2NJCw== X-Google-Smtp-Source: AGHT+IELr0eiKyAq9juymSCt9Fb8Bn9Agl+3nutbzO9Ir4nwflpxByjQ2lGXFRu1LiqhuSvCRO8+ X-Received: by 2002:a05:6871:3285:b0:21e:dfa2:d8b6 with SMTP id mp5-20020a056871328500b0021edfa2d8b6mr395752oac.8.1708282721023; Sun, 18 Feb 2024 10:58:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708282720; cv=pass; d=google.com; s=arc-20160816; b=ZaRPl+BQMiUY3fn/C+rSPT/2qmkXvAJWEzQEIkv5AZqFUDEV4IjXgLm5kF8UJWDvnj 0IsF088IDtHr7utDriReJQnOZZvvBT0fSWK0NZggTLRlKkGnO3f3OKcbDPhTr3v5uP8V Y/Nw5r0i3bYGgAcm/0EwqFYeSfPW7aRylgA3Z8HPE0SGbopzKdvwmZNml7RKlgYuVBmQ yna9R1/vy+K6/ysfipGfwbsgXnzW1dwgqrgA3V10WHN7ewdRpQK1oI+2upKzQEN+Wcgd Kw6AH43lrt43OLtCREaWSVqecrsvXmRD002GuJ2mg72Zr65u2JS8CQZG6T+jXnS1DMRB CV4Q== 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:dkim-signature:dkim-signature:from; bh=4Un0rwRwZZ3a2XT9jb+evA7D9ZWLwutkDIt2olFNBSM=; fh=PnRqlo+gSrEyXQylTbIbu2gslrfZ8YMEl0YokxZ3dP8=; b=FrMKVOVlB6JfWO4BE/7tgMR4FusWRf1J/vn7wAxAlV5G++2D0lb74B04tnT40fl54Y 9OKdfswi4R9g4wJOowZO8FKo8Ht2nwm9PcZsM36LbHFPk9IazFwyePycsp1PgDWo2ZKU sgySbpn23NpGRvJTK7H3tIXIGvlfamiD+94dE08jY79s8ZlVHcGi4G2o1O0az6YpLqox P51tu0XQvbrjamgtMIWQyOdyPFAlZF3KMSh4kiTsu1UjQeV5KiytdSYG0ZgnGqRA05Sp Sya8x4indMbBD6L0r3HjEUipetUxvtvWVXkIaHyEOSSOWPYH9QtIAc3n6Uc2EgP8wofJ DTVQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qrnb2FPQ; 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-70500-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70500-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c27-20020a63725b000000b005dc42fd2ea5si3155742pgn.889.2024.02.18.10.58.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 10:58:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70500-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qrnb2FPQ; 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-70500-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70500-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id CD37E2819F6 for ; Sun, 18 Feb 2024 18:58:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B5FB271B54; Sun, 18 Feb 2024 18:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qrnb2FPQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="TZBO/V1B" 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 376B725772 for ; Sun, 18 Feb 2024 18:57: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=1708282673; cv=none; b=o7HLDI/U5H2AhiZmJpMmM6RDRqPoQIjW169gqqxSuXF2nhbU4X5Leh8SB+bYMCKHfjJGIPzRgo7VCb8VGPx3jGEpdTGHOhcZoj9va+cpbhLXRzoOcTMwGOwCnwShL8iq2IuIxol9erraH5sLYGivT9/5WjZElnz42sc+L91duKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708282673; c=relaxed/simple; bh=szxbYO6I4lhZ0tittilU4W8LlO/EcPP5ZLOScG+pyp4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=f81GMo2NjMSd90QLGQq86KEuLjh2hfMjI5uVaYyQr+YjEG3OxrKmTlVl3X8LnYBtFgj66OYakSNfRYA2Sq/aaQWBjk6nTIWgGN8V0Yx3/iPZCv2OuAvhM9gMWbW0eWNFkD8dWXhmIZd2yBQm+DSnE18WEsTt1gpaDLC7zdwETxI= 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=qrnb2FPQ; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=TZBO/V1B; 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=1708282669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Un0rwRwZZ3a2XT9jb+evA7D9ZWLwutkDIt2olFNBSM=; b=qrnb2FPQWgUIoPQJwgH3E7DufsQ8IsmtrQQqmcYm22LHa2RlOcWRaeSgLnTFRkhmI+mqtI LRtd+VTf3IGtSg31pnViD3VR4oQLjkg/aygbOYwww0ug90EJiO7B0J2tW815u+ZjEbJ2L7 aXR2jDLA0+TBCYwEQzB2/sxQTpYFEI8RPyW5XDMBYMHWL1pAxkd9SBV82uAdo7iMHesD38 WRuCisj15Tlbb3l3AEKayPiqVcSXandv/cN4vbqodVlGzOWCbAH+ssr8l8CDm7k3kZuMNt CVTx2lQTuI+sOT63pugYF4DZCMWzYNhlyYfNKl9HVk47k8XSDkbqVUxCyXX39w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708282669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4Un0rwRwZZ3a2XT9jb+evA7D9ZWLwutkDIt2olFNBSM=; b=TZBO/V1Bg1bIdmb66zgE0251XZPPIH3YGi9O+tOmQDQ3pr7l4tHkAdFsCwv7sEQgcEqLRv 77OR8OHaSoy8eBCg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, "Paul E. McKenney" , Miguel Ojeda , kernel test robot Subject: [PATCH printk v2 05/26] printk: Add notation to console_srcu locking Date: Sun, 18 Feb 2024 20:03:05 +0106 Message-Id: <20240218185726.1994771-6-john.ogness@linutronix.de> In-Reply-To: <20240218185726.1994771-1-john.ogness@linutronix.de> References: <20240218185726.1994771-1-john.ogness@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791264262634230424 X-GMAIL-MSGID: 1791264262634230424 kernel/printk/printk.c:284:5: sparse: sparse: context imbalance in 'console_srcu_read_lock' - wrong count at exit include/linux/srcu.h:301:9: sparse: sparse: context imbalance in 'console_srcu_read_unlock' - unexpected unlock Reported-by: kernel test robot Fixes: 6c4afa79147e ("printk: Prepare for SRCU console list protection") Signed-off-by: John Ogness Reviewed-by: Petr Mladek --- kernel/printk/printk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 696a9d76c09c..b75ca383683d 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -282,6 +282,7 @@ EXPORT_SYMBOL(console_list_unlock); * Return: A cookie to pass to console_srcu_read_unlock(). */ int console_srcu_read_lock(void) + __acquires(&console_srcu) { return srcu_read_lock_nmisafe(&console_srcu); } @@ -295,6 +296,7 @@ EXPORT_SYMBOL(console_srcu_read_lock); * Counterpart to console_srcu_read_lock() */ void console_srcu_read_unlock(int cookie) + __releases(&console_srcu) { srcu_read_unlock_nmisafe(&console_srcu, cookie); }