Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28161279rwd; Tue, 4 Jul 2023 14:13:10 -0700 (PDT) X-Google-Smtp-Source: APBJJlFJm/+nce28WgrLoU0an/dPoGNwMupMJ+mzHPNdNsbiGn7siCivY69zXvw41rq1yZTqIn50 X-Received: by 2002:a17:902:f54a:b0:1b8:73fb:669a with SMTP id h10-20020a170902f54a00b001b873fb669amr17364366plf.31.1688505189728; Tue, 04 Jul 2023 14:13:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688505189; cv=none; d=google.com; s=arc-20160816; b=eKHKLX2ZiEb2fXdMlIDPgOZs0LfcELraPlLbBc1l21u6aoz1Wx670EdXozU6gtdY03 2FtjHIE8URWM+PmIzNzHaHHEvHtGrcDCLsBmD4Bp5rbf19r7ILD9IG2uLvp9Vz7gc+AW WevT1UUd2zCV738vCcKmNbCAEHTBhAd29K9lUcukFZDdWYH1594WvXnnmCNRIodO5ae1 da4WFwq/Q31zfWrRifgVFE+BKplI8jGCHSPx+5dXBFPaXNq70k26KjGnhYtVC+79fCk1 Nx5LZpo/AAAt/rAtt35jmrnVCKNOnDw0X6VVs6ve6cuQtlhUZ/SLNBrpT4AUHKEI34wC KDqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:dkim-signature :from; bh=eguXyzKTZkD9Z4lGPj900ptpIgDTK4/2D4wcFUab7ns=; fh=JY4fAt/SOBgkPkA6yvuZYKNiu14lMwNCg4yibpl7qnw=; b=VJ5ANy0rsqfABR0YApBHFMJ+Epe4vuhtP1KKiRJ/pS/d2h6VJOyD18vb4aZ4F27+hw SvgJgyBnbxUE93/HveJf91IVmpZksOD6r3UFo1RGYah4eEtwOM6hu4c1d2thtqweoRrn cXR17ma6OYw/eVICAWvKO76Rj7215exxQOp3GQ61B8p32oXGmkRvsJklK/1nL+V+qHze a7f3fVd2YKQlnz/zsbeAUDpsDvZTFSVAGIFoITGBgVGtLBqCQHiBI1PrYMEFLJkgXLkY 1UvLdNhNpU4mdIKrzjlX9gq4osgET7r13xx9zQKdThq3w4cOI1OcxzMzm46onvZ1ayI+ P6ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=cEWNAPOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a170902c40800b001b0163c9715si23594051plk.318.2023.07.04.14.12.34; Tue, 04 Jul 2023 14:13:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@weissschuh.net header.s=mail header.b=cEWNAPOz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231272AbjGDVDf (ORCPT + 99 others); Tue, 4 Jul 2023 17:03:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230472AbjGDVDd (ORCPT ); Tue, 4 Jul 2023 17:03:33 -0400 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1717110D7; Tue, 4 Jul 2023 14:03:31 -0700 (PDT) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1688504608; bh=5uR0LdnKjKs0n4uZv6fjdMfj3y5tRy2LwcBBWPqIGm8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=cEWNAPOzRnEmGGm56FkorByHHnQ1fXlfXHSpwPgAGLWFVMKtdXyvHQaYappRDGLNK lLeBpAhGE61YK1DA5CmEU5BKjPlvwKJDnvsq5wiMqZ3tb0YJ6pzZzsTI3hKy4MlFlu BcH6/INRbYLcG0ziGw0ih3j4qep2BiDt8CfDDp2I= Date: Tue, 04 Jul 2023 23:03:17 +0200 Subject: [PATCH 1/2] platform/x86: thinkpad_acpi: take mutex for hotkey_mask_{set,get} MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230704-thinkpad_acpi-lockdep-v1-1-60129548a738@weissschuh.net> References: <20230704-thinkpad_acpi-lockdep-v1-0-60129548a738@weissschuh.net> In-Reply-To: <20230704-thinkpad_acpi-lockdep-v1-0-60129548a738@weissschuh.net> To: Henrique de Moraes Holschuh , Hans de Goede , Mark Gross Cc: ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1688504608; l=1340; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=5uR0LdnKjKs0n4uZv6fjdMfj3y5tRy2LwcBBWPqIGm8=; b=JuLe2U8TccNMJjW0vtcgW8wNPauuFWJBOT+UdbRBgSvpf4mkRCCrd5Pr0nQLZ4UWV3l21oOOj v+O+fIlQN0BB3IPpJhsHTjDGx3/aTXviz1RJSWmdmCNeVqIQTMEVPRP X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hotkey_mask_set() and hotkey_mask_get() expect hotkey_mutex to be held. While it should not matter during initialization a following patch will enable lockdep for hotkey_mutex which would produce warnings here. Signed-off-by: Thomas Weißschuh --- drivers/platform/x86/thinkpad_acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 187018ffb068..b796e65c99e0 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -3478,7 +3478,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) if (tp_features.hotkey_mask) { /* hotkey_source_mask *must* be zero for * the first hotkey_mask_get to return hotkey_orig_mask */ + mutex_lock(&hotkey_mutex); res = hotkey_mask_get(); + mutex_unlock(&hotkey_mutex); if (res) return res; @@ -3577,9 +3579,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) hotkey_exit(); return res; } + mutex_lock(&hotkey_mutex); res = hotkey_mask_set(((hotkey_all_mask & ~hotkey_reserved_mask) | hotkey_driver_mask) & ~hotkey_source_mask); + mutex_unlock(&hotkey_mutex); if (res < 0 && res != -ENXIO) { hotkey_exit(); return res; -- 2.41.0