From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8F692264C0 for ; Wed, 19 Aug 2026 05:13:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787116420; cv=none; b=NsOT4Rsl/LXX+KazXgCCD0PWk29SbrS0Kx/835qS/q6SAxp3z6KZ7s7Eza39vbBY4pDDgJWkhhMxpVUGxP5HNWoTqe/5mcxq3dP+m7BjAxFxxIdb/owxjgC482pYUnYhCj9NOjP0KRbFMNnEMpGM1KP1HAxRNIb4yDQerfmgfkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787116420; c=relaxed/simple; bh=Hb66b60qnJnSpQBTJoAPDarIN2fbw63I443JMWsCAqY=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=My2mhgzzW8mkIwzj8RwHsMYXrHMw8IS52hJ75knGnO3LpsEFgOJmo1gXQ6baHpILJijUK7d3LGSCTjwWUXaQzG6gJTWIJbfwsp3vOloiyg3xdEBDap3JbQe/HAEoZ1BpalU/PhozEHcGvldlq2sU2rhcGYGAAx1X2BtxtjNS9RY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=UGb08MW7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Z5fAJYcc; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="UGb08MW7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Z5fAJYcc" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67J4v1ox4001542 for ; Wed, 19 Aug 2026 05:13:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= M7fdvEesRmQ1lXoO6VluZzaOF+h3MPh/Thc4yMprxbw=; b=UGb08MW7VT6JT03r gAihtJT4gSZ/cqAN8iDAP99O01HmIpL8djxI4yheiHAMFyGCXBOHLWzZnu/83t6m 8bnxu+iCao5brT4ibSttUfv5ujhLI6TRVQn6fxu6TaXJXK103ggPeGjmkbx7WDJ/ YKVrItn1HmgL7kQIpe44UKDGgs4L0vD9vELUHAAMpzsmnYp33mCjTv5p4PotHfRG sNI2j/2Py659SRqBu9RlQ3A575GlO9XEXKSEJ/WWCqyW8oQprGOgMRI76C7N78Wv HpU9xs4L4NRrGS42TiioBeVUrvHsyRHvZE4SGzSPHguiaF90y3TT67by90ZeG/aZ ajux3A== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g4yfpsdak-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 19 Aug 2026 05:13:37 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-3931cd2e4cbso927178a91.2 for ; Tue, 18 Aug 2026 22:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787116417; x=1787721217; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=M7fdvEesRmQ1lXoO6VluZzaOF+h3MPh/Thc4yMprxbw=; b=Z5fAJYcc7vwR4fptGpLD4oq+mZkF+UfmMa5l/Kt6WnkSmNnV1r3JAIDfspGRT5gjdu IAWfylfsYljlizJLCIRGECYSnbOfH1kMZnSxbgRmklT2Xniowso3eO3GGIk8vGYjpCau oAmKk5qZjKXu3znGVOnciS6kQodIKxE9s7j2gWMJ89AiC/gpj8vjyG+0hnzG646/p7gj u/RUeN8Ynvxd5he4GnEOvp6cMppG6CnMg6aKu0SEu8kEHmsk9dGGLN9COBmDy+tXanb6 b1OBIZLBW2mbBjNessVCphlisKeMAHI8NspCRKijtjXZm/eklOlEX45eNVwsCYntP8ch jpzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787116417; x=1787721217; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:from:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=M7fdvEesRmQ1lXoO6VluZzaOF+h3MPh/Thc4yMprxbw=; b=cap4AHSzNfk5tUdyseAo0eDMDYozK3gYKdisS8e42chjbg7JQxE742G/fTwgET+MzY VaDzcRlGkUoRz2n1lUw+d8QRj+LaTqE0I1N4YXZPvkqaWWbjyi8yA6DRqdJ9fssL4j5l iMAfNKSykkVAhOHtXO1oo7PoL+nCmrTpvpGostCGKcS4lsnf7ENM+FXDGGK1zv5IuPsG usoX9x5df1jHonevB3lv54tsAYRAADpr6WXrgWl+FgBPU4xjLBGZ6CQhsBi0+WOeXf++ VlQLMLunwhRzHZTC7Crx4VW6F0DJO4zwUMh59yDOUH9F8/Fj44C+sb1o81MsMgFWSrrC VH5g== X-Forwarded-Encrypted: i=1; AHgh+RqCic9NEeV00Lv7IH3GBd17rWG3JQIrmxA7z2cUq1lKr31/2K4Iu9sGXi+HE3E3IuPtvsa9DDGTsJUbw8g=@vger.kernel.org X-Gm-Message-State: AOJu0YyfXY6d4jNqor0fzSmqiaL2FEsTWIFmOv5A8ofIDvejdnkMC0X6 uFG95VZaK3z8nukD8CrnESpVBGj1gbsHhxBAklJMdDfC1LGx1fZ602KP89U8wgCXhTxXll/9SSv p0MXwlG7Im8X7iLKh2UwFclNiOFl2JWqYqJJtIo95BJDBj+CXrVKIBbBB6vSkypeo2Bo= X-Gm-Gg: AR+sD12MPLwPa0Q9xvB4TWZ/B279gjnRqL9KMy5OOjFKgSrtFSR/Dv8T9U3u1ODF994 6BxDux/ELWrW4vN1iUvs5wUkxFFGgL4GLgBbLqchbIrLi8J5DoA+NcKCGN0Wy+v2FTot1vgZhr8 55Rv/0zauSC9VNh5Od3G1x8FMDA5bOtSUHOZrXDoYHj+DqipOmqY9yhxkxU848QOk4WJnUUXGXY EqrCYpibqXKBEpHfMunnWgObeD9dTBQ1dfWu3fsoJnkBqvHPDzSTFhcP2CoVJ02hpA0W2rek6gl bwMnJ545Z9zRgPBDadSsHtNgzwM0qCBU7U+RORoAQoYWgDk48wYcRpnyzhic8eqtmTMAB2OD2VQ GMApfQvULzHZ3OECjaWj3w8w= X-Received: by 2002:a17:90b:1e4a:b0:37f:bfd6:8b40 with SMTP id 98e67ed59e1d1-39580a79277mr3732832a91.5.1787116416866; Tue, 18 Aug 2026 22:13:36 -0700 (PDT) X-Received: by 2002:a17:90b:1e4a:b0:37f:bfd6:8b40 with SMTP id 98e67ed59e1d1-39580a79277mr3732756a91.5.1787116416374; Tue, 18 Aug 2026 22:13:36 -0700 (PDT) Received: from [192.168.1.6] ([171.76.87.173]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3957fb4ffb4sm1134903a91.5.2026.08.18.22.13.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Aug 2026 22:13:35 -0700 (PDT) Message-ID: <438eeded-2f5c-41f0-a021-b5476fb16cb7@oss.qualcomm.com> Date: Wed, 19 Aug 2026 10:43:29 +0530 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 4/8] platform: arm64: qcom-hamoa-ec: Add fan RPM query and LUT calibration From: Anvesh Jain P To: Konrad Dybcio , Sibi Sankar , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org References: <20260728-ec_add_more_commands-v1-0-771abd65ee1a@oss.qualcomm.com> <20260728-ec_add_more_commands-v1-4-771abd65ee1a@oss.qualcomm.com> <96411e0c-f357-40d5-81f8-14523836280e@oss.qualcomm.com> Content-Language: en-US In-Reply-To: <96411e0c-f357-40d5-81f8-14523836280e@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: i4Vd2aoaIoH6PplKxYuGDW96ZZr8HLWy X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE5MDAzNyBTYWx0ZWRfX4hH9kgwAretp VtvWHFQXf8Bn+L5hV7he5JBhw11Kec8Hztqkgilt6q3+AAHBFwFNcwnugPCrG3huEr322wII5t+ /X5+tYGFeEtoXyvX6Fz0okCGxkCG87/iLPxLWLUbL1R6EA20Fq2JM3eFvjIerJ3QUYhkuJrCR16 TfD3ppxYSacTFt6odQdK3x/fGRCJDab4yqN+98SHVg2vtexMxrA/WD+S0wAmiUMyyN3Sqg3Vaks /XbJM/770wRHMkgX7uxrMAwBc+7qHsOFDQrZ8r9D1kj0XNpRQyX2Lh/xut6NwOTvGki+m0zhBTb A1JEePrkcTpDewyZ0S256ndrYWvXvlXYPcYi1rpNifQ7Mr0DCrEd441w2I/hwgOzG2fWiBu/Xdw NVc3v0ccwdOsa4OjHbfRa8bT2+iFu4qlYlwh9M5zAayuImhQrToHVGWjzAmBlgTmMXW47S7uZqt ucxY59NyKfptDFjhwlg== X-Authority-Analysis: v=2.4 cv=aMrAb79m c=1 sm=1 tr=0 ts=6a853b81 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=alUBXKyVNpYQNee0O81Cpw==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=Vvnin58ruKcyw0OJcwkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-ORIG-GUID: i4Vd2aoaIoH6PplKxYuGDW96ZZr8HLWy X-Proofpoint-Spam-Info: AW1haW4tMjYwODE5MDAzNyBTYWx0ZWRfXwz0uIUmqHH0Z EnyrDWWtKxjOHhb8g3NbF/E2ReaJvXe5MDbS3Hg4rgoKl35FsHL03Oe1R/jPVL/B3hdcy1YUahk jcHl81R/Sfiz0nQfGms45PdJmC3/CuU= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-19_01,2026-08-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 lowpriorityscore=0 bulkscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 spamscore=0 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608190037 On 7/30/2026 12:05 PM, Anvesh Jain P wrote: > > > On 7/29/2026 4:37 PM, Konrad Dybcio wrote: >> On 7/28/26 7:44 PM, Anvesh Jain P wrote: >>> Add the EC command definitions and handler functions for querying fan >>> RPM and programming per-fan LUTs (lookup tables mapping SoC >>> temperature to target RPM), and introduce a raw i2c_transfer()-based >>> transport for the two commands, since their variable-length, >>> sub-command-addressed payloads don't fit the smbus block-data model >>> used by the existing commands. >>> >>> Fan LUT geometry and temperature breakpoints vary by board, so encode >>> them in per-compatible qcom_ec_lut_config data selected via >>> device_get_match_data(). Add configs for the Hamoa CRD, Hamoa/Purwa >>> IOT EVK, and Glymur CRD ECs; IOT EVK boards share the Hamoa LUT >>> geometry but are bring-up platforms without a calibrated fan curve, >>> so skip_lut_set suppresses the LUT-set command on those boards. >> >> So are we expecting every single laptop/device that utilizes a >> compatible EC to require modifications to the driver here? >> > > Yes, currently a new board does need a driver-side compatible + LUT > config entry. Will check on the feasibility of moving the LUT > geometry/curve data into devicetree instead so new boards don't require > driver changes. > Even moving the LUT into devicetree wouldn't fully solve it, different EC vendors use different LUT layouts, so there's no common structure the driver could parse generically. Hence we need driver changes always. >>> Since the LUT values depend on each fan's maximum RPM, which varies >>> per board assembly, calibrate it at runtime: drive the fan to full >>> PWM, wait for it to spin up, and read back the achieved RPM via the >>> new query command. Run calibration in a work item at probe time and >>> after EC reset recovery, and make it abortable via a completion so >>> suspend can cut it short. Track calibration completion state so the >>> LUT is programmed once calibration finishes and again on every >>> subsequent power-supply-driven profile switch. >> >> I don't want my laptop to become a jetplane on every bootup. I >> doubt anyone does. >> >> Konrad > > There's no EC command that reports a fan's max/rated RPM directly — the > only way to learn it is to drive the fan to full PWM and read back what > it actually spins up to, which is what calibration does. It's bounded to > a 10s timeout per fan and only runs once at probe (and again after EC > reset recovery). > -- Best Regards, Anvesh