From: sashiko-bot@kernel.org
To: "David Heidelberg" <david@ixit.cz>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH RFC 4/4] arm64: dts: qcom: sdm670-google: Add modemsmem
Date: Sun, 06 Sep 2026 00:50:10 +0000 [thread overview]
Message-ID: <20260906005010.DE7C81F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260906-modemsmem-v1-4-a3634b553841@ixit.cz>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Missing probe dependency between the `modemsmem` platform device and the modem remoteproc driver.
- [High] Probe fails if the SMEM item is already allocated by the bootloader (-EEXIST).
- [High] Uninitialized SMEM memory is exposed to the modem because several fields are not initialized.
--
commit f684325f1bc358462d3e26fd3838d75a70d04ce2
Author: Richard Acayan <mailingradian@gmail.com>
arm64: dts: qcom: sdm670-google: Add modemsmem
The Pixel 3a modem needs the modemsmem client. Add it in the device
tree so the modem can properly boot.
> diff --git a/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi b/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi
> index b4854801a5f5e..4604c4eb2192a 100644
> --- a/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm670-google-common.dtsi
> @@ -66,6 +66,11 @@ key-vol-up {
> };
> };
>
> + modemsmem {
> + compatible = "google,modemsmem";
> + qcom,smem-id = <134>;
> + };
> +
[Severity: High]
Is there a missing probe dependency between the modemsmem platform device
and the modem remoteproc driver?
Because this node is defined as a standalone platform device with no
parent-child relationship or fw_devlink dependency (like a phandle) to the
modem node, the kernel driver core will probe them in an unconstrained order.
If remoteproc probes first and starts the modem firmware, will the modem
driver crash or fail to boot if it attempts to read SMEM item 134 before it
is allocated and populated?
[Severity: High]
Does this node addition trigger a probe failure on warm reboots?
Looking at modemsmem_probe() in drivers/soc/qcom/modemsmem.c:
ret = qcom_smem_alloc(QCOM_SMEM_HOST_ANY, smem_id, sizeof(*info));
if (ret)
return dev_err_probe(dev, ret, "Could not allocate modem smem\n");
If the requested SMEM item was already allocated (e.g., by the bootloader
or persisting across a warm reboot), qcom_smem_alloc() returns -EEXIST.
Because modemsmem_probe() treats any non-zero return value as a fatal error
instead of tolerating -EEXIST, will this prevent the modem from receiving
updated SoC information?
[Severity: High]
Does allocating this SMEM item expose uninitialized memory to the modem?
Looking at write_socinfo() in drivers/soc/qcom/modemsmem.c:
target->version = cpu_to_le32(MODEM_SMEM_VERSION);
target->major_id = cpu_to_le32(PLAT_VER_TO_MAJOR_ID(plat_ver));
target->minor_id = cpu_to_le32(PLAT_VER_TO_MINOR_ID(plat_ver));
target->platform = socinfo->hw_plat;
target->subtype = socinfo->hw_plat_subtype;
qcom_smem_alloc() allocates memory from the SMEM region but does not
zero-initialize it. Since only 5 of the 8 fields in struct modem_smem_info
are assigned, the remaining fields (modem_flag, efs_magic, ftm_magic) are
left untouched.
Could this lead to unpredictable behavior if the modem firmware reads and
processes these uninitialized garbage values?
> reserved-memory {
> #address-cells = <2>;
> #size-cells = <2>;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260906-modemsmem-v1-0-a3634b553841@ixit.cz?part=4
next prev parent reply other threads:[~2026-09-06 0:50 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 0:41 [PATCH RFC 0/4] Add modemsmem for Google phones David Heidelberg via B4 Relay
2026-09-06 0:41 ` David Heidelberg
2026-09-06 0:41 ` [PATCH RFC 1/4] dt-bindings: soc: google: Add modemsmem David Heidelberg via B4 Relay
2026-09-06 0:41 ` David Heidelberg
2026-09-29 2:59 ` Bjorn Andersson
2026-09-06 0:41 ` [PATCH RFC 2/4] soc: qcom: Add modemsmem for Google phones David Heidelberg via B4 Relay
2026-09-06 0:41 ` David Heidelberg
2026-09-06 0:49 ` sashiko-bot
2026-09-07 8:36 ` Konrad Dybcio
2026-09-06 0:41 ` [PATCH RFC 3/4] arm64: dts: qcom: sdm845-google: Add modemsmem David Heidelberg via B4 Relay
2026-09-06 0:41 ` David Heidelberg
2026-09-06 0:50 ` sashiko-bot
2026-09-06 0:41 ` [PATCH RFC 4/4] arm64: dts: qcom: sdm670-google: " David Heidelberg via B4 Relay
2026-09-06 0:41 ` David Heidelberg
2026-09-06 0:50 ` sashiko-bot [this message]
2026-09-07 8:37 ` [PATCH RFC 0/4] Add modemsmem for Google phones Konrad Dybcio
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=20260906005010.DE7C81F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=david@ixit.cz \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.