Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6455991rwb; Mon, 5 Dec 2022 12:37:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf6cg+O2ZrhHbl7euyFhL7CRv1a4pN2cmZ21MM5quUzfN01V5gbI3CTCz7/USvdUaPz4uH2y X-Received: by 2002:a17:902:ce90:b0:186:d89d:f0aa with SMTP id f16-20020a170902ce9000b00186d89df0aamr80670747plg.50.1670272639449; Mon, 05 Dec 2022 12:37:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670272639; cv=none; d=google.com; s=arc-20160816; b=r0p1h7uAw5EVkFm5JZSsYAQYjdU/3aPNtlxqgZbKYN/8dGGAzfX4oqnwhdPuBY1JyM YtoP9uOKLSGdnyn18Dlw0WRkDmlzAaZb/TY06qHFjaGtnrebSIxlZCIyogsiLfJe9nzm pzLktQtlVX2gkOCL35yFkPUscAcvY6XtL6nE2CuYQn6CmvzxargMQd3OsF8mv7sobMyy c+PhAbqqvwMAdFP88pg4nUUgyIyCjrcWPqyaBKodDWSiy5Jw0RuddNwZ7CASyyo070iX bvEx0l/fqoH0CCkoNztFGr246K6mMPWOjBsC2Qjnr/My58VCFS5FopQWmffxY7Ub8Zr8 53OQ== 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=7pzik94DCRnikniychtCYn/if7UtyQkTWFCyd0BXZAs=; b=Fz5IZtbxITrIOo1KD71ImMlVmOL67pvgjeA+QqXkB+jbNuYFDa8jOoF3yVFK7PbSmG Tb6oHq8OGAS1okL6F4yZ/x2SwwMYLcyjDABubg3me6c6uJlvEiGP4x2oq+mQuUZ8HxHU x514qyRkGYMOFlGb13kMd0YkxCAUf1wDZTBuRg9LP7P0flv0SfYHVMIT48k2h7TpSNYa oEQ1tydUzhqz8HfybA31rmJXPvO1MJ97KYsNyPxAWtmvAUDQn6imxFEtVg7R8BS0bEf8 PRzNP9xcFhgvyPUROVgL5vueEGuBq832Yi2w8bo3hQ/MsGBzLpo487MdKytnIiH5rjWY S8sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mPhxALAd; 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 a8-20020a1709027e4800b00189c1b73636si8059978pln.71.2022.12.05.12.37.08; Mon, 05 Dec 2022 12:37:19 -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=mPhxALAd; 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 S234729AbiLETmY (ORCPT + 80 others); Mon, 5 Dec 2022 14:42:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234868AbiLETly (ORCPT ); Mon, 5 Dec 2022 14:41:54 -0500 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70996DFA8 for ; Mon, 5 Dec 2022 11:39:33 -0800 (PST) Received: by mail-wm1-x332.google.com with SMTP id n7so9581123wms.3 for ; Mon, 05 Dec 2022 11:39:33 -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=7pzik94DCRnikniychtCYn/if7UtyQkTWFCyd0BXZAs=; b=mPhxALAdZmhXA3LNUW3pO/6N9g17MLwyztZmXWZVb6a+DOYDAztdnk9+7GRr2lj+ON g3Y0gaqlIYyK/dkcOudswwzJYkV4QDFemDAKFOZfsxvEDrRuEjyHENJguwDr9rneRstQ Ys/AJ4BPPEWzUWUgGjyHCjTxK4WjajfsVRjLXweIKCPHc4b78j6VizaBs97dSVp/C2Wr DutF4W6xrJ9/AQ15NTZHpvCKMvVTx0MJokJnFrUyyrCJn29dWhmWmnTYaJIQAYF8vkik kVbQT0V0Gi2ZLbKIsBVfaoZJYRpYr41h4whRPg/iNg0swzNE/nmLIdcYYFZ9ixr3heC+ uHGw== 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=7pzik94DCRnikniychtCYn/if7UtyQkTWFCyd0BXZAs=; b=uLIq58/SAWhtSrujkfuYfCiRFH91LnxghhFJoYbMb62EjoCfIZupYxYkxTkJz7IuYr fteJsLZFMnuHMs3fOLgb8nsy5r0TUtSp5DQygFO0C/1hg9VjUepOI1tOpJ+xtemCJCo5 btcTjeHOJku91MRCmMLqOyn6cRCJkkW2y4S2v0TofCOG/dvbBqE0A6fReU2KV6gc4M1y ENk/BOiyYgA85EyzkSmytoiW3+3J2GD+O7/ajfqOHWfOf4iRdiGLYpwlRzi/ujk7Qvrq cR/OJ+QVctlV+yoTyKwkyS0B/8stzLoRfhQzAODaT6WKDfyifV0grpqboXi4cv73xlmn lZvw== X-Gm-Message-State: ANoB5pna2IYy4EyqTCfCaNpgpsZVNQKVy4meblBf9nzHok7/VKnGu2jz BR0IAsQ84uHscbu0q/XQ2IsSuw== X-Received: by 2002:a05:600c:1da2:b0:3cf:147d:ad9a with SMTP id p34-20020a05600c1da200b003cf147dad9amr48581382wms.33.1670269171966; Mon, 05 Dec 2022 11:39:31 -0800 (PST) Received: from [192.168.10.46] (146725694.box.freepro.com. [130.180.211.218]) by smtp.googlemail.com with ESMTPSA id v14-20020a05600c444e00b003a1980d55c4sm23867622wmn.47.2022.12.05.11.39.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 11:39:31 -0800 (PST) Message-ID: Date: Mon, 5 Dec 2022 20:39:29 +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=1.0 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 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. -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog