Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp808585lqj; Mon, 3 Jun 2024 00:59:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX2z7JonX4XzMYcFxNtTqDAMg5UaC0ZBueQMPbmxNXl/8rEsRtkrTnqWxNuGIt28QQLVUlbbCSmJ+pcXeC0HnOsfjlVsYVAjY8oeKuaMw== X-Google-Smtp-Source: AGHT+IGTooGfG9iWYSRSqZNhxuDaWF2Q9bY1oAB6ZFTMOCNhpjIy1DHEC4EVGhNGg77KlkA08k6/ X-Received: by 2002:a17:903:2285:b0:1e2:9aa7:fd21 with SMTP id d9443c01a7336-1f6370a77admr86799965ad.54.1717401587773; Mon, 03 Jun 2024 00:59:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717401587; cv=pass; d=google.com; s=arc-20160816; b=fV+VmadmkFPjCmNGHh7t3riiRmfzgc7JWui24mPPNte6Q1x8fbx4pqYtHXFN6papC6 4WxaZ/EYDKY0e4Ck9LrRNOhYPQx9l8X5wd9DYieN4fKpNcGIWZ1+OwaTqu4aK/S7f00G hzIACaLR/nW98GepmDngNRyq67/ZpMwhf2BvmzejWUAH2E4OMQWab6s1QbQ/1PXGnySC OBD+Vp9aGWBJElKSZCsr67v7XAVBxh42l0A0LsuSFWBt1v2rbZLEK92vCodpZRhBdpSv Wz9gHMfrp3bYM6GY4dg1UhMlKl5V9/CEf4xvX/RYejDM6krEzIo48Q/1J5yYUrq5MvMw lMmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=6kpT2U9u7A3J+3RZvunFCZzWlEPP+Dke4NuhjUNQlWk=; fh=ICI+lsARINrLvVvhR13QnQv33+F2PGlDByVgXjdpJpc=; b=XdL+Gclos5Rs8gcRqPwxBx6bahdWrl3uk75sH3YmXcXE20XRov8qbqHwH4OuSKifR5 Op148dtsBm6q/+kOXgX64KFZ/QrZRFkFTWVVdhzlPfZX2xm/87Zu+JXe4n/H/CbQvyFO 5E/gKiL7gdeVejtpQHpisnP3241wiuybbdKPM6qR3I6EStNCxhZz9oOKYAdYMiJviC1T JnjbPAnF3kbWeovSy7lACtaq1K9Ukb2bLJdkhTJ/c6OOzfcBJqpVXRKP4OdBKXBU19Ii kHug4nrvwrQQa9efEcE0CNeXIZIMkACMLPZsOLr1u3oG/dV1ExULOJX38dGUH/MiksTI pCxQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=so8JI5Uu; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-198750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198750-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6323dd96csi62712755ad.250.2024.06.03.00.59.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 00:59:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=so8JI5Uu; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-198750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198750-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 84FBDB22495 for ; Mon, 3 Jun 2024 07:58:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8879053E31; Mon, 3 Jun 2024 07:58:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="so8JI5Uu" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 48A8753365 for ; Mon, 3 Jun 2024 07:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717401526; cv=none; b=Mc4OFt0P055c/BDFxZH/yvoBuY8R64yoh1X2W2VUkkXbM1HWV3Al+teNzAws4NVRz+3HhpR1IMD5RC4yJD5KElyyd6hIMQxNOntP+q30rrdXKjk5OrMy8rhYaGDKjZloJOPKUoILthI0nb8KQwuRiNaFAd18h1KJYmGrr9oUxTg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717401526; c=relaxed/simple; bh=6kpT2U9u7A3J+3RZvunFCZzWlEPP+Dke4NuhjUNQlWk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=NA16z7gqBWGq5QBsEa5Ic39gdUcvjiNFKi1jnJUMZIqSyaBTyQvG5YUpP3wCnJc0EH/qvjCu1a5t7/JhpZ+ML1lzUUlGzewVBUuAFb74XGXkrEXj1eEMKVsPdiPpSBmujBgM3TQUKS9v8WsYa2AJo/weMW08ul3lDHbKKCggEfE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=so8JI5Uu; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4213b94b8b5so6314685e9.0 for ; Mon, 03 Jun 2024 00:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1717401522; x=1718006322; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=6kpT2U9u7A3J+3RZvunFCZzWlEPP+Dke4NuhjUNQlWk=; b=so8JI5UuIsIiUgWPkuxpZZvjbPG49fCuXuZOqG6IsAmYBexbS6dJfHKvluXGo3xqJP dQLYOzbmFPpM39RtIzXI8BkBoubRWgMsb758T9ZwcXw4jf2FUEXac8LNF2pJiPGVknTG V2cJIsNuFEnJQy+YsSR+FgsFK0ROTiAm769xZrGL1AToD0sM3lMKDuOWb9xRh+WJ06E0 yB0YLjZy9Jx3/UWH8VTRV3S4uIq4EEgM0gtd56pA6GlD19NvVz2shARskex/if2auywS EyuEMM4TUFU43TtS5dayW206pxD4VvMcz9aLqtha+oRYkPpFydebM/fNIG3gdNkhrCmJ Uw0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717401522; x=1718006322; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6kpT2U9u7A3J+3RZvunFCZzWlEPP+Dke4NuhjUNQlWk=; b=T4QETOc20EvqE0kmgbDI3gg5Xt80/WjvNqLz+OitM/y+SxyjU+J07ztKAmYsjsm3at R1LqCqZUuMOA74h+qrpBill5PCu77EnItbo5Dq99MUvU9+or7RavlT2OgHH19+MqDBAV xFYUsjKttO5U/OVIy1ixh4N8IBEtzPUvQv0DfDjfByeuNTdil0KcI/mMKxOj3iilDbcl wtjAX1HjD6uMdNJUSF6mpX+HJRHQpf38xIpgD/xzKdZ3s5U1YeMwHJqsGi6snJS2sbwi ZpiLrWhyG16C8EKRdiOwUC1TJDJ7fMnYBcq4OEX0JDbOAbtbADWwRP/XqeqJIhKYkYFT yCYQ== X-Forwarded-Encrypted: i=1; AJvYcCUFO7P5RNM/EIlAreUU6LVr5Eh8q37aaATYsTU8892MqgY0KwVRGONy1OWXYYkkU41LBXUepR+4RK8FuaeCXdsdhbsBJjsswgePxHAG X-Gm-Message-State: AOJu0YxkDNveHwHcQACQrKUTn5iLOzAqaMQjB6zB0AASYRRbe2UCIDJC 6oadk9sL9BdpR62KzDXbsw0WLCOuaceBL/YhJuoC5mesm3mnP1oDroGL96nqhdg= X-Received: by 2002:a05:600c:3c98:b0:41f:3ee0:a302 with SMTP id 5b1f17b1804b1-4212e0ae746mr68261095e9.30.1717401521650; Mon, 03 Jun 2024 00:58:41 -0700 (PDT) Received: from [192.168.1.70] ([84.102.31.231]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212f0f9660sm97225405e9.39.2024.06.03.00.58.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Jun 2024 00:58:41 -0700 (PDT) Message-ID: <940eec49-91d8-4d38-a3d8-e1b7e090b905@baylibre.com> Date: Mon, 3 Jun 2024 09:58:38 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 4/6] arm64: dts: mediatek: mt8186: add default thermal zones To: AngeloGioacchino Del Regno , Chen-Yu Tsai Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , Daniel Lezcano , Nicolas Pitre , "Rafael J. Wysocki" , Zhang Rui , Lukasz Luba , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-pm@vger.kernel.org, Krzysztof Kozlowski References: <20240529-mtk-thermal-mt818x-dtsi-v6-0-0c71478a9c37@baylibre.com> <20240529-mtk-thermal-mt818x-dtsi-v6-4-0c71478a9c37@baylibre.com> <75826085-fd59-466a-b1de-b4c323c801c1@collabora.com> <808db317-4cee-426b-a840-013a5e03098d@baylibre.com> Content-Language: en-US From: Julien Panis In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/29/24 14:06, AngeloGioacchino Del Regno wrote: > Il 29/05/24 11:12, Julien Panis ha scritto: >> On 5/29/24 10:33, Chen-Yu Tsai wrote: >>> On Wed, May 29, 2024 at 4:17 PM AngeloGioacchino Del Regno >>> wrote: >>>> Il 29/05/24 07:57, Julien Panis ha scritto: >>>>> From: Nicolas Pitre >>>>> >>>>> Inspired by the vendor kernel but adapted to the upstream thermal >>>>> driver version. >>>>> >>>>> Signed-off-by: Nicolas Pitre >>>>> Signed-off-by: Julien Panis >>>> Reviewed-by: AngeloGioacchino Del Regno >>> I'm getting some crazy readings which would cause the machine to >>> immediately shutdown during boot. Anyone else see this? Or maybe >>> my device has bad calibration data? >>> >>> gpu_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:       +229.7 C >>> >>> nna_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:       +229.7 C >>> >>> cpu_big0_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:         -7.2 C >>> >>> cpu_little2_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:       +157.2 C >>> >>> cpu_little0_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:       -277.1 C >>> >>> adsp_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:       +229.7 C >>> >>> cpu_big1_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:       +229.7 C >>> >>> cam_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:        +45.4 C >>> >>> cpu_little1_thermal-virtual-0 >>> Adapter: Virtual device >>> temp1:       -241.8 C >> >> It's likely that your device has bad calibration data indeed. We observed the same >> behavior on the mt8186 device we used (a Corsola) and finally realized that the >> golden temperature was 0 (device not properly calibrated). >> >> To make a comparison, we run chromiumos v5.15 and dmesg output was: >> 'This sample is not calibrated, fake !!' >> Additional debugging revealed that the golden temp was actually 0. As a result, >> chromiumos v5.15 does not use the calibration data. It uses some default values >> instead. That's why you can observe good temperatures with chromiumos v5.15 >> even with a device that is not calibrated. >> >> This feature is not implemented in the driver upstream, so you need a device >> properly calibrated to get good temperatures with it. When we forced this >> driver using the default values used by chromiumos v5.15 instead of real calib >> data (temporarily, just for testing), the temperatures were good. >> >> Please make sure your device is properly calibrated: 0 < golden temp < 62. >> > > Wait wait wait wait. > > What's up with that calibration data stuff? > > If there's any device that cannot use the calibration data, we need a way to > recognize whether the provided data (read from efuse, of course) is valid, > otherwise we're creating an important regression here. > > "This device is unlucky" is not a good reason to have this kind of regression. > > Since - as far as I understand - downstream can recognize that, upstream should > do the same. > I'd be okay with refusing to even probe this driver on such devices for the > moment being, as those are things that could be eventually handled on a second > part series, even though I would prefer a kind of on-the-fly calibration or > anyway something that would still make the unlucky ones to actually have good > readings *right now*. > > Though, the fact that you assert that you observed this behavior on one of your > devices and *still decided to send that upstream* is, in my opinion, unacceptable. > > Regards, > Angelo I've been trying to find some more information about the criteria "device calibrated VS device not calibrated" because there's a confusing comment in downstream code (the comment does not match what I observe on my device). I'll send a separate patch to add this feature over the next few days, when I get additional information from MTK about this criteria.