Re: [PATCH v3 2/3] remoteproc: qcom_q6v5_mss: Publish socinfo for Pixel modems

From: Konrad Dybcio

Date: Thu Dec 03 2026 - 08:16:23 EST


On 11/16/26 4:50 PM, David Heidelberg via B4 Relay wrote:
> From: David Heidelberg <david@xxxxxxx>
>
> The modem firmware on Google Pixel boards (Pixel 3 through Pixel 5a)
> reads the SoC platform type, subtype and revision from the first
> vendor-reserved SMEM item (item 134) when it boots, and refuses to
> come up unless the application processor has filled it in.

[...]


> +static int q6v5_socinfo_publish(struct q6v5 *qproc)
> +{
> + struct modem_smem_info *info;
> + struct socinfo *socinfo;
> + u32 plat_ver;
> + int ret;
> +
> + socinfo = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, NULL);
> + if (IS_ERR(socinfo))
> + return dev_err_probe(qproc->dev, PTR_ERR(socinfo),
> + "could not get socinfo\n");

Sashiko explains why dev_err_probe is a bad choice here

> +
> + /* hw_plat_subtype was added in socinfo format 0.6 */
> + if (le32_to_cpu(socinfo->fmt) < SOCINFO_VERSION(0, 6))
> + return dev_err_probe(qproc->dev, -EOPNOTSUPP,
> + "socinfo format too old\n");
> +
> + /* -EEXIST: the item survived an earlier boot */
> + ret = qcom_smem_alloc(QCOM_SMEM_HOST_ANY, SMEM_ID_VENDOR0, sizeof(*info));
> + if (ret && ret != -EEXIST)
> + return dev_err_probe(qproc->dev, ret,
> + "could not allocate modem smem\n");
> +
> + info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_ID_VENDOR0, NULL);
> + if (IS_ERR(info))
> + return dev_err_probe(qproc->dev, PTR_ERR(info),
> + "could not get modem smem\n");

We really need a size-check here.

> +
> + plat_ver = le32_to_cpu(socinfo->plat_ver);
> +
> + /* modem_flag, efs_magic and ftm_magic are left zero */
> + *info = (struct modem_smem_info) {
> + .version = cpu_to_le32(MODEM_SMEM_VERSION),
> + .major_id = cpu_to_le32(PLAT_VER_TO_MAJOR_ID(plat_ver)),
> + .minor_id = cpu_to_le32(PLAT_VER_TO_MINOR_ID(plat_ver)),
> + .subtype = socinfo->hw_plat_subtype,
> + .platform = socinfo->hw_plat,
> + };

Aligning the assignment operators is 'eeh'

Konrad