Re: [PATCH v15 3/8] thermal/qcom/lmh: Switch to match data for SoC CPU-to-node mappings

From: Konrad Dybcio

Date: Tue Dec 01 2026 - 05:16:04 EST


On 11/16/26 6:33 AM, Sreeshankar K wrote:
> lmh_probe() hardcodes the mapping of logical CPU IDs to LMh
> hardware cluster node IDs: CPU 0 maps to LMH_CLUSTER0_NODE_ID, and CPU 4
> maps to LMH_CLUSTER1_NODE_ID.
>
> This assumption only holds true for 4+4 big.LITTLE architectures like
> SDM845 and SM8150. On platforms with asymmetric cluster layouts, such as
> the 6+2 topology on SM7250 where the big cluster starts at logical CPU 6,
> lmh_probe() fails with -EINVAL. Consequently, the second LMh node does
> not register its interrupt domain, which in turn causes dependent drivers
> like qcom-cpufreq-hw to fail or indefinitely defer probing via fw_devlink.
>
> Address this by introducing a SoC descriptor structure (struct qcom_lmh_soc_data)
> and an explicit mapping table (struct qcom_lmh_node_map) associated with of_device_id
> match data. This encapsulates both the algorithm enable flags and the CPU-to-node
> mappings per compatible string.

Please re-wrap the commit messages at 72 chars.

The struct names you mentioned in there don't match the diff.

[...]

> +struct lmh_soc_data {
> + uintptr_t flags;

This should be an unsigned int, since we need to carry a bitmask
and no longer need to make sure that it's compatible with the
match table's .data (which is a voidptr)


> + const struct lmh_soc_map *map;
> + size_t num_nodes;
> +};
> +
> +static const struct lmh_soc_map sdm845_map[] = {
> + { .cpu_id = 0, .node_id = LMH_CLUSTER0_NODE_ID },
> + { .cpu_id = 4, .node_id = LMH_CLUSTER1_NODE_ID },
> +};

Let's do "cluster_cpu04_map" or something like this

Konrad