[PATCH 0/8] dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees

Stephan Gerhold posted 8 patches 10 months, 1 week ago
Documentation/devicetree/bindings/dma/qcom,bam-dma.yaml | 4 ++++
arch/arm64/boot/dts/qcom/ipq9574.dtsi                   | 2 ++
arch/arm64/boot/dts/qcom/sa8775p.dtsi                   | 2 ++
arch/arm64/boot/dts/qcom/sm8350.dtsi                    | 6 ++----
arch/arm64/boot/dts/qcom/sm8450.dtsi                    | 2 ++
arch/arm64/boot/dts/qcom/sm8550.dtsi                    | 2 ++
arch/arm64/boot/dts/qcom/sm8650.dtsi                    | 2 ++
drivers/dma/qcom/bam_dma.c                              | 8 ++++++--
8 files changed, 22 insertions(+), 6 deletions(-)
[PATCH 0/8] dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees
Posted by Stephan Gerhold 10 months, 1 week ago
num-channels and qcom,num-ees are required for BAM nodes without clock,
because the driver cannot ensure the hardware is powered on when trying to
obtain the information from the hardware registers. Specifying the node
without these properties is unsafe and has caused early boot crashes for
other SoCs before [1, 2].

The bam_dma driver has always printed an error to the kernel log in these
situations, but that was not enough to prevent people from upstreaming
patches without the required properties.

To prevent these situations in the future, enforce the presence of the
properties in both driver and schema and add the missing properties to the
affected platforms.

[1]: https://lore.kernel.org/r/CY01EKQVWE36.B9X5TDXAREPF@fairphone.com/
[2]: https://lore.kernel.org/r/20230626145959.646747-1-krzysztof.kozlowski@linaro.org/

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
---
Luca Weiss (1):
      arm64: dts: qcom: sm8350: Reenable crypto & cryptobam

Stephan Gerhold (7):
      arm64: dts: qcom: sm8450: Add missing properties for cryptobam
      arm64: dts: qcom: sm8550: Add missing properties for cryptobam
      arm64: dts: qcom: sm8650: Add missing properties for cryptobam
      arm64: dts: qcom: sa8775p: Add missing properties for cryptobam
      arm64: dts: qcom: ipq9574: Add missing properties for cryptobam
      dt-bindings: dma: qcom: bam-dma: Add missing required properties
      dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees

 Documentation/devicetree/bindings/dma/qcom,bam-dma.yaml | 4 ++++
 arch/arm64/boot/dts/qcom/ipq9574.dtsi                   | 2 ++
 arch/arm64/boot/dts/qcom/sa8775p.dtsi                   | 2 ++
 arch/arm64/boot/dts/qcom/sm8350.dtsi                    | 6 ++----
 arch/arm64/boot/dts/qcom/sm8450.dtsi                    | 2 ++
 arch/arm64/boot/dts/qcom/sm8550.dtsi                    | 2 ++
 arch/arm64/boot/dts/qcom/sm8650.dtsi                    | 2 ++
 drivers/dma/qcom/bam_dma.c                              | 8 ++++++--
 8 files changed, 22 insertions(+), 6 deletions(-)
---
base-commit: c674aa7c289e51659e40dda0f954886ef7f80042
change-id: 20250204-bam-dma-fixes-1e06f2a6c418

Best regards,
-- 
Stephan Gerhold <stephan.gerhold@linaro.org>
Re: (subset) [PATCH 0/8] dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees
Posted by Bjorn Andersson 9 months, 1 week ago
On Wed, 12 Feb 2025 18:03:46 +0100, Stephan Gerhold wrote:
> num-channels and qcom,num-ees are required for BAM nodes without clock,
> because the driver cannot ensure the hardware is powered on when trying to
> obtain the information from the hardware registers. Specifying the node
> without these properties is unsafe and has caused early boot crashes for
> other SoCs before [1, 2].
> 
> The bam_dma driver has always printed an error to the kernel log in these
> situations, but that was not enough to prevent people from upstreaming
> patches without the required properties.
> 
> [...]

Applied, thanks!

[1/8] arm64: dts: qcom: sm8350: Reenable crypto & cryptobam
      commit: 75eefd474469abf95aa9ef6da8161d69f86b98b4
[2/8] arm64: dts: qcom: sm8450: Add missing properties for cryptobam
      commit: 0fe6357229cb15a64b6413c62f1c3d4de68ce55f
[3/8] arm64: dts: qcom: sm8550: Add missing properties for cryptobam
      commit: 663cd2cad36da23cf1a3db7868fce9f1a19b2d61
[4/8] arm64: dts: qcom: sm8650: Add missing properties for cryptobam
      commit: 38b88722bce07b6a5927f45fbf7a9a85e834572c
[5/8] arm64: dts: qcom: sa8775p: Add missing properties for cryptobam
      commit: a2517331f11bd22cded60e791a8818cec3e7597a
[6/8] arm64: dts: qcom: ipq9574: Add missing properties for cryptobam
      commit: b4cd966edb2deb5c75fe356191422e127445b830

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>
Re: (subset) [PATCH 0/8] dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees
Posted by Vinod Koul 4 months, 3 weeks ago
On Wed, 12 Feb 2025 18:03:46 +0100, Stephan Gerhold wrote:
> num-channels and qcom,num-ees are required for BAM nodes without clock,
> because the driver cannot ensure the hardware is powered on when trying to
> obtain the information from the hardware registers. Specifying the node
> without these properties is unsafe and has caused early boot crashes for
> other SoCs before [1, 2].
> 
> The bam_dma driver has always printed an error to the kernel log in these
> situations, but that was not enough to prevent people from upstreaming
> patches without the required properties.
> 
> [...]

Applied, thanks!

[7/8] dt-bindings: dma: qcom: bam-dma: Add missing required properties
      commit: b04b950fddfcf2f7b0e6f789499c256d15b70720

Best regards,
-- 
~Vinod
Re: (subset) [PATCH 0/8] dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees
Posted by Vinod Koul 4 months, 2 weeks ago
On Wed, 12 Feb 2025 18:03:46 +0100, Stephan Gerhold wrote:
> num-channels and qcom,num-ees are required for BAM nodes without clock,
> because the driver cannot ensure the hardware is powered on when trying to
> obtain the information from the hardware registers. Specifying the node
> without these properties is unsafe and has caused early boot crashes for
> other SoCs before [1, 2].
> 
> The bam_dma driver has always printed an error to the kernel log in these
> situations, but that was not enough to prevent people from upstreaming
> patches without the required properties.
> 
> [...]

Applied, thanks!

[7/8] dt-bindings: dma: qcom: bam-dma: Add missing required properties
      commit: e0e2cea86f75c8255b7da13ec92a34bb35a9c4fb
[8/8] dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees
      commit: 2f8a2cfd0994adf5f71737bb0946a76800479220

Best regards,
-- 
~Vinod