[PATCH v2 0/6] firmware: qcom: scm: Fixes for concurrency

Krzysztof Kozlowski posted 6 patches 1 year ago
drivers/firmware/qcom/qcom_scm-smc.c |  6 +++-
drivers/firmware/qcom/qcom_scm.c     | 55 +++++++++++++++++++++++++-----------
2 files changed, 44 insertions(+), 17 deletions(-)
[PATCH v2 0/6] firmware: qcom: scm: Fixes for concurrency
Posted by Krzysztof Kozlowski 1 year ago
Changes in v2:
- Patch #2: Extend commit msg
- Patch #4: Store NULL
- Add Rb tags
- Link to v1: https://lore.kernel.org/r/20241119-qcom-scm-missing-barriers-and-all-sort-of-srap-v1-0-7056127007a7@linaro.org

Description
===========
SCM driver looks messy in terms of handling concurrency of probe.  The
driver exports interface which is guarded by global '__scm' variable
but:
1. Lacks proper read barrier (commit adding write barriers mixed up
   READ_ONCE with a read barrier).
2. Lacks barriers or checks for '__scm' in multiple places.
3. Lacks probe error cleanup.

All the issues here are non-urgent, IOW, they were here for some time
(v6.10-rc1 and earlier).

Best regards,
Krzysztof

---
Krzysztof Kozlowski (6):
      firmware: qcom: scm: Fix missing read barrier in qcom_scm_is_available()
      firmware: qcom: scm: Fix missing read barrier in qcom_scm_get_tzmem_pool()
      firmware: qcom: scm: Handle various probe ordering for qcom_scm_assign_mem()
      firmware: qcom: scm: Cleanup global '__scm' on probe failures
      firmware: qcom: scm: smc: Handle missing SCM device
      firmware: qcom: scm: smc: Narrow 'mempool' variable scope

 drivers/firmware/qcom/qcom_scm-smc.c |  6 +++-
 drivers/firmware/qcom/qcom_scm.c     | 55 +++++++++++++++++++++++++-----------
 2 files changed, 44 insertions(+), 17 deletions(-)
---
base-commit: d1486dca38afd08ca279ae94eb3a397f10737824
change-id: 20241119-qcom-scm-missing-barriers-and-all-sort-of-srap-a25d59074882

Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Re: (subset) [PATCH v2 0/6] firmware: qcom: scm: Fixes for concurrency
Posted by Bjorn Andersson 11 months, 1 week ago
On Mon, 09 Dec 2024 15:27:53 +0100, Krzysztof Kozlowski wrote:
> Changes in v2:
> - Patch #2: Extend commit msg
> - Patch #4: Store NULL
> - Add Rb tags
> - Link to v1: https://lore.kernel.org/r/20241119-qcom-scm-missing-barriers-and-all-sort-of-srap-v1-0-7056127007a7@linaro.org
> 
> Description
> ===========
> SCM driver looks messy in terms of handling concurrency of probe.  The
> driver exports interface which is guarded by global '__scm' variable
> but:
> 1. Lacks proper read barrier (commit adding write barriers mixed up
>    READ_ONCE with a read barrier).
> 2. Lacks barriers or checks for '__scm' in multiple places.
> 3. Lacks probe error cleanup.
> 
> [...]

Applied, thanks!

[1/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_is_available()
      commit: 0a744cceebd0480cb39587b3b1339d66a9d14063
[2/6] firmware: qcom: scm: Fix missing read barrier in qcom_scm_get_tzmem_pool()
      commit: b628510397b5cafa1f5d3e848a28affd1c635302
[4/6] firmware: qcom: scm: Cleanup global '__scm' on probe failures
      commit: 1e76b546e6fca7eb568161f408133904ca6bcf4f
[5/6] firmware: qcom: scm: smc: Handle missing SCM device
      commit: 94f48ecf0a538019ca2025e0b0da391f8e7cc58c
[6/6] firmware: qcom: scm: smc: Narrow 'mempool' variable scope
      commit: a4332f6c791e1d70bf025ac51afa968607b9812b

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>