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 DEB7C39281B for ; Thu, 30 Jul 2026 17:09:04 +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=1785431346; cv=none; b=q4t4GVt+Ng7GlaxJeNjZTmz1gmyIC+2ATABlne3vio/aG9g0RJCXp5oBstP5eSlIKTCJ4qU+DFLATDoHIMw99enFLfc/aSsPCZLGZ/i0SMgUwQaAf0QVMDD7jsbfTi2zaVfjIn73CMRe0/DDjqN50t/0iRwiRF2zgYC0cWIt3ZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785431346; c=relaxed/simple; bh=oSe8+hdnJtZBQ9o5XKtvCAaCNiE++K4SPxZ5F94VldU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=LA37Cim1oDWTE/A5lVLNRGv6JbvKO2wY3CdEzBOcXwWHGcdEcN6Jg34UA1WRKj1DqVsWqG3eyKQ/Z6atO4bLHzjlPVM67+8mvly0rIt4JdobhLfm6lQpzH+2RhB1AgbOPiI2K36KelQazG80eAxxW+6UTxL5l7pswnT/5aTAYNU= 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=fuJfw7oz; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=JzpC4lFT; 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="fuJfw7oz"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="JzpC4lFT" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66UGXE0c1629575 for ; Thu, 30 Jul 2026 17:09:03 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= 9jqtCQUFZAVjgBKaSqj2WhpZzKyLFiLrhc9lpSkV2UY=; b=fuJfw7ozLHuh4EkV eIpb+Hd5YJmJggCSycnrw39OBX9CvZjQ08bhGK6mgDSgEy1ReYhLiYV1CpxBO22r qv29czmP34MzHwAbhkv0bZvInLK9i3zakaABw+nwX1Edbu8C9CMP7wKs9lBbmkfA M9TixaPqw7Z5AG9qyaMJYayki+xGJouREDIsFy4CkGzTVDkSQjbaAMjjPz0B3vY/ RYRnqmHLxxVugJdXFLpFotKS/nI2CK7JXwV9gZ7MKwq5Vi2vM0OStbV7h8s9mhuv VvYTYSmMeON2yNiEaCAiBShFxtG5jQBuTCUbxsSeXpKp/yW22OnMcdpxev9IFsEm W8yjmw== Received: from mail-vs1-f71.google.com (mail-vs1-f71.google.com [209.85.217.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fr7q3h3e0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Jul 2026 17:09:03 +0000 (GMT) Received: by mail-vs1-f71.google.com with SMTP id ada2fe7eead31-7570225606dso3331137.3 for ; Thu, 30 Jul 2026 10:09:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1785431343; x=1786036143; 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=9jqtCQUFZAVjgBKaSqj2WhpZzKyLFiLrhc9lpSkV2UY=; b=JzpC4lFTOixqIIR2uZw2JJ58IvABXKwKYDbGZ+4DnJ+hjCoh9hpBUas6YTlMQVw/Ci eVU7ISV1uvYS9hTKoCXqKz2GxbS7859hENuJA76OChruaJjL0XhLh6OEbVSFtW2yAgzv lIsGuzDOABes+JVtH4zQjyudAGbi4T+PSUw32xE46rNjk8bZnpnNsOswGVwZUms4H5L9 dXGOGAWdaj9enp1K6vXXED2wWcyEEQ003mcbrDRTcimHrsHyhGcI2ZEA+yaswVBJu706 yDknPr/Ztb5ER2XOqbPaQUjHG6b3Uf1MAEyufoB0LCviPjs588FH8w1tMzYTy008XcfB SWqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785431343; x=1786036143; 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=9jqtCQUFZAVjgBKaSqj2WhpZzKyLFiLrhc9lpSkV2UY=; b=TLLO+of9v3n+0TzH4g+bhyuj8ehKxi5G/oICgMHV/mK8M0qMdowHbe1EhGI1LTnqQP 76Fd8vxgwDpAOFezTrYOt9LPmqTr7OmYOrxkJg/mVGwNqaCcXfxrI8xXzcdDkfBB9ZzQ 82XvSBSbdJXB2zJa8GTMQct7DtMEOpyOwFMIgt7aDQr5gF/v0hD6DdwCIk27FRX3SWWG 6FuIiIYD2FAqdbn3a9VZMH5We/LDkqGz/kioNtlaEEqmIJWk7jct4vvwQt3IXzcnQZfU mvHdyw5i44rQvJJGJN7df+V0+B6PA9cuKeUAOmTOw+1O0SlKsW+hVYcxQvaRKCAFKqGk hUvA== X-Forwarded-Encrypted: i=1; AHgh+RrvXWNJZtZu8gZuO6flezp8rh9NdCm7Cq3CHi1WPIc+aUrdx0sGSmPyZMzrqqHR+tMLMwt+jEdkwa579IQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yyj++GTdoDNONTbEOqXRYxKWnJdC5VCflF0MDbpoz5Lsc0+JnsZ 9vG6PQOW2UqfDdm/iiAtrXEAINExEYUbCuPtkyK/HxnPyfZtaoPIp3bJBYLEQOStuUuwjOZyl8B uheUCrTy79U5Kw14AkXbxy4E+ndqA9X6cTNwyP0QJgD02qykTgKKrAlh/URlaQKSr4Dw= X-Gm-Gg: AR+sD12gLx9H5ZoyGN1Sum6xIxbloZXc9RHXd+0mh5vkIP5xkxkBoVGUSI0KUDmlJob 1Yujgz4KUrAaJ9j4RhW7W6hVy+sH41Ej2LlCfyc1TXS5N/dKtc9hRtU3NfMUemxkqWOEtfRDNkq CmdIk+3aJDimoYYMS7ac8XfG5Odozx6wKlneSc9NFUBzwpxhpIw5jqJcjmZFGZVmg2SwvGqHhow t8RHJkaTKHauClCiVaw2uH6Up+i2xsqMm8CIvsfdDwkijJf9Cs8yQz6h+z11pyTmc09Pt7q+P9U WoBNQMsnVOoPg7Y9WgPXvfplQRtrgAzubpnTo1CdKKNyVi88h/NpERLP/80Xveo7nUyf321r/Es I/o7I7Ey48H5RIs3WwVRSGvT2 X-Received: by 2002:a05:6102:915:b0:738:133f:8d60 with SMTP id ada2fe7eead31-7583e56ccb9mr691965137.1.1785431342891; Thu, 30 Jul 2026 10:09:02 -0700 (PDT) X-Received: by 2002:a05:6102:915:b0:738:133f:8d60 with SMTP id ada2fe7eead31-7583e56ccb9mr691926137.1.1785431342369; Thu, 30 Jul 2026 10:09:02 -0700 (PDT) Received: from [192.168.120.193] ([178.235.128.140]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c1fa8bb6db7sm91156166b.45.2026.07.30.10.08.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Jul 2026 10:09:00 -0700 (PDT) Message-ID: <3fa15948-eb8b-4f3e-af90-5b88fcc44d75@oss.qualcomm.com> Date: Thu, 30 Jul 2026 19:08:58 +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 4/8] platform: arm64: qcom-hamoa-ec: Add fan RPM query and LUT calibration To: Anvesh Jain P , 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 From: Konrad Dybcio In-Reply-To: <96411e0c-f357-40d5-81f8-14523836280e@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzMwMDEyOCBTYWx0ZWRfX6weeP/xnqfF6 x2sMIF+cnLgFIs7QLDVdUBuywlKviVCx0lsh1b0grAS149XifMhAn1RiE67W9hVJ2iNLx9C96K4 5UyoMJ9HQXinYcONwbLH83FyjeIrRktJjIqxKq+2z/YXcCs7Wce3s976prmmuwBK6m9jIAtuJo3 9C/3x3vlSOXDG0hoyyfKcPTgwRx8iCSsJO0p1bRXTC60NI9IiOfLfhtw4zvW7V9Gw7Qyki5jEZU lFBZC+/0NCWz5M7+r3OLuVlyuxWzyyYrH8C1V7ZQaIfmLFYMnNK9VV6MDiKDyz8+r1/e1Nzzdk7 bqC8I4KQugu0oKrjqg4yewBgI8mwq59AYnSNarllhgcP0T6hp/zpZGiUzR1IuIpl/EDaS7yChSw dD6TQVot1Gvvrd9XLhEdRpnl5pcm7G55puli3gkdE1ltdIqyXx2Bt40qEuIap1wM9I7HuqMMiCi DEa0YG2v1fQ4lrXLIKQ== X-Proofpoint-GUID: 5_uNVYgdjp4aKMp_eR7Pz7P97U08psS7 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzMwMDEyOCBTYWx0ZWRfX3NFQqskfeqs0 C0l+i5o869sGqzw7rxqNnD/vuTbQ5pf9IhZ1ozf2rImIh7N0RBWwkUGJi/LBYClV49xz08rysUq y0tZlaePVTqYCl7VlwNHZ1j6l7beL7I= X-Proofpoint-ORIG-GUID: 5_uNVYgdjp4aKMp_eR7Pz7P97U08psS7 X-Authority-Analysis: v=2.4 cv=WuQb99fv c=1 sm=1 tr=0 ts=6a6b852f cx=c_pps a=P2rfLEam3zuxRRdjJWA2cw==:117 a=PRfkaYvzSr8QmIIGAkY2Sg==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=Vvnin58ruKcyw0OJcwkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=ODZdjJIeia2B_SHc_B0f:22 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-30_05,2026-07-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 impostorscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607300128 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