Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dmaengine: qcom: bam_dma: Avoid writing unavailable register

Avoid writing unavailable register in BAM-Lite mode.
BAM_DESC_CNT_TRSHLD register is unavailable in BAM-Lite
mode. Its only available in BAM-NDP mode. So only write
this register for clients who is using BAM-NDP.

Signed-off-by: Md Sadre Alam <quic_mdalam@quicinc.com>
Link: https://lore.kernel.org/r/20241220094203.3510335-1-quic_mdalam@quicinc.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Md Sadre Alam and committed by
Vinod Koul
57a7138d 30821373

+16 -8
+16 -8
drivers/dma/qcom/bam_dma.c
··· 59 59 #define DESC_FLAG_NWD BIT(12) 60 60 #define DESC_FLAG_CMD BIT(11) 61 61 62 + #define BAM_NDP_REVISION_START 0x20 63 + #define BAM_NDP_REVISION_END 0x27 64 + 62 65 struct bam_async_desc { 63 66 struct virt_dma_desc vd; 64 67 ··· 401 398 402 399 /* dma start transaction tasklet */ 403 400 struct tasklet_struct task; 401 + u32 bam_revision; 404 402 }; 405 403 406 404 /** ··· 445 441 writel_relaxed(val, bam_addr(bdev, 0, BAM_CTRL)); 446 442 447 443 /* set descriptor threshold, start with 4 bytes */ 448 - writel_relaxed(DEFAULT_CNT_THRSHLD, 449 - bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); 444 + if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START, 445 + BAM_NDP_REVISION_END)) 446 + writel_relaxed(DEFAULT_CNT_THRSHLD, 447 + bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); 450 448 451 449 /* Enable default set of h/w workarounds, ie all except BAM_FULL_PIPE */ 452 450 writel_relaxed(BAM_CNFG_BITS_DEFAULT, bam_addr(bdev, 0, BAM_CNFG_BITS)); ··· 1006 1000 maxburst = bchan->slave.src_maxburst; 1007 1001 else 1008 1002 maxburst = bchan->slave.dst_maxburst; 1009 - 1010 - writel_relaxed(maxburst, 1011 - bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); 1003 + if (in_range(bdev->bam_revision, BAM_NDP_REVISION_START, 1004 + BAM_NDP_REVISION_END)) 1005 + writel_relaxed(maxburst, 1006 + bam_addr(bdev, 0, BAM_DESC_CNT_TRSHLD)); 1012 1007 } 1013 1008 1014 1009 bchan->reconfigure = 0; ··· 1199 1192 u32 val; 1200 1193 1201 1194 /* read revision and configuration information */ 1202 - if (!bdev->num_ees) { 1203 - val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION)); 1195 + val = readl_relaxed(bam_addr(bdev, 0, BAM_REVISION)); 1196 + if (!bdev->num_ees) 1204 1197 bdev->num_ees = (val >> NUM_EES_SHIFT) & NUM_EES_MASK; 1205 - } 1198 + 1199 + bdev->bam_revision = val & REVISION_MASK; 1206 1200 1207 1201 /* check that configured EE is within range */ 1208 1202 if (bdev->ee >= bdev->num_ees)