From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22F7BC4332F for ; Wed, 14 Dec 2022 14:46:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XiGUPGJBtb+DdbWk+652ZsonmuG7WRnm//tc2syJLHI=; b=ul6a2firBk6c6i e1iiTbwbZp7nF5Q9Iu0NOV0ePmJjgy/Ek27GGI4Dao+/v29Hv2e7+qXxUxHCOe7vo/W98p4KhI4Q1 oUH7Yh6IVCeThPVuU/2rOQyvev+SsM5j3APk/lE021pCJHUMxsQ+LC9T9kNeGWMpD+sOuS/caJ+Tn Zt9F9PZys/Q4IRy79J/bixNEbtvC1vhnV3Ab2Yne+l3N0zHLVCrzVsTyCmbeGHr5JEBU9YjRDCbKW gF49AHzv0V93TNEyK6J08qrj0doo3U+YWZFT0JM38TvJhAxkHOH6Wv2N4QneiSPskzsVcRd6oDplX NDCGHBcWpMdQnpQcN/kA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5T0z-00HQMU-7Y; Wed, 14 Dec 2022 14:45:45 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5T0w-00HQIF-In for linux-arm-kernel@lists.infradead.org; Wed, 14 Dec 2022 14:45:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 3930DCE1894; Wed, 14 Dec 2022 14:45:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79B60C433D2; Wed, 14 Dec 2022 14:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671029129; bh=6crdpQu6PnoHcLYg/cjhFX11SdiyxzhNVPnXM3li/Uc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZS5cjf5DnEw77me9L035TN8JwVZmbtVW3QEk3lKQIZ7IPu5izeKXzxHyP7c19oXA1 sZEFm1n91/Rc8LEgmNIEFCiHS0M2jGjUYGg4jkTjsuDPAUkHhqNIogD5/TiS5aRw86 lrF6TGhyp6fEZQMqmwzi4DF8P8qzvdstUeLI3slZSNl6VunCTPQpfQVKqAzAuXRPX4 D69dy1KYDDhCn3ZvsZF46R8hsQw6pBCh+aIxdHhSjYReUYdSH+JbKEvux5knqubHc8 Njoe87mi/TXVQEHNABHDm1orsvjkeKHXgLGjMFJDhyAtDPtU34y33eTItsOCYHdFcY aieSwgo9gusaQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p5T1B-0001nr-Qh; Wed, 14 Dec 2022 15:45:57 +0100 Date: Wed, 14 Dec 2022 15:45:57 +0100 From: Johan Hovold To: Johan Hovold Cc: Daniel Lezcano , "Rafael J. Wysocki" , Amit Kucheria , Thara Gopinath , Andy Gross , Bjorn Andersson , Konrad Dybcio , Zhang Rui , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , Jonathan Hunter , Dmitry Baryshkov , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH 2/4] thermal/drivers/exynos: fix set_trip_temp() deadlock Message-ID: References: <20221214131617.2447-1-johan+linaro@kernel.org> <20221214131617.2447-3-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221214131617.2447-3-johan+linaro@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221214_064542_835365_9A2DFEA4 X-CRM114-Status: GOOD ( 20.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 14, 2022 at 02:16:15PM +0100, Johan Hovold wrote: > The set_trip_temp() callback is used when changing the trip temperature > through sysfs. As it is called with the thermal-zone-device lock held > it must not use thermal_zone_get_trip() directly or it will deadlock. > > Fixes: 169865e317f2 ("thermal/drivers/exynos: Use generic thermal_zone_get_trip() function") > Signed-off-by: Johan Hovold > --- > drivers/thermal/samsung/exynos_tmu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c > index 37465af59262..cf9028f80415 100644 > --- a/drivers/thermal/samsung/exynos_tmu.c > +++ b/drivers/thermal/samsung/exynos_tmu.c > @@ -354,7 +354,7 @@ static void exynos4210_tmu_set_trip_temp(struct exynos_tmu_data *data, > struct thermal_trip trip; > u8 ref, th_code; > > - if (thermal_zone_get_trip(data->tzd, 0, &trip)) > + if (__thermal_zone_get_trip(data->tzd, 0, &trip)) > return; > > ref = trip.temperature / MCELSIUS; As Daniel noted, this patch is not correct as this function is not actually a thermal_zone_device_ops::set_trip_temp callback. Please drop this one. Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel