Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1870381rwb; Wed, 5 Oct 2022 06:07:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7npQuLat6qVhWPWjkynQkIOyams0QDXWe2fwt+JCnkDAeAUzjQakrNJ+rM/jNK7Um9aTYY X-Received: by 2002:a17:907:6d9c:b0:783:a3b4:2cf5 with SMTP id sb28-20020a1709076d9c00b00783a3b42cf5mr22826785ejc.216.1664975272482; Wed, 05 Oct 2022 06:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664975272; cv=none; d=google.com; s=arc-20160816; b=yqUaCsuEeJdNT7eZdGX1hiGSYSIfxbt4G27KtHuYZZD6rur5sQM6iw6edtpozonITn NvNPttkp76NZfHQzT7GCQgjpJCmQyHJrNvsVkbPfIV1YlSeIZpKbDNfNcW1MvsyfPHXb 3wu6++q8LxHaLXbjkoeSgNH3leY2GZoJ635UXDhgQAJW5tC/RC2bKmeDrG9p8Gxmxx20 EHkM496G4cNNKy2t1JqRay+3IHLS8WZC7x9x85J14/zhyChp52oPrUsSWZTQX/UjqK5x Cwad/ofyvf0/LDzp6oz5ll8LpbLOUetJsBKjQ6IFkdXhl7qEnd1GWkdIL1uDhOco3BdS Niog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=cShw/3LGlylN+4jJotpQbuNoLk30Zznf4m8prglpDWE=; b=z1IVZxolsgjG1yst1tVV2b3T1c10EJMqHn4lL+dFE4P5YGcTBu+pY9mVyHjy6//OcI 5oVyFXWiqBrG/qBUX6lSiVXw9Azr+1S/kkb23wmxqeo4WezGxUSzSfGxs0Og3kjB1KBQ 6p/DuIhib2N65VH/xaLAMgOfJ6i57Tdw97L+cCXZ8mKqhOAmbk16t88UmqoegFguVOB1 ydfdboS9WEjFYBZUIyt2sldMLU20+HbUAhI8/bJEn8WqnfQoJch4UOPctGlJOvKXKxco ULuVl+xXyjStmS+DM4JLbwvhM9rx75Aj8fMg6G8/w4hS87h8vyNzj1VVDyO23kv86Kyx IRhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="S/UHF0e2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne17-20020a1709077b9100b007820e1a4302si17647729ejc.675.2022.10.05.06.07.24; Wed, 05 Oct 2022 06:07:52 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b="S/UHF0e2"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiJENFx (ORCPT + 99 others); Wed, 5 Oct 2022 09:05:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbiJENFv (ORCPT ); Wed, 5 Oct 2022 09:05:51 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E868D220E1 for ; Wed, 5 Oct 2022 06:05:47 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20221005130543euoutp02fe92a20496e5525ab521f37e004afcc4~bLhJS0Ysp0623906239euoutp02x for ; Wed, 5 Oct 2022 13:05:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20221005130543euoutp02fe92a20496e5525ab521f37e004afcc4~bLhJS0Ysp0623906239euoutp02x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1664975143; bh=cShw/3LGlylN+4jJotpQbuNoLk30Zznf4m8prglpDWE=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=S/UHF0e2phRkGiCF0XGwtynhMSI6OuPOWGnyUO31/4azPx9Fd/P482Gl+oVJELhmQ 4jSqwCm04jceqZqXx7ZIDlc124H3kU9UGzGKbKQ0r9kZHRmSgCpFwDeWXGZJSZtX8T i62BfLpu0Uya4Uk6HTG2BvfShkSGvcgkGRaYS9oA= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20221005130543eucas1p1aed6763fdecb50ca11125c7eec2cbbf0~bLhI6xuMy3238032380eucas1p14; Wed, 5 Oct 2022 13:05:43 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 1B.A2.29727.6218D336; Wed, 5 Oct 2022 14:05:42 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20221005130542eucas1p1a50cb2c3ee56c7c6b3b78f9d4b191abf~bLhIInLdI3061230612eucas1p19; Wed, 5 Oct 2022 13:05:42 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221005130542eusmtrp2fa51b0c29199130127621c85d53fce3c~bLhIHmN630188401884eusmtrp2Y; Wed, 5 Oct 2022 13:05:42 +0000 (GMT) X-AuditID: cbfec7f2-205ff7000001741f-4f-633d81261c13 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BA.2D.10862.6218D336; Wed, 5 Oct 2022 14:05:42 +0100 (BST) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221005130541eusmtip25243c5df6e3b8a7331bd5ea6df42850f~bLhHDpACD0498804988eusmtip2d; Wed, 5 Oct 2022 13:05:41 +0000 (GMT) Message-ID: <207c1979-0da2-b05d-fead-6880ad956b90@samsung.com> Date: Wed, 5 Oct 2022 15:05:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v8 00/29] Rework the trip points creation Content-Language: en-US To: Daniel Lezcano Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, rui.zhang@intel.com, Broadcom Kernel Team , Support Opensource , Pengutronix Kernel Team , NXP Linux Team , Andy Gross , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski , Alim Akhtar , netdev@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, rafael@kernel.org From: Marek Szyprowski In-Reply-To: <851008bf-145d-224c-87a8-cb6ec1e9addb@linaro.org> Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkk+LIzCtJLcpLzFFi42LZduznOV21Rttkg9/XrS3OPf7NYvFg3jY2 i7W9R1ksvm+5zmQx77OsxaqpO1ks9r7eym6x6fE1VouJ+8+yW3T9WslscXnXHDaL2Uv6WSw+ 9x5htNj68h2TxcTbG9gtZpzfx2TR+W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Phn7N6RvLljdZqM9uFwg+K7eW41zayWv3UMdkV+n7np305rbdGb t7tCMuctC7JT2X7EV3mP2PRd+xP61F8/NJB9vf1I0+KwwILXh3j22pbOLnhya8YOsRa7yJzF cj45z6adV2Ipzkg01GIuKk4EAIdUMlKmAwAA X-CMS-MailID: 20221005130542eucas1p1a50cb2c3ee56c7c6b3b78f9d4b191abf X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20221003092704eucas1p2875c1f996dfd60a58f06cf986e02e8eb X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20221003092704eucas1p2875c1f996dfd60a58f06cf986e02e8eb References: <20221003092602.1323944-1-daniel.lezcano@linaro.org> <8cdd1927-da38-c23e-fa75-384694724b1c@samsung.com> <851008bf-145d-224c-87a8-cb6ec1e9addb@linaro.org> X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS autolearn=unavailable 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 On 05.10.2022 14:37, Daniel Lezcano wrote: > > Hi Marek, > > On 03/10/2022 23:18, Daniel Lezcano wrote: > > [ ... ] > >>> I've tested this v8 patchset after fixing the issue with Exynos TMU >>> with >>> https://lore.kernel.org/all/20221003132943.1383065-1-daniel.lezcano@linaro.org/ >>> >>> patch and I got the following lockdep warning on all Exynos-based >>> boards: >>> >>> >>> ====================================================== >>> WARNING: possible circular locking dependency detected >>> 6.0.0-rc1-00083-ge5c9d117223e #12945 Not tainted >>> ------------------------------------------------------ >>> swapper/0/1 is trying to acquire lock: >>> c1ce66b0 (&data->lock#2){+.+.}-{3:3}, at: exynos_get_temp+0x3c/0xc8 >>> >>> but task is already holding lock: >>> c2979b94 (&tz->lock){+.+.}-{3:3}, at: >>> thermal_zone_device_update.part.0+0x3c/0x528 >>> >>> which lock already depends on the new lock. >> >> I'm wondering if the problem is not already there and related to >> data->lock ... >> >> Doesn't the thermal zone lock already prevent racy access to the data >> structure? >> >> Another question: if the sensor clock is disabled after reading it, >> how does the hardware update the temperature and detect the programed >> threshold is crossed? > > just a gentle ping, as the fix will depend on your answer ;) > Sorry, I've been busy with other stuff. I thought I will fix this once I find a bit of spare time. IMHO the clock management is a bit over-engineered, as there is little (if any) benefit from such fine grade clock management. That clock is needed only for the AHB related part of the TMU (reading/writing the registers). The IRQ generation and temperature measurement is clocked from so called 'sclk' (special clock). I also briefly looked at the code and the internal lock doesn't look to be really necessary assuming that the thermal core already serializes all the calls. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland