Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp4519028rwe; Tue, 30 Aug 2022 11:33:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6kU6naxRwVctvAgvxs6BFAfyh3WjPMGl2WcrDKJxa1JLeMBzo2rXzT4bXs/+Hl5rgmJGv7 X-Received: by 2002:a17:907:929:b0:731:3bb6:d454 with SMTP id au9-20020a170907092900b007313bb6d454mr17758278ejc.96.1661884420855; Tue, 30 Aug 2022 11:33:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661884420; cv=none; d=google.com; s=arc-20160816; b=o+NMH+nD+cJzKcPJPQUdBEXZN5CsqAS8xjXD6pnCd2rn6OYY9ZrbDYjiWGL09gUjMh nA/UtoNheW1UBVvvW5nR6PSG+ajZ3Wrv2esCsdx5QzrfZLyQHYAYA1wnl6s67iEqjKye 8NNH7PxJxjru3+af6sNpbXxkGHmnFqfGQJQhwZdpBscD/P7hcAF8kd1GzIFqtm/JFIRd jjngf73ZF3xL5IFJ1ebAV/spX/OEe0YrIyHjjq1NC1E0y9eU6lVdnREW2hYPiyvZOrCt wUVhK3yuokvsu5h6cT2CTbFrtTb+3F+4jbevnxqzesUXwHnVuxbDnUeL07rGWohf06Rf R8EA== 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=0njbM4xUkgo6VvcETy9JvYH2miLE09lvSPRxnehRrvQ=; b=D22qykVHOkMrRIfsfEPEnWkUIu//2FsuTWlMcwAIjg4eplyTV04nhrewbhLcoDfa5d 9dv9Wg6IZbL3L9P5gFsnUCncH9ytOv0dt8VlrV5n5AS6zjsO4TIqeV70Wv2FDZi9HXAw L1NNyhedH90bfpkt3/UH/Ckg3DiSZWx2GBuwoEpJeMOfZJxGmiUtwRmfNdFhBGXKFBLZ mOoLpxfI79wk3KHHEXsyN/ooim/fNhcvH2PUZSyM+mwhxfxV6TmPCYtM6LAqBG+BqUrI /A1aSRbYMSObOibIMwxWuiRwm90HGhUm21yr7UVY2NWu2mCdV60DNdYWsQHdjskpqSQI 7dpQ== ARC-Authentication-Results: i=1; mx.google.com; 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 sa39-20020a1709076d2700b00741991009e4si4439341ejc.560.2022.08.30.11.32.52; Tue, 30 Aug 2022 11:33:40 -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; 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 S230043AbiH3SPs (ORCPT + 99 others); Tue, 30 Aug 2022 14:15:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbiH3SPr (ORCPT ); Tue, 30 Aug 2022 14:15:47 -0400 Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 567A01C124; Tue, 30 Aug 2022 11:15:41 -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.0.0) id d80d4b748d72c08a; Tue, 30 Aug 2022 20:15:39 +0200 Received: from kreacher.localnet (unknown [213.134.183.102]) (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 v370.home.net.pl (Postfix) with ESMTPSA id DF57466D26F; Tue, 30 Aug 2022 20:15:38 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux PM Cc: LKML , Zhang Rui , Srinivas Pandruvada , Daniel Lezcano Subject: [PATCH] thermal: gov_user_space: Do not lock thermal zone mutex Date: Tue, 30 Aug 2022 20:15:38 +0200 Message-ID: <12067136.O9o76ZdvQC@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" X-CLIENT-IP: 213.134.183.102 X-CLIENT-HOSTNAME: 213.134.183.102 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrvdekfedguddvfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffffffkefgheehffelteeiveeffeevhfelteejvddvieejjeelvdeiheeuveeuffenucfkphepvddufedrudefgedrudekfedruddtvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedvudefrddufeegrddukeefrddutddvpdhhvghlohepkhhrvggrtghhvghrrdhlohgtrghlnhgvthdpmhgrihhlfhhrohhmpedftfgrfhgrvghlucflrdcuhgihshhotghkihdfuceorhhjfiesrhhjfiihshhotghkihdrnhgvtheqpdhnsggprhgtphhtthhopeehpdhrtghpthhtoheplhhinhhugidqphhmsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheprhhuihdriihhrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehsrhhinhhivhgrshdrphgrnhgurhhuvhgruggrsehlihhnuhigrdhinhhtvghlrdgt ohhmpdhrtghpthhtohepuggrnhhivghlrdhlvgiitggrnhhosehlihhnrghrohdrohhrgh X-DCC--Metrics: v370.home.net.pl 1024; Body=5 Fuz1=5 Fuz2=5 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Rafael J. Wysocki Commit 670a5e356cb6 ("thermal/core: Move the thermal zone lock out of the governors") moved thermal zone locking away from governors, but it forgot about the user space one which deadlocks now. Fix this by removing the thermal zone locking from the user space governor. Fixes: 670a5e356cb6 ("thermal/core: Move the thermal zone lock out of the governors") Tested-by: Rafael J. Wysocki Signed-off-by: Rafael J. Wysocki --- linux-next material --- drivers/thermal/gov_user_space.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) Index: linux-pm/drivers/thermal/gov_user_space.c =================================================================== --- linux-pm.orig/drivers/thermal/gov_user_space.c +++ linux-pm/drivers/thermal/gov_user_space.c @@ -34,7 +34,8 @@ static int notify_user_space(struct ther char *thermal_prop[5]; int i; - mutex_lock(&tz->lock); + lockdep_assert_held(&tz->lock); + thermal_prop[0] = kasprintf(GFP_KERNEL, "NAME=%s", tz->type); thermal_prop[1] = kasprintf(GFP_KERNEL, "TEMP=%d", tz->temperature); thermal_prop[2] = kasprintf(GFP_KERNEL, "TRIP=%d", trip); @@ -43,7 +44,7 @@ static int notify_user_space(struct ther kobject_uevent_env(&tz->device.kobj, KOBJ_CHANGE, thermal_prop); for (i = 0; i < 4; ++i) kfree(thermal_prop[i]); - mutex_unlock(&tz->lock); + return 0; }