From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 844B935E1C1 for ; Fri, 31 Jul 2026 06:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785479129; cv=none; b=k3ofXfJXsypSBaZzDcOLNRAH00CgNGaWLcu1CHy4rappPVar+vhbVMNC4koizhtgIP3Uw6COaKCgZme+1rp0/UQHj1mxBwFXeYllq/f8FveX57w/rqQewhWxGJy/T+d2tsdPys1Yed+o4g/EEsrX7Q9x8pzN2uSPkEJwSR8WmFc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785479129; c=relaxed/simple; bh=G40H8QQHfAHAJaisLzUUvo4a5Zx0ASqBCxVychTBOqk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=HAsxlQQYa8g2qL4W6Vsy/gEz+Z4LJQijHfwR3qXREC4Uv4WmbUuX0IArjEpEJLvSHJA0WZysQEfvy9Buq49TQHWnF5Yn6zzKt4w5fprPvACCILPUlJ+/ZUTyDko2XK0PdL5tdy1RasfNY5nhn0G5ZSj2R1TvZwx2DZq7A4LNnmA= 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=N/68/Lq+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PW6kKFY1; arc=none smtp.client-ip=205.220.180.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="N/68/Lq+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PW6kKFY1" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66V4upSp3277878 for ; Fri, 31 Jul 2026 06:25:27 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= POuVEWnyuiz3uY4rm2V7x5tcHzK6GruQsBn9X4SISsQ=; b=N/68/Lq+OXLYX+t9 girjcHCqRc0iq5Tr/m5VddMQ9//Q+KJaemJfSLV7CkP8JO7otIq1vyrRFc0Zj5GV 0IxFlWn7MBkTjQ19legTPKtyxeM/rLCVez9CehYXiHb3tiB/iAeScDQUFmKxUZVf LkeKO3N7Zer4kdQNHgDsYUywnPe8GrUqybB1LWMAatGJ6ljVEwLi2NDlGsQowNH+ NzSToYkD3L/wxyab+NZxMr+fW44ISIBqS3JetNBz7p5j3gPk+lFHPISbPNUFstpi FDCQcTzWK6DCHhb+bBkoCx1a50HiUSdXTup4+alAkGk4g+5TvdQDGWaVyZl8vGu/ KuJ7Gw== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4frn0f8ac2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 31 Jul 2026 06:25:26 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cb5cc1e13f8so809130a12.3 for ; Thu, 30 Jul 2026 23:25:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785479125; x=1786083925; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=POuVEWnyuiz3uY4rm2V7x5tcHzK6GruQsBn9X4SISsQ=; b=PW6kKFY1eRWhV/fGERqd/eFSCmPkNpfbPxRkPb0sYeQCeFVJo3H5UQvJlO5DXXtArR SndkXQoKROvLlnU9yYo6rJorvTwCp8p6mRCDJr3flGSN+JbZewXMQZ/covIMxr/EMVaX Ahaj5SzfkYmyjHA9hUn8McV/A5Hr8sVFliK7XtJoB5cnxzsysGA7UQNFAAfEog+CM4mJ K1zCWSb6ssxqU/cmov+gdACnTbAKJYSGxQsD+Xln0NKDB6jyiUZ+Hg7v9FZq+JXGQNS4 SAMHuUkqH+6N2A3wvzhcf3Y/ucT+ak5OzmVpTQ9I1XyrRyY11QFRBtl/Y2t6guTkxi72 arUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785479125; x=1786083925; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to: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=POuVEWnyuiz3uY4rm2V7x5tcHzK6GruQsBn9X4SISsQ=; b=ZeRvWZ7jp9D1eH2GykQkVlc/Sg9jkRTbEbVeIp6FRDATP8KlMQtzV57tLjU/SjBB38 eZDohMZktPrPTQdwBDFHZs9Vkmebs5VGF17Kq9v7Zn0GEcOENq26m8m+f8XGBEcB6ZAt 08/YUsY+h8TPDxeJn9776wFi7iTv+oxkuL5Z633ys9YRLsz3IbShRgVMHARcbd9+AFQo 0DQ/O75BaTn4CPxl8unxivNjCksIRMhtvn9BjwW8xqL4vgCxP94RKKJX5mp78AlOyE2+ +7XynVAZaz/VqKSRdCYAyKez4Hj/qJV/fIvWp6HUxnMXqk/C+VRgWm+KmT5DhyP2eL2/ LbSg== X-Forwarded-Encrypted: i=1; AHgh+RpGthXnHKwH+hS3wdAykOWiPGacLkETbE/0Id217oZxDwsaTju33pPs/1cLcTGFsARitaKSrpo+z8HGOqI=@vger.kernel.org X-Gm-Message-State: AOJu0Yxq6f3HvQMZNj6Ydg505G0xjl/UBEvxaUwK6OILUsfrNGU1ZGus N7cicCcbbWrkJeacqQppiEATJOT0fyW+LmUJUZ/R9R3DWyjLymCndZYETEiQzOlgxskeviHqAWu 6QtbeuJlVxcAV0Q+7EMjXJJ7rz17uEVlnI/77F6c/ZOQwDIC0mhhNUNY1SuZ4PUOuCtg= X-Gm-Gg: AR+sD13TgK9/49s/7wokmKap8Fa3g7wqWu5H8x9PJwkqRZTXgsxrkgQh3T+JNyywmXY iJLn0wEENXlF/kSQg0tUciEZklE7znkwRu6wvQrhhQ/AtCNS9z416DnFFhcd7KnU36ZDz44NeYa OPhjzDL0PaU1AHeFbPvhU0OBMSZp4ymO5rZo6rnpMoW044bEWoNQrK8Vg4IofhL2pSh7uA3USka JZIFZD+0g65QVhJS4VC6eVUjYdPVUs9RMG1A3GjkEXSTB98wI+MKyQxRRCZEFtwAofgX8Zgjiad syCC1mauOO032a5dM6akYJWrYFGGACvxVzR195NAHbjwRzE9OAy24kOTJvXngRl+L2cyup0dvEX IgaVLIWUjz2t4WnRhFzmkjJfa6G/httdF1RhFDygKNPd5rfKD4FgPc7S2Hvd8jTLzV8D9inYIRU KjE0mCaNU3nOsu X-Received: by 2002:a05:6a00:1256:b0:848:3fe2:c88b with SMTP id d2e1a72fcca58-84ed6bfcff5mr639581b3a.6.1785479125551; Thu, 30 Jul 2026 23:25:25 -0700 (PDT) X-Received: by 2002:a05:6a00:1256:b0:848:3fe2:c88b with SMTP id d2e1a72fcca58-84ed6bfcff5mr639566b3a.6.1785479125070; Thu, 30 Jul 2026 23:25:25 -0700 (PDT) Received: from [10.149.71.180] (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84ed5e30981sm338042b3a.57.2026.07.30.23.25.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2026 23:25:24 -0700 (PDT) Message-ID: <46f53628-ea22-42e5-8de5-a2a76b6360a8@oss.qualcomm.com> Date: Fri, 31 Jul 2026 11:55:18 +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 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> <3fa15948-eb8b-4f3e-af90-5b88fcc44d75@oss.qualcomm.com> Content-Language: en-US From: Anvesh Jain P In-Reply-To: <3fa15948-eb8b-4f3e-af90-5b88fcc44d75@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMxMDA0MiBTYWx0ZWRfX2yE/MaqpTDWC BNGnhtLOg2tzZpwgE53nnDJuje1lmwkVkCvMvtemBWxMU05S1bYMFwVk4oTpHFghW/2+m1phWvu hTe5crtQpqYrcAIZbA9YllR1pxZNy/c= X-Authority-Analysis: v=2.4 cv=HJTz0Itv c=1 sm=1 tr=0 ts=6a6c3fd6 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=kfAM7XMfZeusFuJwEhoA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 X-Proofpoint-ORIG-GUID: zRLbrQBaLrPVXm8ua360wn0i--du7Fws X-Proofpoint-GUID: zRLbrQBaLrPVXm8ua360wn0i--du7Fws X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMxMDA0MiBTYWx0ZWRfX+lPduxb7JK7C Du/mUa7QyLnrLiKdZ30s19lufKrffuQpnFsi7kHMkPTCl1ONLmCqry1gsxOuVkUJeBPnmVQECjL OziCpO2R+EAM6FzujxLslVU8qfh5IDZX4IxiNLDtCwJdS0cmuU+9aQJZFBTJy7igs3OVcAcNzTn AsA7JoAURDTtfeLUTBEUh8MMwF6VLoFNuk8k9BmoA7pRXm6Gmt51Fxg2VSf4p0pVJh1LN766sm0 o8MP8J6+zBfjZT0jsUoMGQJAEj61YfDJE2oRo5mD9C2G/uYbKXktAJwciaCkalCvme1ZnpGjlom 2X0WNgAIamGgVSvOrYD67dREacJ9Ks7lAKK5+PCPuDx7VD9bHUq33MgVoxqvl9b6+/a/iKh0Fbp +So402Y+/d7Gy6ZLeN9Onz2/AxE52mOFmRqPeZMUwVOrTDFGEausbyXFlrqcm8Hsopy+oHSYU9p bxL1NeBw0kNuGq+vAPw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-31_02,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 impostorscore=0 adultscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607310042 On 7/30/2026 10:38 PM, Konrad Dybcio wrote: > On 7/30/26 8:35 AM, 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. > > [...] > >>>> 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). > > 1. please fix the firmware so new designs will have that > 2a. if we're storing a LUT already, can't we store the max RPM too? > 2b. if we don't know fan RPM, we can still expose a PWM hwmon > > Konrad 1. Agreed, will raise this with the EC firmware team for new designs. 2a. The EC's LUT storage isn't persistent across reboots, so we'd need to cache max_rpm on the driver side instead to skip recalibration. Initial probe after a fresh boot would still need one calibration pass either way. 2b. cur_state already reports RPM-derived state via the cooling-device ABI. Is it worth also adding PWM hwmon on top of that? -- Best Regards, Anvesh