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 67FE3353A7F for ; Thu, 20 Aug 2026 05:05: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=1787202305; cv=none; b=lnXoHef8ISM4ozhdj8ADTxYY0kp6PBdAfh73vhql6mdTDLfKgCoIZFq7Hj9NxWCuYRGx2N8ESRMra3yn597oMn75E2vs6VEJPbnCKTjVagrle6nqZIehG1sAf0aVDhUXQPI113ztcJqoZ2yEu+VLw4VwngFlnEoUs0CtrPHRp/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787202305; c=relaxed/simple; bh=KRqjEsfgNqcnIJO5eNWaBjRXlRkWEm/1s5nZvcInopE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jsqJZYHgaGQ+sSuybNH+Y84tdNEJv8q5b4VRsCcJd0gGwoA9i+HCHkHJ5QtWH49kRqNRh5BO9b0G5E0dBZLmXV+Fd2ggv3+/qut74OP7QTQMyuC8MKcYQ58gfLYwAWDPdiXxX52iEyDEXmsy9BqlJvZKOwc7hqUUpbe8rU5GILE= 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=JKoQ0xk1; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HXNF91Tz; 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="JKoQ0xk1"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HXNF91Tz" 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 67JL8NmV231838 for ; Thu, 20 Aug 2026 05:05: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= 6IrmzCdsWW6qEYtX/br6mJGQ2P/8lrI7K1gQFv6y1bs=; b=JKoQ0xk1tCNl2Sz9 4XG2Jd5pFNSJ1/NSm8D5K3Rkd3WLtcwbp9/90pR/zIiwrqR6tuvJ70uyI3ztFUux vMoQ5mDLgtRJQJfOwWSilAwIuNT16R8cUQd00mnSBfEGxbmB4ARgpG/YTIe3MDXB 9kZ4UG2w/K3dezVMSR0NYf/35kI2sIgTm3djDiSVn5xU4c5oKJWOaOVe5YEMtRsD z/LkqrxqXEQZ8RG4VeyXP0ZjIf9Vx4kJpctvik51VaiVUP9Gsyhvo228QdeAC1K9 sC12zNdnEV9N1AOgyJmMEITmjUUcpE9SN0FvDf/JygDvI0CBa+SOwJBI5sOyOUbi kr1fog== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5esau6ss-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 20 Aug 2026 05:05:02 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38ec0f510a9so4276144a91.2 for ; Wed, 19 Aug 2026 22:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787202302; x=1787807102; 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=6IrmzCdsWW6qEYtX/br6mJGQ2P/8lrI7K1gQFv6y1bs=; b=HXNF91Tz/3aIuY/f4xHAV7vKJnCgYQH3eUv2K2G5DOoVj6G+0Mb+PVJXVFI0dvNacZ KVIvu2rIs4v/wClUfpIJwnGPAcY50sAXsSQoBoNKe1HiSGmCXm7Jw+KcpethtqC9Li9D lIUfnUHsI25IPLvXwXkbHdUyM7leBe4Dmsi7fn1pcr2wrBqBPsvORAdZ0oBOrSzXwc79 emQkLVBpj2ULkY7JCLSkkiJn0esyKwegP4LH9W3Mpot01mwPa0tS3JSThSnK8OaqDC7p 8NRz7TqYeU7egM/Unzd0NMPrO9HstNCn2FWdr6uZOOCxgOoRMdJST/YsL9vCB7YUthj7 Z1LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787202302; x=1787807102; 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=6IrmzCdsWW6qEYtX/br6mJGQ2P/8lrI7K1gQFv6y1bs=; b=Rfrc9c6T9sEps41Pftxy7UcOXjbUzegqmO3vcdcTGRy1ZM1UgtsPvN36cWo9Nao/d6 yE5ntZ/JC4qABF1k8LQt8hgov3LthjIK2Q0D/R9jmC21puYrkzgfLyMEqT51vCXAogPn VAHeehe6elTqQ+j2pHvTWd93F0j8KAY8uTb9BkE3i6aJsZI6OPf2Jz7AHOJBmCYJtwRh 0AB8O/Q4/TzVxyqmnHENjOmUe5Fu/OTcHNj+Pn06gdBCsUO+J/5JMWdg5rgWbSjo9VrB p/rQpCjZgvin6d1TnBLuPxnMR3lSTz4pBlMAZ62PhldrJcFp7S8C7OBNQC1ONZtcumTY m4dw== X-Forwarded-Encrypted: i=1; AHgh+RoFd/M1IblKRYhLLUs92Pxn1+wD+fvibJqRjl8z3oXBBhzPEvNHZsQ7g2hRmJEzXfx2zUYPJPlYi2OyF0I=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+u1Oyrxw4oJSUFFNmUgAsP8pQ2/zDTD4SNU6bpRRIrpLk50vO goNFCes0z9CeISKOSei4gTXPDnKGJkPIog90DTlY8WoGAqEYL2RJnpq3miuURjnZIFWnbZTbgn8 tUER2A0H+tTv4yzBINxtVr8m8KDPbrEm3pyGXfM5ZIgV++J7s92DrdcYiKJ3FUa3nVL8= X-Gm-Gg: AR+sD12qQDxcJaAeWejiS29spPmy/EdF0mRN6G2Oo5fVSsPuLwjEqUiLEAixW53u9C2 phr+fPtkqNuFAakJx95E6paAkk5qkJIRxB5zLlX96TJewszzpq+WNYxtdDl8DV10rrM7W4zNm04 RxwFlyt+fcpAL1uMD5l03GmMo7HerZ/Ql4zJljJIE+6bJ5rHfIiJ8iXLBha2np9DdbNUxDZflig f0upycEpiJ47omLFJpSY1Y3YdOv9RkRcGElJlpsWkRjGPFbfCABinhwxMzhrcGtSPIa96TA8auM i6Nkxjyggk5YSrK8kAXQTHKUtNLbC+B1mLXjJgwgBwF373nmVtk+bIThEg6JX4uwnB98A899pcH aotY52FytqNIQX5IxEnAI0eke6EbqzIVsCFMBol1Hvmp1SkjIRj+VFLcpT1GdF19wnWGCUW9P4/ 17lPoSy8iYsPs57A== X-Received: by 2002:a05:6a20:5483:b0:3c3:64cb:9b99 with SMTP id adf61e73a8af0-3cd00e58e33mr18463632637.6.1787202301917; Wed, 19 Aug 2026 22:05:01 -0700 (PDT) X-Received: by 2002:a05:6a20:5483:b0:3c3:64cb:9b99 with SMTP id adf61e73a8af0-3cd00e58e33mr18463521637.6.1787202301416; Wed, 19 Aug 2026 22:05:01 -0700 (PDT) Received: from [10.149.122.146] (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com. [103.229.18.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327bf10b584sm21195675eec.16.2026.08.19.22.04.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Aug 2026 22:05:00 -0700 (PDT) Message-ID: <4797ecf4-67f7-4bf5-ac10-baa4a1356ea1@oss.qualcomm.com> Date: Thu, 20 Aug 2026 10:34:54 +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> <46f53628-ea22-42e5-8de5-a2a76b6360a8@oss.qualcomm.com> Content-Language: en-US From: Anvesh Jain P In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYwODIwMDAzNCBTYWx0ZWRfX6QvOft8mE82h KACGFKfBYyhLAm6l4zoYMCMcmTPBFxWqgqJA53hG7b+ed78VEQfLPGQYWJszYcCCXgM/CftojKq D40RCQVjENyDz7m+7IhXSqoAYp0W0kk= X-Authority-Analysis: v=2.4 cv=fKcJG5ae c=1 sm=1 tr=0 ts=6a868aff cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=Ou0eQOY4+eZoSc0qltEV5Q==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=yyrbUpTaeNQD0MaAboQA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-ORIG-GUID: QgzoTYGO30OiuxFk80i97eSGJ0hZAx2C X-Proofpoint-GUID: QgzoTYGO30OiuxFk80i97eSGJ0hZAx2C X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODIwMDAzNCBTYWx0ZWRfX0Dz+IzlI+bZF 13GHIklHaCU4YF/NBVpcwOjyBTl1R3098eOaIYAsPM3V4eNHrwDpPUE8OypRBeYRhteiAF6ANvW YtA5qfoJqPAplZzL2rftOU/nTnrvyh2teCDfOqO3huyIc1HK5tdsZl8Ay8Ry/rkf2QReHqsqSW/ gWq7lckR0C1czr6rqQaO0gGQnEcnebtkOzmcaxKaV8UMdCCXDNtfdDVS/N7YUhmA5KUUlYB2KZM +kfIItBUAjGw/80zO0uqpHLI0CApMX8WfO/GgxmzoWaeJShUUL5sE5jys/AyZ9TlMqQJNRGU3Qu VV7ndacoX02D0OcX9zx8O/gx2zxD5LEgBR/Lw+fZN/j9y5cEkCLPfVCuCjaIzWLluQ0N/oes8U8 V/6rfJl1Gv1ZJCXbbzX46RvSFcrnhcjIftqwUir226JPYi3hJCuYkML0DJcOJvupnQ0NPDU2o5A m6ngbPTKqV84w3VqNCw== 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_06,2026-08-19_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 impostorscore=0 bulkscore=0 adultscore=0 priorityscore=1501 malwarescore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608200034 On 8/19/2026 10:11 PM, Konrad Dybcio wrote: > On 7/31/26 8:25 AM, Anvesh Jain P wrote: >> >> >> 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. > > [...] > >> 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. > > Are you saying that without this patch, we could be in a situation where > the fan simply wouldn't spin because the LUT would be null on the EC > side? Would UEFI not do it for us? > The EC has a default LUT from flash, but it is not calibrated properly for this specific board's temperature and RPM characteristics. UEFI doesn't initialize it either but fan would spin at some unrelated RPM settings. Since the Hamoa EC can only store one LUT profile at a time, we need to reprogram it on each profile switch to match the current board's actual fan behavior. >> 2b. cur_state already reports RPM-derived state via the cooling-device >> ABI. Is it worth also adding PWM hwmon on top of that? > > We have to deduce the RPM number, whereas IIUC we can query the PWM > state (if not, then there's no point) > > Konrad We don't have an EC command to read back the PWM state, we can only read RPM. So there's no point adding PWM hwmon since we can't query it directly from the EC. -- Best Regards, Anvesh