On Fri, Sep 20, 2024 at 11:01:40AM -0700, Elliot Berman wrote: > Some devicetrees representing Qualcomm Technologies, Inc. SoCs are > missing the SCM node. Users of the SCM device assume the device is > present and the driver also assumes it has probed. This can lead to > unanticipated crashes when there isn't an SCM device. All Qualcomm > Technologies, Inc. SoCs use SCM to communicate with firmware, so create > the platform device if it's not present in the devicetree. > > Tested that SCM node still probes on: > - sm8650-qrd with the SCM DT node still present > - sm845-mtp with the SCM DT node still present > - sm845-mtp with the node removed > > Fixes: 449d0d84bcd8 ("firmware: qcom: scm: smc: switch to using the SCM allocator") > Reported-by: Rudraksha Gupta <guptarud@xxxxxxxxx> > Closes: https://lore.kernel.org/lkml/692cfe9a-8c05-4ce4-813e-82b3f310019a@xxxxxxxxx/ > Link: https://lore.kernel.org/all/CAA8EJpqSKbKJ=y0LAigGdj7_uk+5mezDgnzV5XEzwbxRJgpN1w@xxxxxxxxxxxxxx/ > Suggested-by: Bartosz Golaszewski <brgl@xxxxxxxx> > Signed-off-by: Elliot Berman <quic_eberman@xxxxxxxxxxx> Do we actually need this patch? We have a simple patch already that fixes the reported regression [1]. And as I explained in my reply to that series [2], the root cause is not the lack of /scm node in the DT, but the time when the SCM call is made during the kernel boot process. qcom_scm_set_cold_boot_addr() is called in arch/arm/mach-qcom/platsmp.c before any drivers bind to devices in the DT. We would need an early_initcall() to run early enough before initializing SMP, but I haven't found any examples that the device/driver model is actually functional at that point. I think applying the simple one line fix from Bartosz [1] should be sufficient to restore all functionality that worked before the SCM allocator changes. Thanks, Stephan [1]: https://lore.kernel.org/linux-arm-msm/20240911-tzmem-null-ptr-v2-1-7c61b1a1b463@xxxxxxxxxx/ [2]: https://lore.kernel.org/linux-arm-msm/ZuhgV1vicIFzPGI-@xxxxxxxxxx/