mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anvesh Jain P <anvesh.p@oss.qualcomm.com>
To: "Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>,
	"Sibi Sankar" <sibi.sankar@oss.qualcomm.com>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Bryan O'Donoghue" <bryan.odonoghue@linaro.org>,
	"Bjorn Andersson" <andersson@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 4/8] platform: arm64: qcom-hamoa-ec: Add fan RPM query and LUT calibration
Date: Thu, 20 Aug 2026 10:34:54 +0530	[thread overview]
Message-ID: <4797ecf4-67f7-4bf5-ac10-baa4a1356ea1@oss.qualcomm.com> (raw)
In-Reply-To: <ed3dc2dc-69dd-4b48-a5c6-47ca72cfee05@oss.qualcomm.com>



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


  reply	other threads:[~2026-08-20  5:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28 17:44 [PATCH 0/8] Extend Qualcomm reference device EC driver with fan LUT, profile and SoC Tj support Anvesh Jain P
2026-07-28 17:44 ` [PATCH 1/8] dt-bindings: embedded-controller: qcom,hamoa-crd-ec: Add qcom,tsens Anvesh Jain P
2026-07-29 11:08   ` Krzysztof Kozlowski
2026-07-29 11:54     ` Anvesh Jain P
2026-07-29 12:32       ` Krzysztof Kozlowski
2026-07-29 13:00         ` Anvesh Jain P
2026-07-29 11:13   ` Konrad Dybcio
2026-07-29 12:13     ` Anvesh Jain P
2026-07-30 17:11       ` Konrad Dybcio
2026-07-31  5:55         ` Anvesh Jain P
2026-08-19 16:38           ` Konrad Dybcio
2026-08-20  4:50             ` Anvesh Jain P
2026-07-28 17:44 ` [PATCH 2/8] platform: arm64: qcom-hamoa-ec: Add SoC junction temperature reporting Anvesh Jain P
2026-07-29 10:59   ` Konrad Dybcio
2026-07-29 13:03     ` Anvesh Jain P
2026-07-30 17:04       ` Konrad Dybcio
2026-07-31  5:47         ` Anvesh Jain P
2026-07-28 17:44 ` [PATCH 3/8] platform: arm64: qcom-hamoa-ec: Switch fan profile based on power supply state Anvesh Jain P
2026-07-29 11:02   ` Konrad Dybcio
2026-07-30  6:21     ` Anvesh Jain P
2026-08-19  5:19       ` Anvesh Jain P
2026-07-28 17:44 ` [PATCH 4/8] platform: arm64: qcom-hamoa-ec: Add fan RPM query and LUT calibration Anvesh Jain P
2026-07-29 11:07   ` Konrad Dybcio
2026-07-30  6:35     ` Anvesh Jain P
2026-07-30 17:08       ` Konrad Dybcio
2026-07-31  6:25         ` Anvesh Jain P
2026-08-19 16:41           ` Konrad Dybcio
2026-08-20  5:04             ` Anvesh Jain P [this message]
2026-08-19  5:13       ` Anvesh Jain P
2026-08-19 16:34         ` Konrad Dybcio
2026-07-28 17:44 ` [PATCH 5/8] platform: arm64: qcom-hamoa-ec: Verify required I2C adapter functionality Anvesh Jain P
2026-07-29 11:08   ` Konrad Dybcio
2026-07-30  6:37     ` Anvesh Jain P
2026-07-28 17:44 ` [PATCH 6/8] platform: arm64: qcom-hamoa-ec: Retry I2C transfers on NACK Anvesh Jain P
2026-07-29 11:11   ` Konrad Dybcio
2026-07-30  6:40     ` Anvesh Jain P
2026-07-28 17:44 ` [PATCH 7/8] arm64: dts: qcom: x1p42100-crd: Add qcom,tsens for EC fan thermal management Anvesh Jain P
2026-07-28 17:44 ` [PATCH 8/8] arm64: dts: qcom: x1e80100-crd: " Anvesh Jain P

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4797ecf4-67f7-4bf5-ac10-baa4a1356ea1@oss.qualcomm.com \
    --to=anvesh.p@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sibi.sankar@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®