Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6137899rwl; Thu, 29 Dec 2022 08:02:59 -0800 (PST) X-Google-Smtp-Source: AMrXdXut+wUqYxzTtaN+2U7zpVsMDatjXsmxFrDkeX/wS+YKn/N54F1NSmtiGkC3EDx6t+MolaTN X-Received: by 2002:a17:906:cd1a:b0:801:d0bc:f616 with SMTP id oz26-20020a170906cd1a00b00801d0bcf616mr34552479ejb.62.1672329779382; Thu, 29 Dec 2022 08:02:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672329779; cv=none; d=google.com; s=arc-20160816; b=JHWoX6DwE2XJ9CFqOVUkMTBUWxDdW4Y6U5UrqwLFw3HODUYHFgpxbsuTXM34nSl94V vd4eorTwll7VHghqj/7vJlFxIDSBChxVGolk2m+QLP3VxeV71pLrXFk29xwU9fd/I0gr Bs/KD7lip3GzltraY4lY8TI9eS1jKljo6naMf4zb8ZK12d9yGd3F3vDsRE6FHaQCoDWx KVlBOEhwV+Uj7cV7o3408CgnQ6p4N81tZRKbmuI/JVRx08UXwVONEb7MnSLmC2iD1T0w 6akybigRLqqWD8x+guM8lW9/OeL/1E+RMUjdwevAcAS3rYDMtCxFsnkJOoTJM73VxwUD tJMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=OcHD+68JKivFTNKn8cO/CBcZZAARu6aqYEBF3jaYXXY=; b=vWCu8FJJy+ZPKlD4wDP6D+E60Bvh9faOkHwk8j4MJoTZKn/0MGEYAUfPM8RAiUeqTl 7xroGGzJCbbe32ryWnneCQY1EnfQS/L8AV0ddNVKd5WNe9oZ7KArLNjS1d+Nac2ljCi5 F3CVH5SqOGGMOoKwVkVrZYgqRl/wfWGRG2/V839I3HRAbOCkRlijTmCkHGwmMPUl8iXL E06VDxHyEcm14pRB8Era+XZEAPnKShYBQpaLph1a7O5X/2pvEoBH6Mwf4g+0+/wcelKz 8Kl1/qxj5jnGOgOPzcgXowIV3glj5JtAB3RUwgR5qgZd8OpTMJXVejvwWWTxSGhWS3cw n4+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="wov4t/Dp"; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt20-20020a1709072d9400b007c0fa2e0f9fsi17215003ejc.133.2022.12.29.08.02.44; Thu, 29 Dec 2022 08:02:59 -0800 (PST) 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=@linaro.org header.s=google header.b="wov4t/Dp"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233287AbiL2PtU (ORCPT + 62 others); Thu, 29 Dec 2022 10:49:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229831AbiL2PtT (ORCPT ); Thu, 29 Dec 2022 10:49:19 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5269D13DD2 for ; Thu, 29 Dec 2022 07:49:17 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id g25-20020a7bc4d9000000b003d97c8d4941so7940531wmk.4 for ; Thu, 29 Dec 2022 07:49:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=OcHD+68JKivFTNKn8cO/CBcZZAARu6aqYEBF3jaYXXY=; b=wov4t/Dp6UbuGwqLvgc4vMkRfInBScyFz5VfMRxkFh9qxszC85YMpmSHny1gXPrVsS g32f4reKOVtWQMJ8tXOoxbkRbjZCZ1m5SUTFsEeNVyo3qe4fzbUv7mzyONTfBVWN/ygF VCv0lEJwgaS8OQpQtH1AmoCHEbO8WSsmtXkJwQMKbTVyQhOUnzPNh5aURydy23AIStHq 7IW6dSqOnW/cLTthbtNHuMUuvGcSnsN4MUGA1Z6MgEXnnWMIIXtkOr33tpHLHB4icRu/ EKo8oFJTgXBFfNfzRgvO95/Kqn05D0Qao4eQAzZ4kyo7nkuPJ1BIRmhp7+wC87dbet08 SVKw== 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=OcHD+68JKivFTNKn8cO/CBcZZAARu6aqYEBF3jaYXXY=; b=V+5fJa0ltiqbq20VDBnyYlH7zU5ytN9AvK/QKG4AHzykwIbBkEN7mtq7+dKcNlEmyJ h4RkmTTqqo8/QaPpRwCXHFInF7XfRJgG8u5GvZEKA5T21zCx0vwFV0lO8/KYHq9ioRuu cXb565NOoRYUsrX2CCdZEdksQNeYUNPq5GzRa3mqnA7HUiDhrCM/hR3UIju+W2mPi8FS L/B2AfiLPMi3oTW3vHPp/E8d/TqjxCVWWnXX9EaCtBnK02g1y9ECotQe+dRBorzVe+Qh b+89O74sJFHLWlBhtseS9t6u30RzCoXDECSSEgpDIuMNEl7pVljLCT+uhxvCPlywISMa qsCA== X-Gm-Message-State: AFqh2kraoPJjeQLKtj1kKN49QZnzzemH7WgWamC353zhcOv9D54PaXE8 wcgjo+szyHj9F5IT63omdzuPMg== X-Received: by 2002:a05:600c:3b02:b0:3c7:18:b339 with SMTP id m2-20020a05600c3b0200b003c70018b339mr25804533wms.37.1672328955770; Thu, 29 Dec 2022 07:49:15 -0800 (PST) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id d10-20020a05600c3aca00b003d34faca949sm24381530wms.39.2022.12.29.07.49.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Dec 2022 07:49:15 -0800 (PST) Message-ID: <0644aede-c281-3919-50e0-4466f6587d81@linaro.org> Date: Thu, 29 Dec 2022 16:49:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH v7 4/4] thermal: mediatek: add another get_temp ops for thermal sensors Content-Language: en-US To: Amjad Ouled-Ameur , "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> From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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 06/12/2022 10:18, Amjad Ouled-Ameur wrote: > Hi Daniel, > On Mon Dec 5, 2022 at 8:39 PM CET, Daniel Lezcano wrote: >> >> Hi Amjad, >> >> >> On 05/12/2022 11:41, Amjad Ouled-Ameur wrote: >> >> [ ... ] >> >>>>> @@ -1161,11 +1197,24 @@ static int mtk_thermal_probe(struct platform_device *pdev) >>>>> >>>>> platform_set_drvdata(pdev, mt); >>>>> >>>>> - tzdev = devm_thermal_of_zone_register(&pdev->dev, 0, mt, >>>>> - &mtk_thermal_ops); >>>>> - if (IS_ERR(tzdev)) { >>>>> - ret = PTR_ERR(tzdev); >>>>> - goto err_disable_clk_peri_therm; >>>>> + for (i = 0; i < mt->conf->num_sensors + 1; i++) { >>>>> + tz = devm_kmalloc(&pdev->dev, sizeof(*tz), GFP_KERNEL); >>>>> + if (!tz) >>>>> + return -ENOMEM; >>>>> + >>>>> + tz->mt = mt; >>>>> + tz->id = i; >>>>> + >>>>> + tzdev = devm_thermal_of_zone_register(&pdev->dev, i, tz, (i == 0) ? >>>>> + &mtk_thermal_ops : >>>>> + &mtk_thermal_sensor_ops); >>>> >>>> Here you use again the aggregation >>> I addressed this concern in V6, could you please take a look and let me >>> know what you think [0]. >>> >>> [0]: https://lore.kernel.org/all/5eb0cdc2-e9f9-dd42-bf80-b7dcd8bcc196@baylibre.com/ >> >> May I misunderstanding but AFAICS, this patch is setting the >> mtk_thermal_ops if the sensor id is zero. The get_temp is computing the >> max temperature in this ops which is what we don't want to do. > > Correct, but I think that is out of scope of this patchset, as the current > driver already uses mtk_thermal_ops for sensor 0. The focus of this patchset > is to add support for the other sensors. > > Besides, what do you suggest as a clean implementation if the current one > no longer meets thermal core requirements ? IIUC, there is a sensor per couple of cores. 1 x 2Bigs, 1 x 2Bigs, 1 x 4 Little, right ? If it is the case, then a thermal zone per sensor with the trip points and a cooling device for each of them. The two thermal zones for the big will share the same cooling device. The little thermal zone will have its own cooling device. If there is the GPU, then its own cooling device also with devfreq. >> Linaro.org │ Open source software for ARM SoCs >> >> Follow Linaro: Facebook | >> Twitter | >> Blog > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog