Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp914738rdg; Wed, 11 Oct 2023 08:55:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKKQl87Wkuqjqm+O6BhHFk6M570Bu7enEKAcqA7HMM/OLwzE1YYM6Sa7i7wkAkiw5GF6vH X-Received: by 2002:a17:903:1c8:b0:1c0:afda:7707 with SMTP id e8-20020a17090301c800b001c0afda7707mr29914052plh.34.1697039741638; Wed, 11 Oct 2023 08:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697039741; cv=none; d=google.com; s=arc-20160816; b=vI9kJTruboJh2Ze6i0Kx+c041DrtMKs52konP+jjy6q1cSC3s60FWqVq7iL2ujn9BW v/S/ydB6K7Ex2SYBA+anVcTXyXknFRffzEGtY36q4+XjanB0BAreqQ5+Ny+1k3DKLzTR nhvmJhmPBKCbuboQdhIJd8pEDmEratYiWtDVHwN07YMDTuU50IhvP9I+SXNqrTzJft8+ n4mHzqcV8uO33tIi0fT2CHhugbEhWo6pCITPI3pKWJjAUB6EepMp4gQf2AN4aB+zLHcB qjnAomFbYFm0KjwsmVCNJO9PWeiLsxk3+VKBlQWd9LAvrSRLSnb4HRUtzSQVoljTyfD4 sCZA== 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 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w8-20020a170902d70800b001b9dda4e1e7si7654ply.154.2023.10.11.08.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 08:55:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id EF87380781F9; Wed, 11 Oct 2023 08:55:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346937AbjJKPzd (ORCPT + 99 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 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 11 Oct 2023 08:55:35 -0700 (PDT) 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;