Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp390375rdb; Mon, 22 Jan 2024 07:23:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1vBkJ7oxHo0d/tpjMDo0apk1+VgJk6uUP4B+HtgyPrWoZsa8JY1stM90/QFItyjLWUvYn X-Received: by 2002:ae9:e709:0:b0:783:79a2:97a6 with SMTP id m9-20020ae9e709000000b0078379a297a6mr4826022qka.155.1705936982227; Mon, 22 Jan 2024 07:23:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705936982; cv=pass; d=google.com; s=arc-20160816; b=Uw+ZGDVZp9u3afxlBtN3AFPLHr6w45D3lr6ZYHYDxRfXM74iFp2saNh8fM/5rVr1b7 H2krjSnZZiKsX5CUNiiElF5dn1f+DCGkL2GpxPi9hyJvw4vgZc9/izwI0o39ln2qJ9bx jY26FPyMmI8e0/05fRfBOF1H88pLu+HmqpdK7FW/TBFq/s7B2v6MhC3HcKkN6j/e/AIy 107sMz8In6pIW4AB+vKCsPPzkdFfzzX5eBIp+kvSdS91k/CHm8efWqwl9fPpGyh4poXP gzMzRshrfZSfzkclz5NOOb+5P6vsm9gaktR1lpC9astRjwQjUlfQ9qTv0htzgV+OOIGG 5Rtg== 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=IPVLKMnZIdZznxkOsqi8rCBFDZ7L3dRdJwhCVkA1nv0=; fh=zPpaK7eLvkh08F80Cld86d4hIAZ0MtkZdauLjINLFsE=; b=uhEAHR/e5ABe/74BQ5IevejuRpihisofPT+9PFxK8EN+Gsl3x1QxWjH4XmQX7xRiob CQc8gF1p4bOHFd9wxwmG9I02aN78uPLKxBsF6zYBLJ4jS/xNdMyhArz2I63CvfBR7yQv XzfoRCGA/ImuKNtkNUUObIeGgSdizzRBAOBnp+W2FSSyzbic78H++AtnJ305KJoa9j1b 6AxaWjhWf4U/k+lWih/HW/BK8VwlYmBlw2INnXPaYRNWje5QYnHM/aCTR2c+HsSpRZB/ EJ7CSgldN+/ewIBOnDzFINemCpVcsG0QSfDcD/wC8TiJsTXbghcZsElvGVXMvJwfdy0d UoNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VUYgGO23; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id m23-20020ae9e017000000b007833d03747esi5502628qkk.591.2024.01.22.07.23.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 07:23:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VUYgGO23; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-33283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 009461C229EC for ; Mon, 22 Jan 2024 15:23:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2309C5BAC0; Mon, 22 Jan 2024 15:00:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VUYgGO23" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4D7955B5CE; Mon, 22 Jan 2024 15:00:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935600; cv=none; b=CIsWs74iDctAq4C5xn1ieIxxIQ+ajyi442TAptuJK0w//Dd14KRSmdOV8fatvIWrcUUqX2Rm5HL7Y48qk4s+kmN8HP2zVVTwufkiXtRCwJADlBoB1pa8JZK0f42dgedBLVJQlARnYo9lCztrcisvXYbj9GwzXkji6+4fYOpB+PE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705935600; c=relaxed/simple; bh=9M4Bh447WXbW82Sc6GAht9rq9SrdziELRfSzU927JYM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dWXvpiKOUv5SXhPEHYDmllY03Esm41OsIA5gERrCPgYnT9l1igxR6fITzb+BqlCA2ES3luy6PJhptjN/N0JFaUNLAwpUvLJxAtR3Ov2KgeaX+uRNvODw7DPeftrOrUKrSIYTg+tc7Qb+QuH4VvW3KnP6tcTXhrzrrDGXU+XObxo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VUYgGO23; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D083C43390; Mon, 22 Jan 2024 14:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705935600; bh=9M4Bh447WXbW82Sc6GAht9rq9SrdziELRfSzU927JYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VUYgGO233//A1p5WfAcpKJuGCGDR5Ai7XSGPIP9KgeShKcDRIJtXeUlnmKgwuaJxC F79sqbTvIznMJ8VN4WPA7vlHPJPqkWeNAjn04scoqdQOUCDrR8sgYreNs7IqRv16ab X2qs8vJhs30z+4Z8G/6NQo9tPWJU/yvlzkFjZBy1x8gxEtlTbbCUbny97dkZ+l5wPj sAaldbJbkElSmrAKZ7fklSgfVxz8mV7otdZ8T2cRUNInJbUZAJrkYBiu/HmIZ8f9BV wqob+8bI7mYhL5/AGjZT+Sth9JdKhQJMBX/uLPHyeS8PQCrpZI4ktLov8YAG+91yZ1 97WNh8hcYgDww== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ben Dooks , Guenter Roeck , Wim Van Sebroeck , Sasha Levin , xingyu.wu@starfivetech.com, samin.guo@starfivetech.com, linux-watchdog@vger.kernel.org Subject: [PATCH AUTOSEL 6.7 61/88] watchdog: starfive: add lock annotations to fix context imbalances Date: Mon, 22 Jan 2024 09:51:34 -0500 Message-ID: <20240122145608.990137-61-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240122145608.990137-1-sashal@kernel.org> References: <20240122145608.990137-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.7.1 Content-Transfer-Encoding: 8bit From: Ben Dooks [ Upstream commit f77999887235f8c378af343df11a6bcedda5b284 ] Add the necessary __acquires() and __releases() to the functions that take and release the wdt lock to avoid the following sparse warnings: drivers/watchdog/starfive-wdt.c:204:13: warning: context imbalance in 'starfive_wdt_unlock' - wrong count at exit drivers/watchdog/starfive-wdt.c:212:9: warning: context imbalance in 'starfive_wdt_lock' - unexpected unlock Signed-off-by: Ben Dooks Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20231122085118.177589-1-ben.dooks@codethink.co.uk Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/starfive-wdt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c index 5f501b41faf9..49b38ecc092d 100644 --- a/drivers/watchdog/starfive-wdt.c +++ b/drivers/watchdog/starfive-wdt.c @@ -202,12 +202,14 @@ static u32 starfive_wdt_ticks_to_sec(struct starfive_wdt *wdt, u32 ticks) /* Write unlock-key to unlock. Write other value to lock. */ static void starfive_wdt_unlock(struct starfive_wdt *wdt) + __acquires(&wdt->lock) { spin_lock(&wdt->lock); writel(wdt->variant->unlock_key, wdt->base + wdt->variant->unlock); } static void starfive_wdt_lock(struct starfive_wdt *wdt) + __releases(&wdt->lock) { writel(~wdt->variant->unlock_key, wdt->base + wdt->variant->unlock); spin_unlock(&wdt->lock); -- 2.43.0