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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BBEEC001B2 for ; Wed, 14 Dec 2022 13:19:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238563AbiLNNTD (ORCPT ); Wed, 14 Dec 2022 08:19:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238446AbiLNNS5 (ORCPT ); Wed, 14 Dec 2022 08:18:57 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E53EAEE16; Wed, 14 Dec 2022 05:18:56 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 989F0B818B1; Wed, 14 Dec 2022 13:18:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43BDEC433D2; Wed, 14 Dec 2022 13:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671023934; bh=I3NjFkga/P0GdNEJyAvlKrNR4+s/YWzEm5lbyRY0s9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e2WaLz9uLD0YeDJNA+Ip5rqhGSXG1u8qeishyJFdMYLR6Q4x2qHmyPIxxxb5STvGM A/G5AzxETsvPhBcetsWvZUtJipLXsjwDoDXwif3Wi1NdluMHisdWXhaROrgnmVs5eV XB+913GHKWDIleY8/bmovAaooXU5CJk+5jxkG5EewY6aaaF4Kj1t8DzP8MzeoHnpxh Z6NzORvKUPLloBA4ok1WE85k7cJZWuR9mD/2FAakMLTfbTGaCc08HkNIPhxAFvdatL cxbqlyACrKBkyTZBicZB6GTYFHuLEAP5mA/ccsZXdtdB8lT1vjB50P3vCOj5Q221nb qY++E7gwzKEoA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p5RfO-0000gK-Hc; Wed, 14 Dec 2022 14:19:22 +0100 From: Johan Hovold To: Daniel Lezcano , "Rafael J. Wysocki" Cc: 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, Johan Hovold Subject: [PATCH 2/4] thermal/drivers/exynos: fix set_trip_temp() deadlock Date: Wed, 14 Dec 2022 14:16:15 +0100 Message-Id: <20221214131617.2447-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221214131617.2447-1-johan+linaro@kernel.org> References: <20221214131617.2447-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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; -- 2.37.4 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 A4E01C4332F for ; Wed, 14 Dec 2022 13:31:57 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mWJLKuYsvAHJhIB6czb/HZ9OLUgeKshQSq66EZEI8c8=; b=kwSixwI1XY+j1w 8FKlMAN5QGbjeLpYzBP1WQueiWWFmWL2kzmq6NbFobx5wvkKdIYOeMSBq6p6Ew5t2mk5KHe3onuPy I2eQ0IuYGWc7Rhhltkka7+hj/O2qRIj2DHHEIQwwX0UA/Fr/+ORnPjlHAqayfiCzULQTRMttNMtBm tXGewxtJdZiGd4ikEqidq/4iNW5aRGRJLUjrpntu7zi1j3yMLVPtfmg++X1/iTgZIimQ24RxsJQCE G22BFlzKxAzY7sBruNjOebaBfS+sAV4n37UKxHxkKfttiO9owppbFLD04edc6Q9F3Glxq4Qa2AVje SOeK6X7Ke9Dh+wd54ugA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5RqU-00GmHg-V2; Wed, 14 Dec 2022 13:30:51 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5Rez-00GfSa-Lc for linux-arm-kernel@lists.infradead.org; Wed, 14 Dec 2022 13:18:59 +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 ams.source.kernel.org (Postfix) with ESMTPS id CF07CB81694; Wed, 14 Dec 2022 13:18:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43BDEC433D2; Wed, 14 Dec 2022 13:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1671023934; bh=I3NjFkga/P0GdNEJyAvlKrNR4+s/YWzEm5lbyRY0s9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e2WaLz9uLD0YeDJNA+Ip5rqhGSXG1u8qeishyJFdMYLR6Q4x2qHmyPIxxxb5STvGM A/G5AzxETsvPhBcetsWvZUtJipLXsjwDoDXwif3Wi1NdluMHisdWXhaROrgnmVs5eV XB+913GHKWDIleY8/bmovAaooXU5CJk+5jxkG5EewY6aaaF4Kj1t8DzP8MzeoHnpxh Z6NzORvKUPLloBA4ok1WE85k7cJZWuR9mD/2FAakMLTfbTGaCc08HkNIPhxAFvdatL cxbqlyACrKBkyTZBicZB6GTYFHuLEAP5mA/ccsZXdtdB8lT1vjB50P3vCOj5Q221nb qY++E7gwzKEoA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1p5RfO-0000gK-Hc; Wed, 14 Dec 2022 14:19:22 +0100 From: Johan Hovold To: Daniel Lezcano , "Rafael J. Wysocki" Cc: 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, Johan Hovold Subject: [PATCH 2/4] thermal/drivers/exynos: fix set_trip_temp() deadlock Date: Wed, 14 Dec 2022 14:16:15 +0100 Message-Id: <20221214131617.2447-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.37.4 In-Reply-To: <20221214131617.2447-1-johan+linaro@kernel.org> References: <20221214131617.2447-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221214_051857_904201_13358A17 X-CRM114-Status: GOOD ( 13.65 ) 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 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; -- 2.37.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel