From mboxrd@z Thu Jan 1 00:00:00 1970 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 1DD5D54BD4; Tue, 27 Feb 2024 13:48:59 +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=1709041739; cv=none; b=NO8ty9OP6JIFDhxC/+srYjbGNI/+bvvyDFsRC/REwN7lNp/A4UER27ZaUnS29mzIwjNeV4Kx/gKt9AEZc6cGxOTwCANb3LoKJGMWjzPKXkCe9/D/FL4cIpQLVFKZPSXrklSbVkxyVtg/8KvKM1nAgM44eCwpofuK7YMCX9wBkGk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709041739; c=relaxed/simple; bh=RaXVfrdkSBEomajpkYawTUxeJutx8jdjQSBUDu+vvn8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o3XTc4dyybxzTcFsDrH2m+0u3B4W3jIr/m0hKP7T45CIiE151HJXUWGgLRVIAJDXaTlzJHZda7jqjSXFujt6uISLoJZbK8SnTsrURCguzTCISKUqEc5t2u7POjrF91p3fCOC9WniCSUzuDJusGaCk4ofvE20FWpFfNTN2J9oqnI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=C/rLhgqt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="C/rLhgqt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1B99C433F1; Tue, 27 Feb 2024 13:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1709041739; bh=RaXVfrdkSBEomajpkYawTUxeJutx8jdjQSBUDu+vvn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C/rLhgqt6lwV0gTCWV6oneoJyAMH8BFyH7R8zGZnjNKICrzmfSP92sEpgsBgKHWVE KFIwLRL/HaNfxQo3CaPpjvfhYXfgmL0npkooPvO7DjYoz6uIEFtD99B11TDVnF5ohF Hv0caUEdO/AmEszFjJ6VnCx6de+OagIN9sehPX5Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Arnd Bergmann , David Brazdil , Will Deacon , Sasha Levin Subject: [PATCH 6.6 051/299] misc: open-dice: Fix spurious lockdep warning Date: Tue, 27 Feb 2024 14:22:42 +0100 Message-ID: <20240227131627.615226269@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240227131625.847743063@linuxfoundation.org> References: <20240227131625.847743063@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon [ Upstream commit ac9762a74c7ca7cbfcb4c65f5871373653a046ac ] 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 Link: https://lore.kernel.org/r/20240126152410.10148-1-will@kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 8aea2d070a40c..d279a4f195e2a 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