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 44C44C54EED for ; Tue, 24 Jan 2023 22:28:43 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T4bpCX/0fHCcb8Hm0OmtKwVww0MKdvrdOSQreisBUaY=; b=ClL+9fKYvqd5j/ //ocw35Ur1nFt0cPPgzwMXzJgI5V44udu0VraZdNI6LGC7Odp7BYFIx4zy2kN5EJH8fpNcTcbG5bD xYLs58wwdBNMEElop2R+VZDpqG/g6C7SR3PheG7RuydM6Gj301UA4wQ6RbfPINmN9tBuahKZJuMaH Hfg7o7FqdX4P52yGFiHl0IKX/bsxUJ3CT8pOMXJ5L5HyYDw1Av3pk36J1wI/7XAdlaAWGVkBpnCO2 bp6eVTM1rm4uh/pw2FESbJKIOSKLhRY1Bj/jO1gOft+8V4tyyuYSg2M3FYMKm+PaUvDp6nwdqb5VF GqRzcTIdhtrp35OSZJwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKRle-005Uwm-Qi; Tue, 24 Jan 2023 22:27:50 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKRlY-005Uvl-Ok for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2023 22:27:47 +0000 Received: by mail-wm1-x32a.google.com with SMTP id q8so12518471wmo.5 for ; Tue, 24 Jan 2023 14:27:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fmjm3Z829U3eQ0HD7RpgQ6QYQN7YmYNmxztlfIbUa3s=; b=qKkFDQZcyvsrKMBBuR0L3F2Ue12BBua/+IGpL5PYXj42IfmbIk7GCNpjsGTlNboBY+ hrNhUkQ0Y1o9KCcyi9g1jHGP/fqYc+/C/78N7UBBxLy1EOZvLLnu7nSQDTu0dwQQkJci kWp57evylzpB6O50bYTtbZJ0+RCzKQjSVciZVsUi76gk11ghiNlp2Ui6o81SnI1RlLOy L2H2kt8CXzswNirTU7/a24Cg76KG+SXjXZoh7KaCZig7wS8WuMrSAjqFqpSy9EbSO1V7 SqF39G7nuhjAPXZETrPN8FNyTi+CMhanYURNGqvyt9mu5XWOjgdYzXHSCWyUQHTOuTD/ y3zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fmjm3Z829U3eQ0HD7RpgQ6QYQN7YmYNmxztlfIbUa3s=; b=22WiCN/1fKfI3tCOaoUK+lk1C1is8xr9S0+dlG87qQOrCu5kZZo/u2ckHkNQ46Stut H6o8dQjj82gV3c0mixGJkJuPt/1eZZvMJHCrRaFk4I4bzLFWgOpZRg1b4Uc3Ipg9oQJd q0rze9uMeC+K1/7auzjCgJ3u/NTkRZAd/ORcwfHXBKIkH5FYtACX9OzuGHfTlsPj3Gs8 SkBsM4NluBaklTY0FqGLVt7Xg5K1J+bcIz13tyW2c4fQSdCWR8FdK4+q9Jfd7FuFiuCg 1cWgq7T+3ms/Q7PNkpA2UyjYydZ8C+aaIBGWwMNEJ8pmeiNv8bKMaiu+Q9V30qkyUkbi JTTw== X-Gm-Message-State: AFqh2kpCN40c/ccRL4biQ6JCSeJC+iliUTiH/mPFpUT5PEN0GRjFZaDW 3slPOveGqRVErXbtT7Kkkb/hgg== X-Google-Smtp-Source: AMrXdXtUIhIbk+FfYfm8bkmmKEpk9WmMbkLiISQPuqi+mTwK8Cf7fynMGVuZBW+nCEzqHn41DSs8cA== X-Received: by 2002:a05:600c:3512:b0:3db:1665:2a98 with SMTP id h18-20020a05600c351200b003db16652a98mr24655553wmq.16.1674599262543; Tue, 24 Jan 2023 14:27:42 -0800 (PST) Received: from [192.168.0.20] (62.213.132.195.rev.sfr.net. [195.132.213.62]) by smtp.gmail.com with ESMTPSA id bd25-20020a05600c1f1900b003dafa04ecc4sm105977wmb.6.2023.01.24.14.27.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Jan 2023 14:27:41 -0800 (PST) Message-ID: <0b5e3a14-fd23-4646-d4cb-df255eb8fa20@baylibre.com> Date: Tue, 24 Jan 2023 23:27:40 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH v7 4/4] thermal: mediatek: add another get_temp ops for thermal sensors Content-Language: en-US To: Daniel Lezcano , "Rafael J. Wysocki" , Amit Kucheria , Rob Herring , Krzysztof Kozlowski , Zhang Rui Cc: AngeloGioacchino Del Regno , Fabien Parent , Matthias Brugger , Markus Schneider-Pargmann , linux-pm@vger.kernel.org, Rob Herring , Michael Kao , linux-kernel@vger.kernel.org, Hsin-Yi Wang , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org References: <20221018-up-i350-thermal-bringup-v7-0-ebf08ff2eddb@baylibre.com> <20221018-up-i350-thermal-bringup-v7-4-ebf08ff2eddb@baylibre.com> <4121bb6b-30db-7a23-f4c8-40afdda7a0b5@linaro.org> <0644aede-c281-3919-50e0-4466f6587d81@linaro.org> <187b0fe1-1f14-d8b8-c827-1e824da0b1d3@baylibre.com> <9f9547a2-69dd-f91d-c587-289156bf9d55@linaro.org> <2950b824-ad2f-2579-a956-a03d157453eb@baylibre.com> From: Amjad Ouled-Ameur In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230124_142745_068773_8DC723C7 X-CRM114-Status: GOOD ( 18.55 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 1/24/23 18:55, Daniel Lezcano wrote: > On 24/01/2023 18:46, Amjad Ouled-Ameur wrote: >> >> On 1/24/23 17:54, Daniel Lezcano wrote: >>> >>> Hi Amjad, >>> >>> On 24/01/2023 11:08, Amjad Ouled-Ameur wrote: >>> >>> [ ... ] >>> >>>>>> >>>>>> IIUC, there is a sensor per couple of cores. 1 x 2Bigs, 1 x 2Bigs, 1 x 4 Little, right ? >>>>> >>>>> MT8365 SoC has 4 x A53 CPUs. The SoC has 4 thermal zones per sensor. Thermal zone 0 corresponds >>>>> >>>>> to all 4 x A53 CPUs, the other thermal zones (1, 2 and 3) has nothing to do with CPUs. The cooling device type >>>>> >>>>> used for CPUs is passive. FYI, thermal zones 1, 2 and 3 are present in the SoC for debug-purpose only, they are not supposed >>>>> >>>>> to be used for production. >>>>> >>>> After reconsidering the fact that zones 1, 2 and 3 are only used for dev/debug, it might be best to avo > >>>> aggregation as you suggested, and keep only support for zone 0 in this driver. Thus I suggest I send a V8 >>>> >>>> where I keep only below fixes for this patch if that's okay with you: >>>> >>>> - Define "raw_to_mcelsius" function pointer for "struct thermal_bank_cfg". >>>> >>>> - Fix "mtk_thermal" variable in mtk_read_temp(). >>>> >>>> - Set "mt->raw_to_mcelsius" in probe(). >>>> >>>> >>>> For zones 1, 2 and 3 we can later add a different driver specific for dev/debug to probe them to >>>> >>>> avoid confusion. >>> >>> You can add them in the driver and in the device tree, but just add the cooling device for the thermal zone 0. >> >> Thermal zone 0 uses CPU{0..3} for passive cooling, in this case we should register cooling device with >> >> cpufreq_cooling_register() for each CPU right ? > > No, the OF code device tree does already that. You just have to register the different thermal zones. > > Do you have a pointer to a device tree for this board and the thermal setup ? Sure, here is a dtsi for MT8365 SoC which contains thermal nodes [0]. [0]: https://lore.kernel.org/linux-arm-kernel/20220531135026.238475-17-fparent@baylibre.com/#Z31arch:arm64:boot:dts:mediatek:mt8365.dtsi > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel