From patchwork Wed Oct 11 15:55:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 151456 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp638485vqb; Wed, 11 Oct 2023 08:56:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJ02SfLO7/gurPYAsirOAzKCMIk21Guw1Uqv1pYfdd02A9lEfskXTI86RKOZI7facYBXob X-Received: by 2002:a05:6359:b9a:b0:147:eb87:3665 with SMTP id gf26-20020a0563590b9a00b00147eb873665mr17253321rwb.3.1697039759610; Wed, 11 Oct 2023 08:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697039759; cv=none; d=google.com; s=arc-20160816; b=mUQFbZY70ULllxcPxTbjZnOsvnfX9S3QahB6epdbvmXumWfAoFgpS8HciiRobJFhSJ 3H9zg9asBMWzOInqYOVP0LVRSAL2u7mNSx6sn/bLkYTd2OJyJr3vbLcwnUoPqG+Eivc0 RSMxGBsmhAibwbWjsaUnb7mW94AXSStCGStHjKP1R7ib7hYHaFRAz6Kpg0ZWV+8VRohK dO90tplxgZB1uc/EUrhtV1TO45vtywxEz2v11mIiSeVcjP1/nUYKurE6kJ+HzeUL5CHg UPeykTlpaxJeU73mD29SeJIjNGqtKcSP9IiP/iipgRNw+LAwfL63u56uaiF3Vfy4Tkqg BNsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=3wiWiiUJ/BuPUDvEvY6bj+Txff5QQgUtG31XPS+DYSw=; fh=9xpgZow74t7F259t3cOafGHXrdMMO+Gi7OlGcgLOzgs=; b=U5mXTTwpU1JUilzBknJ1YHlmSvn/whZgvd2mHDA1vsZTbufsjFkgb77v798c3iR3c6 McDZGN4o65TSmRm23tMl/0aXuLcjNze4xvqcXRgFXCGI0uUAoAj3lGJZTFqkCR/ww89g 6IN50y8Om9bdk+A29SPvgot5dZyUrlnuD8lfujFRhRQIaKa3rNO9Ifh2ATCWqj8PhBkk 7AZnDAkvwWS8BpFmCZkZrXKWGSAkSNY+50kWC6vGdsTlP4e7X799ohN54xAB314ibVlR UcwA79nyjPZ1jYgMWhaA/sK8fQa7YiThVKmyKB7hFzqEqv6lHee/U6gsR/0K30MfauS9 AIqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id d17-20020a056a00199100b0068e29a05fa4si12874151pfl.326.2023.10.11.08.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 08:55:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C5AB98029297; Wed, 11 Oct 2023 08:55:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235098AbjJKPzd (ORCPT + 18 others); Wed, 11 Oct 2023 11:55:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235105AbjJKPzc (ORCPT ); Wed, 11 Oct 2023 11:55:32 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22047A4; Wed, 11 Oct 2023 08:55:29 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 5290f4194c2fe648; Wed, 11 Oct 2023 17:55:28 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id B4602666775; Wed, 11 Oct 2023 17:55:27 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: Daniel Lezcano , Linux ACPI , LKML , "Rafael J. Wysocki" , Srinivas Pandruvada , Zhang Rui , Lukasz Luba Subject: [PATCH v1] thermal: trip: Drop lockdep assertion from thermal_zone_trip_id() Date: Wed, 11 Oct 2023 17:55:27 +0200 Message-ID: <12311623.O9o76ZdvQC@kreacher> MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrheekgdelvdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepudelhedrudefiedrudelrdelgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleehrddufeeirdduledrleegpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeekpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrghdprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthho pehrrghfrggvlheskhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhrihhnihhvrghsrdhprghnughruhhvrggurgeslhhinhhugidrihhnthgvlhdrtghomh X-DCC--Metrics: v370.home.net.pl 1024; Body=8 Fuz1=8 Fuz2=8 X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 11 Oct 2023 08:55:47 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779475162895572583 X-GMAIL-MSGID: 1779475162895572583 From: Rafael J. Wysocki The lockdep assertion in thermal_zone_trip_id() triggers when the trip point sysfs attribute of a thermal instance is read, because there is no thermal zone locking in that code path. This is not verly useful, though, because there is no mechanism by which the location of the trips[] table in a thermal zone or its size can change after binding cooling devices to the trips in that thermal zone and before those cooling devices are unbound from them. Thus it is not in fact necessary to hold the thermal zone lock when thermal_zone_trip_id() is called from trip_point_show() and so the lockdep asserion in the former is invalid. Accordingly, drop that lockdep assertion. Fixes: 2c7b4bfadef0 ("thermal: core: Store trip pointer in struct thermal_instance") Signed-off-by: Rafael J. Wysocki --- The commit mentioned above is in linux-next at this time. --- drivers/thermal/thermal_trip.c | 2 -- 1 file changed, 2 deletions(-) Index: linux-pm/drivers/thermal/thermal_trip.c =================================================================== --- linux-pm.orig/drivers/thermal/thermal_trip.c +++ linux-pm/drivers/thermal/thermal_trip.c @@ -175,8 +175,6 @@ int thermal_zone_trip_id(struct thermal_ { int i; - lockdep_assert_held(&tz->lock); - for (i = 0; i < tz->num_trips; i++) { if (&tz->trips[i] == trip) return i;