[PATCH 0/2] qcom_tzmem: Enhance Error Handling for shmbridge

Kuldeep Singh posted 2 patches 1 month, 3 weeks ago
There is a newer version of this series
drivers/firmware/qcom/qcom_scm.c   | 12 +++++++++++-
drivers/firmware/qcom/qcom_tzmem.c | 17 ++++++++++++++++-
2 files changed, 27 insertions(+), 2 deletions(-)
[PATCH 0/2] qcom_tzmem: Enhance Error Handling for shmbridge
Posted by Kuldeep Singh 1 month, 3 weeks ago
This patchset addresses the tzmem driver probe failure caused by
incorrect error handling. The qcom_scm_shm_bridge_enable() SCM call
captures SCM success/failure in a0 and E_NOT_SUPPORTED in a1.

Previously, qcom_scm returned values based solely on a0, without
capturing not_supported scenario. This patchset corrects that behavior.

Along with this, add sanity checks on input parameters passed to exposed
APIs as it is missing currently.

Kuldeep Singh (1):
  firmware: qcom: qcom_tzmem: Implement sanity checks

Qingqing Zhou (1):
  firmware: qcom: scm: Return -EOPNOTSUPP for unsupported SHM bridge
    enabling

 drivers/firmware/qcom/qcom_scm.c   | 12 +++++++++++-
 drivers/firmware/qcom/qcom_tzmem.c | 17 ++++++++++++++++-
 2 files changed, 27 insertions(+), 2 deletions(-)

-- 
2.34.1
Re: [PATCH 0/2] qcom_tzmem: Enhance Error Handling for shmbridge
Posted by Bartosz Golaszewski 1 month, 3 weeks ago
On Sat, 5 Oct 2024 at 16:02, Kuldeep Singh <quic_kuldsing@quicinc.com> wrote:
>
> This patchset addresses the tzmem driver probe failure caused by
> incorrect error handling. The qcom_scm_shm_bridge_enable() SCM call
> captures SCM success/failure in a0 and E_NOT_SUPPORTED in a1.
>
> Previously, qcom_scm returned values based solely on a0, without
> capturing not_supported scenario. This patchset corrects that behavior.
>

Ah, I guess this may be the reason for the SHM bridge enablement to
seemingly work on certain platforms and then lead to crashes when we
actually try to use it?

Bart
Re: [PATCH 0/2] qcom_tzmem: Enhance Error Handling for shmbridge
Posted by Kuldeep Singh 1 month, 3 weeks ago
On 10/7/2024 7:55 PM, Bartosz Golaszewski wrote:
> On Sat, 5 Oct 2024 at 16:02, Kuldeep Singh <quic_kuldsing@quicinc.com> wrote:
>>
>> This patchset addresses the tzmem driver probe failure caused by
>> incorrect error handling. The qcom_scm_shm_bridge_enable() SCM call
>> captures SCM success/failure in a0 and E_NOT_SUPPORTED in a1.
>>
>> Previously, qcom_scm returned values based solely on a0, without
>> capturing not_supported scenario. This patchset corrects that behavior.
>>
> 
> Ah, I guess this may be the reason for the SHM bridge enablement to
> seemingly work on certain platforms and then lead to crashes when we
> actually try to use it?

This patchset corrects the behavior for handling unsupported SHM bridge scenarios.
If the SHM bridge is supported and enabled for a target, any subsequent failures
should be investigated to understand what went wrong.
I am willing to put effort in that case.

-- 
Regards
Kuldeep