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

From: David Heidelberg

Date: Thu Dec 03 2026 - 14:46:49 EST


On 03/12/2026 14:16, Konrad Dybcio wrote:
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

sure, fair, I considered it kinda irrelevant here, but technically it's not probe and -517 is not a thing 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.

ok, I'll add in next rev



+
+ 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'


I'll change it, but... it's so pointless IMHO when we trying to ship something which works. There is 100 000 critical/high severity issues around the code, but few extra whitespaces?

/me screams in extra spaces

David


Konrad