summaryrefslogtreecommitdiff
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2025-10-31 14:08:33 +0100
committerBjorn Andersson <andersson@kernel.org>2025-11-01 12:46:12 -0500
commit7a94d5f31b549e18f908cb669c59f066f45a21c7 (patch)
treedf7ada9e1e474d641aa1b110231eddbdbd0bb464 /rust/helpers/helpers.c
parent652a86b24c5ac444afaf7625c9340d55aab7f105 (diff)
soc: qcom: smem: better track SMEM uninitialized state
There is currently a problem where, in the specific case of SMEM not initialized by SBL, any SMEM API wrongly returns PROBE_DEFER communicating wrong info to any user of this API. A better way to handle this would be to track the SMEM state and return a different kind of error than PROBE_DEFER. Rework the __smem handle to always init it to the error pointer -EPROBE_DEFER following what is already done by the SMEM API. If we detect that the SBL didn't initialized SMEM, set the __smem handle to the error pointer -ENODEV. Also rework the SMEM API to handle the __smem handle to be an error pointer and return it appropriately. This way user of the API can react and return a proper error or use fallback way for the failing API. While at it, change the return error when SMEM is not initialized by SBL also to -ENODEV to make it consistent with the __smem handle and use dev_err_probe() helper to return the message. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Link: https://lore.kernel.org/r/20251031130835.7953-3-ansuelsmth@gmail.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions