Re: [PATCH v6] dmaengine: qcom: bam_dma: Fix command element mask field for BAM v1.6.0+

From: Dmitry Baryshkov

Date: Fri Jun 12 2026 - 03:40:27 EST


On Thu, Jun 11, 2026 at 10:27:57AM +0530, Varadarajan Narayanan wrote:
> From: Md Sadre Alam <md.alam@xxxxxxxxxxxxxxxx>
>
> BAM version 1.6.0 and later changed the behavior of the mask field in
> command elements for read operations.
>
> In older BAM versions, or prior implementation assumptions, the mask
> field was effectively ignored for read commands. However, starting from
> BAM v1.6.0, the mask field for read commands is repurposed to carry the
> upper 4 bits of the destination address, enabling support for 36-bit
> addressing. For write commands, the mask field continues to function as
> a traditional write mask.
>
> The current driver sets mask = 0xffffffff for all command elements.
> While this works for write operations, it breaks read operations on
> BAM v1.6.0+ hardware. In such cases, the hardware interprets the upper
> address bits as 0xf, resulting in an invalid destination address
> (0xf_xxxxxxxx instead of 0x0_xxxxxxxx).
>
> This leads to failures such as NAND enumeration issues observed on
> platforms like IPQ5424.
>
> Fix this by assigning the mask field based on command type:
> - For read commands: set mask = 0 (upper address bits = 0)
> - For write commands: retain mask = 0xffffffff
>
> Also update the bam_cmd_element structure documentation to reflect the
> dual purpose of the mask field across BAM versions.
>
> This ensures correct behavior on BAM v1.6.0+ while maintaining backward
> compatibility with older hardware.
>
> Fixes: dfebb055f73a2 ("dmaengine: qcom: bam_dma: wrapper functions for command descriptor")
>
> Tested-by: Lakshmi Sowjanya D <lakshmi.d@xxxxxxxxxxxxxxxx>

No empty lines between the tags. Also missing cc:stable.

With those fixed:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxxxxxxxx>


> Signed-off-by: Md Sadre Alam <md.alam@xxxxxxxxxxxxxxxx>
> Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan@xxxxxxxxxxxxxxxx>
--
With best wishes
Dmitry