Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp673342rdb; Fri, 26 Jan 2024 07:24:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IE/DHzA64JklvSezMW8k+EHtZMTmaYCBlNseeDAwdQG8VS9OJ0WDzIKTh6Vb4qdnT+n4j9u X-Received: by 2002:a05:6214:2aa4:b0:685:dad3:4801 with SMTP id js4-20020a0562142aa400b00685dad34801mr1620535qvb.95.1706282663015; Fri, 26 Jan 2024 07:24:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706282663; cv=pass; d=google.com; s=arc-20160816; b=HTppJVj1jP4OLEFKLg1qwxxEQAokB+0fU3pb8AcrDv854MQqFbtT3WYEYRlggoKaLP oDwNZC14PnNUZ4Nq6UlxQyuMlVYTmBVEkdpJ653AsuOfNs851IOAcnBN1b8jwuH0u80D XqmK7eL7N7XKpd5M9/rxaXJuuSjxxl35MeHTqb0yTBG6ZL9NQy4LLiOTO1gSHRPR6ghK AbQD8nFRjSw/IDzTFXQtQw4DQSdNzeGW2C0OfTayRdb6RSBAzgD7PWLH7Z4W65Ob5JR3 xGCKOB5Qg7aFQxtk1peKGaJl/RA5OLAu0aG8uJmF9yGwO25SKBdpHYrUkcxST4qLxcUX WxiQ== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=JcpizUvN8xiERk0pldVUNcJlju7alBoCT4tt6ZFQpBI=; fh=bbszJjxpWeMWa2enuXJXdf5oglCxEFkPcRHnG7tmmiU=; b=nF15S59m9gmEN2noQqnK9WjyXajni4dmRptuaUOLrQ4L9qwqh+gma74Zl7tiOEpA0m j9hjR4oXYkQtmQEja4UYEdzvtBDUM2KCI24XCHgvr3VLrl/CYKFonpNHyErIJDJsM5e7 02au3qu90zXlM5KbaLZl93dJgsKf2YX2/N5vw2+V5T7pB1dIrZ4qZymVrpe22XovBETY aBHL+l/U0wj5Z1RQLLEsBntDwW0Ht4ymD4Y+myMozOjrUKEF8vlaOPqUQhWWY6w2P+aR +ndB56Alib3278ZkUaR1+V9js3GCXz7sIHdI8rClkjKkmkr5N1tQn+ZSsqgIAR/hIblv mlfg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="TP/gAuUa"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-40265-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40265-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id fn13-20020ad45d6d000000b00680b0f40fb4si1511235qvb.206.2024.01.26.07.24.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 07:24:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40265-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=@kernel.org header.s=k20201202 header.b="TP/gAuUa"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-40265-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40265-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 C09AD1C2114F for ; Fri, 26 Jan 2024 15:24:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 74E181D53E; Fri, 26 Jan 2024 15:24:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TP/gAuUa" 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 961B21D52C for ; Fri, 26 Jan 2024 15:24:16 +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=1706282656; cv=none; b=d/AGS2fbrM1W7MT/Q0p8UvL3/9lAIeyMui0NoeMB9FcxGke1QFkgT6SP7tgo6PFVDtIcsDf9r3LjJDdy1Rq6swIT+bKE14PKHKdnBRDHz5avbViyRlwmwDb186Cf39rVEm9momP2Vr1metCt0ocFsNhKWrFRTmBFdrk5uEO/4K0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706282656; c=relaxed/simple; bh=lhfvdd0CQ97+F2PLgTG9KuevanbLcfk73SxBk1IuAQc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Ifv+sPFbfB5tcq3w9k0UmaIO4Df64YfDBPM0Ew66Izo2s6mZ0nGjqKXaG+oExi1jihY51ThfAl6ANiW2KBbhpqNdS+DAWvoK742jm0I/axS1niSk9fV8EwaeD+el30rK2Iqi1VGKVpgO9KXOqkLhbRqlkqucLa70NLEme0B7Q4w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TP/gAuUa; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3396C433F1; Fri, 26 Jan 2024 15:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706282656; bh=lhfvdd0CQ97+F2PLgTG9KuevanbLcfk73SxBk1IuAQc=; h=From:To:Cc:Subject:Date:From; b=TP/gAuUaUu7icEys+fJSftia5Z2bBywBvzDtxCrryqHpAd9V259yshOGhMVtg4BDR aY9Ru6nX6qbLRwxHyHLWTh4rECc7wgBRSPLBaG9f8HbHMlmvlzOmGuxdSxJURsFp0d WSIBDAYsampsbf3sdJmmRG7uetx/NuQCIQUjYAYV8hNZYpzjeyM3rzUFVSZz3L+2MC TNPN4NjrWbZPXaKAxMrmoYmZdrHrqcByle4gAEtUY+RliW9Rq1rEbesLkjwyVYMOJe 1YCnSnX8lrhbCzVkgzzIjgFl3/CRNKJrPziHRCeHpqxWTdzXV4JvsrFLzZPQnybX8L ai8dLo7R1QALA== From: Will Deacon To: linux-kernel@vger.kernel.org Cc: kernel-team@android.com, Will Deacon , Arnd Bergmann , David Brazdil , Greg Kroah-Hartman Subject: [PATCH] misc: open-dice: Fix spurious lockdep warning Date: Fri, 26 Jan 2024 15:24:10 +0000 Message-Id: <20240126152410.10148-1-will@kernel.org> X-Mailer: git-send-email 2.20.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When probing the open-dice driver with PROVE_LOCKING=y, lockdep complains that the mutex in 'drvdata->lock' has a non-static key: | INFO: trying to register non-static key. | The code is fine but needs lockdep annotation, or maybe | you didn't initialize this object before use? | turning off the locking correctness validator. Fix the problem by initialising the mutex memory with mutex_init() instead of __MUTEX_INITIALIZER(). Cc: Arnd Bergmann Cc: David Brazdil Cc: Greg Kroah-Hartman Signed-off-by: Will Deacon --- drivers/misc/open-dice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/open-dice.c b/drivers/misc/open-dice.c index 8aea2d070a40..d279a4f195e2 100644 --- a/drivers/misc/open-dice.c +++ b/drivers/misc/open-dice.c @@ -140,7 +140,6 @@ static int __init open_dice_probe(struct platform_device *pdev) return -ENOMEM; *drvdata = (struct open_dice_drvdata){ - .lock = __MUTEX_INITIALIZER(drvdata->lock), .rmem = rmem, .misc = (struct miscdevice){ .parent = dev, @@ -150,6 +149,7 @@ static int __init open_dice_probe(struct platform_device *pdev) .mode = 0600, }, }; + mutex_init(&drvdata->lock); /* Index overflow check not needed, misc_register() will fail. */ snprintf(drvdata->name, sizeof(drvdata->name), DRIVER_NAME"%u", dev_idx++); -- 2.43.0.429.g432eaa2c6b-goog